Error Reference
HTTP status codes and error responses from the API.
Error Format
{
"error": {
"message": "Insufficient credits",
"type": "payment_required",
"code": 402
}
}Status Codes
| Code | Name | Description |
|---|---|---|
400 | Bad Request | The request body is malformed or missing required fields. |
401 | Unauthorized | Missing or invalid API key. |
402 | Payment Required | Insufficient credit balance. |
404 | Not Found | The requested model or resource does not exist. |
429 | Too Many Requests | Rate limit exceeded. Wait and retry. |
500 | Internal Server Error | Unexpected server error. Contact support if persistent. |
503 | Service Unavailable | The upstream model provider is temporarily unavailable. |
Retry Strategy
For 429 and 503 errors, implement exponential backoff starting at 1 second. For 402, top up your balance before retrying.