Errors
Conventional HTTP status codes with a stable machine-readable body.
Errors use conventional HTTP status codes and a stable machine-readable body:
{
"error": {
"code": "insufficient_credits",
"message": "Not enough credits for this task.",
"required": 10,
"available": 2
}
}code | HTTP | Meaning | Retry? |
|---|---|---|---|
invalid_request | 400 | Missing or invalid parameter (e.g. more files than the model takes — param names the field), or input values the model itself refused. The message explains which. | No — fix the request. |
moderation_blocked | 400 | The prompt, or an uploaded or linked file, was rejected by content moderation — or a linked video could not be reviewed. | No — change the prompt or the file. |
media_not_uploaded | 400 | A media input is not a file on this service (nor on a domain the service has approved). Upload it with POST /api/v1/uploads (or use a previous task output URL). | No — upload first. |
media_unreadable | 400 | The size or duration of a media input could not be read, so it can't be priced. Nothing was charged. | Retry once; if it persists, re-encode and upload again. |
invalid_api_key | 401 | Key missing, malformed, revoked or expired. | No — use a valid key. |
insufficient_credits | 402 | Not enough credits; the body includes required and available. | After topping up. |
forbidden | 403 | Your account can't use the API at the moment, or the model, or an option / param you sent, requires a subscription your account doesn't have (param names the option / param). The message explains which. | No. |
storage_quota_exceeded | 403 | The upload would exceed your account's storage quota. | After freeing space or upgrading. |
upload_suspended | 403 | Uploads (and media linked from approved domains) are paused after several files were rejected by content moderation. Files already on this service still work as inputs. | Yes — after Retry-After. |
not_found | 404 | Task doesn't exist or belongs to another account. | No. |
payload_too_large | 413 | The uploaded file exceeds the size limit. | No — use a smaller file. |
rate_limited | 429 | Too many requests or tasks in progress. | Yes — honor Retry-After. |
internal_error | 500 | Something broke on our side. | Yes — with backoff. |