Errors
Every response uses a consistent JSON envelope. Successful responses set ok: true and place the payload in data. Errors set ok: false and describe the problem in error.
{
"ok": false,
"error": {
"code": "INVALID_KEY",
"message": "The provided API key is missing or invalid."
}
}Error codes
| Code | HTTP status | When it occurs |
|---|---|---|
INVALID_KEY | 401 | The X-API-Key header is missing, malformed, or has been revoked. |
RATE_LIMITED | 429 | Too many requests. Wait for the duration specified in the Retry-After response header before retrying. |
INSUFFICIENT_CREDITS | 402 | The account does not have enough credits to run this task. |
INVALID_INPUT | 400 | A required field is missing, a value is out of range, the file format is unsupported, or the file exceeds the size limit. |
NOT_FOUND | 404 | The task_id does not exist or does not belong to the authenticated account. |
INTERNAL | 500 | An unexpected server error. These are safe to retry with exponential backoff. |
TASK_FAILED | (inside data.error when status=failed) | The task ran but encountered a fatal error. The message field contains details. See Polling task status. |