Endpoint
{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_KEYstring
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
Examples
Async Mode (Polling)
- cURL
- JavaScript
- Python
Callback Mode (Webhooks)
- cURL
- JavaScript
- Python
Error Responses
See Errors for detailed error handling.