Generation

API for generating AI content using smart media protocol (SMP) templates

Create content generation task

post

Creates an asynchronous smart media generation task. Uses x402 protocol for payments with stablecoins. Returns a taskId for monitoring progress via the status endpoint.

Header parameters
X-PAYMENTstring · jsonOptional

JSON-encoded PaymentAuthorization object

Example: {"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..."}
Body
templatestringRequired

The template to use for generation

Example: video
promptstringRequired

The main prompt describing the content to generate

Example: A futuristic character waves in a neon cyberpunk city
templateDatastring · jsonOptional

JSON string containing template-specific configuration data

Example: {"sceneDescription":"A futuristic character waves in a neon cyberpunk city","elevenLabsVoiceId":"zcAOhNBS3c14rBihAFp1","narration":"Hello, Bonsai. Load up your bags!","modelId":"hidream","stylePreset":"Cinematic"}
seedstringOptional

Optional seed for deterministic generation. If provided, will generate a seeded UUID based on the seed and timestamp.

imagestring · binaryOptional

Optional image file to use as base for generation (max 10MB)

Responses
202
Generation task created successfully
application/json
post
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"
}

Check generation task status

get

Retrieves the current status and result (if completed) of a generation task.

Path parameters
idstring · uuidRequired

The task ID returned from the create endpoint

Responses
200
Task completed successfully
application/json
get
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": {}
  }
}

Enhance prompt for better generation

post

Enhances the provided prompt to improve generation quality. Uses x402 protocol for payments with stablecoins. Returns the enhanced prompt

Header parameters
X-PAYMENTstring · jsonOptional

JSON-encoded PaymentAuthorization object

Example: {"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..."}
Body
promptstringRequired

The prompt to enhance

Example: A futuristic character waves in a neon cyberpunk city
templatestringRequired

The template to use for enhancement

Example: video
templateDataobjectOptional

Optional template-specific data to consider during enhancement

Responses
200
Prompt enhancement successful
application/json
post
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"
}