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

  1. Generation request is submitted to /generation/create

  2. The server estimates the cost based on the payload and responds with HTTP status code 402 PAYMENT REQUIRED

  3. The sender completes the onchain payment and submits the request again with the payment headers

  4. The server verifies the payment, submits the generation request, and returns HTTP status code 202 ACCEPTED and response body with taskId

  5. The sender can poll using generation/status and taskId where 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