Skip to main content
Generation is asynchronous. A successful submission creates a request and returns immediately while the work continues in the background.

Request lifecycle

Store the request_id as soon as a request is accepted. It is the stable identifier used by polling, cancellation, webhook deduplication, and support.
Send an Idempotency-Key with generation submissions so an ambiguous timeout can be retried without creating a duplicate request.

Initial response

Use the URLs from the response instead of constructing them manually. expires_after is how long, in seconds, the request’s data is kept after it finishes. See Data retention and deletion.

Completed output

The output field depends on the model’s output type.
Some video and 3D operations can return additional artifacts such as zip, mov, jsx, fbx, or ply. Once a request finishes, its status response includes expires_at: the time after which its files are deleted and output URLs stop working.

Cancel a request

Cancellation is available only while every job in the request remains queued.
A successful cancellation returns 202 Accepted with an empty body. If processing has started, the API returns 400 Bad Request.

Delete a request

Delete a finished request’s files, prompt and parameters immediately:
The API returns 200 OK with {"request_id": "...", "status": "deleted"}, also when the request was already deleted. A request that is still queued or in_progress returns 409 Conflict. Billing records are kept.
Request data is kept for seven days after the request finishes, or less if you shorten the retention. Copy completed media to your own storage if you need it for longer.