Skip to content

Errors and task recovery ​

Distinguish a rejected request, a failed backend task, and interrupted delivery.

SituationAction
400, invalid/conflicting parametersCorrect the request using the capability reference
401 / 403, authentication/permissionsCheck the customer key, model access, and account restrictions
429, capacity/rate limitWait for capacity; an image request rejected at admission is not submitted
413, upload limitReduce the upload or use a readable reference URL
Video status failedRead the error; failed tasks follow the refund policy
Image SSE errorTreat as a failed event and keep request IDs; HTTP 200 does not override it
Timeout, 502/504, disconnectCheck the original task and consumption before re-submitting

Image success requires image_generation.completed, image_edit.completed, or custom image_url.completed when delivery:"url" is set. Heartbeats and [DONE] alone do not prove success. Decode Base64 or download the URL and verify the result. Preserve X-Image-Request-Id and final request_id for support.

For videos, poll queued/in_progress, download completed, and handle failed. unknown is an unrecognized state, not completion or a reason to create a duplicate task.

Inspect the final state and output when receiving Responses response.completed. For background Responses, preserve both resp_... and metadata.task_id for polling and content download.

Read the image guide and video guide for exact limits.