API
Errors.
Errors use a stable envelope with a request id. Include that id when contacting support.
Envelope
Error
{
"error": {
"type": "invalid_request_error",
"code": "image_too_large",
"message": "Image exceeds the 40 megapixel limit for your plan.",
"param": "image_url",
"request_id": "req_01J...",
"details": { "max_megapixels": 40 }
}
}Status codes
| NAME | TYPE | DESCRIPTION |
|---|---|---|
| 400 | invalid_request | Malformed JSON, header, or idempotency key. |
| 401 | authentication | Missing, invalid, expired, or revoked key. |
| 402 | billing | Insufficient credits or plan limit. |
| 403 | permission | Scope, IP, suspended workspace, or model gate. |
| 404 | not_found | Job, file, or webhook not found. |
| 409 | conflict | Idempotency reuse/in-progress or invalid job state. |
| 413 | too_large | File or request body exceeds the limit. |
| 415 | media_type | Unsupported content type. |
| 422 | validation | Image decode, mask mismatch, prompt required, no target. |
| 429 | rate_limit | Too many requests or too many concurrent jobs. |
| 500 / 503 | api_error | Unexpected error or provider unavailable. |
Retry guidance
Retry 429, 503, and network errors with exponential backoff. Do not retry 4xx except 409 idempotency_in_progress after the suggested delay.