Errors
Errors use OpenAI's shape: {"error": {"message", "type", "code", "param"}}. Retry 429, 502, 503 and 504 with exponential backoff. Don't retry 400, 401, 402, 403, 404 or 413.
| HTTP | Code | When |
|---|---|---|
| 400 | invalid_request | Bad body or unsupported parameter (message names it) |
| 400 | unsupported_content | Image or audio parts |
| 400 | context_length_exceeded | infrastructure partner rejects for length, or estimate clearly too large |
| 401 | invalid_api_key | Missing, unknown or revoked key |
| 402 | insufficient_credits | Available balance can't cover the reservation |
| 403 | organization_suspended | Suspended |
| 404 | model_not_found | Unknown model or not allowed for this key |
| 413 | request_too_large | Body over 10 MB |
| 429 | rate_limit_exceeded | Our key or organisation limit, with `Retry-After` |
| 500 | internal_error | Our fault |
| 502 | upstream_error | The infrastructure partner failed |
| 503 | model_unavailable | Model paused or no eligible deployment |
| 504 | upstream_timeout | The infrastructure partner timed out |