Errors
Handle the code, then show the message. Failed processing returns its credit reservation.
{
"error": {
"code": "insufficient_credits",
"message": "You need more credits for this request."
},
"detail": "You need more credits for this request."
}| HTTP | Code | What to do |
|---|---|---|
| 400 | invalid_form / invalid_json | Send a valid request body. |
| 401 | api_key_required / invalid_api_key | Use an active API key. |
| 402 | insufficient_credits | Add credits; no automatic overage is charged. |
| 403 | origin_not_allowed | Use the website or a server-side API client. |
| 404 | image_not_found | The image is not yours, was deleted or expired. |
| 409 | idempotency_conflict / image_not_ready | Use the same options with an existing key, or wait for processing. |
| 410 | result_expired | Use a new idempotency key for a new processing job. |
| 413 | too_large | Reduce the file or download binary instead of a large Base64 JSON response. |
| 422 | invalid_parameter / processing_failed | Check the source, resolution and options. Processing failures return credits. |
| 429 | rate_limit / free_limit / capacity_limit | Respect Retry-After; avoid rapid retries. |
| 502 | processing_failed | Retry after a failed job; do not repeat a still-running job. |
| 503 | setup_required | The service is not configured or is temporarily unavailable. |