Generation
API for generating AI content using smart media protocol (SMP) templates
Creates an asynchronous smart media generation task. Uses x402 protocol for payments with stablecoins. Returns a taskId for monitoring progress via the status endpoint.
JSON-encoded PaymentAuthorization object
{"maxAmountRequired":"0.10","assetType":"ERC20","assetAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","paymentAddress":"0x21aF1185734D213D45C6236146fb81E2b0E8b821","network":"base-mainnet","expiresAt":1704067200,"nonce":"random-nonce-12345","paymentId":"pay_123e4567-e89b-12d3-a456-426614174000","actualAmount":"0.05","timestamp":1704063600,"signature":"0x1234567890abcdef..."}
The template to use for generation
video
The main prompt describing the content to generate
A futuristic character waves in a neon cyberpunk city
JSON string containing template-specific configuration data
{"sceneDescription":"A futuristic character waves in a neon cyberpunk city","elevenLabsVoiceId":"zcAOhNBS3c14rBihAFp1","narration":"Hello, Bonsai. Load up your bags!","modelId":"hidream","stylePreset":"Cinematic"}
Optional seed for deterministic generation. If provided, will generate a seeded UUID based on the seed and timestamp.
Optional image file to use as base for generation (max 10MB)
POST /generation/create HTTP/1.1
Host: eliza.onbons.ai
Content-Type: multipart/form-data
Accept: */*
Content-Length: 367
{
"template": "video",
"prompt": "A futuristic character waves in a neon cyberpunk city",
"templateData": "{\"sceneDescription\":\"A futuristic character waves in a neon cyberpunk city\",\"elevenLabsVoiceId\":\"zcAOhNBS3c14rBihAFp1\",\"narration\":\"Hello, Bonsai. Load up your bags!\",\"modelId\":\"hidream\",\"stylePreset\":\"Cinematic\"}",
"seed": "text",
"image": "binary"
}
{
"taskId": "123e4567-e89b-12d3-a456-426614174000"
}
Retrieves the current status and result (if completed) of a generation task.
The task ID returned from the create endpoint
GET /generation/{id}/status HTTP/1.1
Host: eliza.onbons.ai
Accept: */*
{
"status": "completed",
"result": {
"generation": {
"text": "text",
"image": "text",
"video": {
"url": "https://example.com"
},
"templateName": "text",
"agentId": "123e4567-e89b-12d3-a456-426614174000"
},
"templateData": {}
}
}
Enhances the provided prompt to improve generation quality. Uses x402 protocol for payments with stablecoins. Returns the enhanced prompt
JSON-encoded PaymentAuthorization object
{"maxAmountRequired":"0.10","assetType":"ERC20","assetAddress":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","paymentAddress":"0x21aF1185734D213D45C6236146fb81E2b0E8b821","network":"base-mainnet","expiresAt":1704067200,"nonce":"random-nonce-12345","paymentId":"pay_123e4567-e89b-12d3-a456-426614174000","actualAmount":"0.05","timestamp":1704063600,"signature":"0x1234567890abcdef..."}
The prompt to enhance
A futuristic character waves in a neon cyberpunk city
The template to use for enhancement
video
Optional template-specific data to consider during enhancement
POST /generation/enhance HTTP/1.1
Host: eliza.onbons.ai
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"prompt": "A futuristic character waves in a neon cyberpunk city",
"template": "video",
"templateData": {}
}
{
"enhancedPrompt": "A futuristic character with glowing cybernetic enhancements waves enthusiastically at the camera in a neon-lit cyberpunk cityscape with holographic advertisements and flying cars in the background"
}