Errors
Errors follow the OpenAI error format, so SDK error handling works unchanged.
Error format
json
{
"error": {
"message": "You have run out of credits. Contact support to top up your account.",
"type": "insufficient_quota",
"code": "insufficient_quota"
}
}Error codes
| Status | Code | Meaning |
|---|---|---|
| 400 | invalid_request_error | The request body is malformed — missing messages, invalid parameter values, or invalid JSON. |
| 401 | invalid_api_key | The API key is missing, malformed, revoked, or unknown. |
| 403 | account_not_approved | Your account is not active yet. API access is enabled once your account is activated. |
| 404 | model_not_found | The requested model slug doesn't exist or isn't available yet. |
| 429 | insufficient_quota | Your credit balance is exhausted. Request a top-up from your dashboard. |
| 429 | rate_limit_exceeded | Too many requests on this API key (60 requests/minute). Check the x-ratelimit-* response headers and retry after a short wait. |
| 429 | key_spend_cap_reached | This key hit its monthly spend cap. Raise or remove the cap under Dashboard → API Keys. |
| 502 | upstream_error | The underlying model provider returned an error. Retry the request. |