Error codes
Errors use OpenAI-compatible shapes with a code field. Common cases:
| HTTP | code | Meaning & fix |
|---|---|---|
| 401 | — | Missing or invalid API key. Check the Authorization: Bearer header. |
| 402 | insufficient_funds | Not enough balance to reserve the request. Recharge in the Console. |
| 403 | key_blocked / model_restricted | Key blocked by a kill switch, or model is admin-only. |
| 404 | model_not_available | No provider serves that model name. |
| 429 | rpm / tpm / concurrency | Rate limit exceeded. Respect the Retry-After header. |
| 502 | all_providers_failed | Every candidate provider failed after fallback. Retry shortly. |
| 503 | all_providers_blocked / provider_over_capacity | Providers disabled, or a market provider hit its exposure cap. |
A
402 happens before any upstream call — you're never charged for a request that can't run.Example
{
"error": {
"message": "Rate limit exceeded (rpm).",
"type": "rate_limit_exceeded",
"code": "rpm"
}
}