Skip to main content
Submit a generation task to any supported AI model.

Endpoint

Replace {model} with the model ID (e.g., nano-banana, flux-2, sora-2, midjourney).

Headers

string
required
Bearer token for API authentication. Format: Bearer YOUR_API_KEY
string
required
Must be application/json.

Request Body

string
default:"async"
required
How to receive results. async for polling via the status endpoint, callback for webhook delivery.
string
Webhook URL for receiving results. Required when request_type is callback. Must be a publicly accessible HTTPS URL that responds with HTTP 200 within 30 seconds. See Webhooks for details.
object
required
Model-specific generation parameters.
See individual model documentation for complete parameter lists, or the Parameter Specification for all common fields.

Response

integer
HTTP status code.
string
Human-readable status message.
object
Save the taskId — you’ll need it to query status or debug issues later.

Examples

Async Mode (Polling)

Callback Mode (Webhooks)

Error Responses

See Errors for detailed error handling.