The async API (V2) lets you submit a generation request and poll for its response. The result is downloadable using a URL available when the job completes. This is the recommended approach for production workloads, as it avoids the connection timeouts that can affect long-running sync requests.
POST to an async endpoint (/v2/{endpoint}) with your generation parameters. The response is 202 Accepted with a job ID.GET /v2/{endpoint}/{id} every few seconds until the status field is completed or failed.status is completed, the result object contains one or more URLs pointing to the generated output files.completed and failed are terminal — stop polling when you see either.
The result object on a completed job is a map of output labels to URLs. The available keys depend on the endpoint — most video endpoints return video_url, while video-to-video-hdr returns exr_frames_url. Check each endpoint’s reference for the exact shape.
404 means the job doesn’t exist or has expired (see retention below).Job status and output URLs are available for 24 hours after the job reaches a terminal state. After that, GET /v2/{endpoint}/{id} returns 404. Download or re-host outputs before that window expires.
Errors appear in two places but use the same { type, message } shape:
POST or GET requests — validation, auth, rate limits, etc.Your error handling logic can use the same type checks (e.g., content_filtered_error, insufficient_funds_error) regardless of where the error appears. See Error Handling for the full list.
A complete submit → poll → download loop: