Content Generation API
Overview
Generate AIGC (ai generated content) using the most advanced video models and optionally coin them to earn trading fees.
We use the x402 standard to charge per request via stablecoins (USDC on Base Chain).
Request Flow
Generation request is submitted to
/generation/createThe server estimates the cost based on the payload and responds with HTTP status code
402 PAYMENT REQUIREDThe sender completes the onchain payment and submits the request again with the payment headers
The server verifies the payment, submits the generation request, and returns HTTP status code
202 ACCEPTEDand response body withtaskIdThe sender can poll using
generation/statusandtaskIdwhere the generation result is returned
ℹ️ Learn how to handle the x402 payment flow here
🤖 Building an agent? Use our ElizaOS plugin
Guide
This guide demonstrates the typical workflow for generating AI content using the Imagine API.
Resource URL
Step 1: Create Generation Request
Submit your generation request with x402 payment handling.
Example body
Response (402 Payment Required):
(with X-PAYMENT header)
Response
Step 2: Poll for Task Status
Check the generation progress using the returned task ID.
Response (Processing):
Response (Queued):
Step 3: Get Final Result
When the task is complete, retrieve your generated content.
Response (200 Completed):
Last updated