Errors
Errors use OpenAI's shape { "error": { message, type, code, param } } (Anthropic's on /v1/messages), so the SDKs raise their usual typed exceptions.
400
invalid_request_errorMalformed request; `param` names the field. unsupported_parameter: the model lacks tools / image input.401
authentication_errorMissing, invalid, revoked or expired key.402
insufficient_quotaBalance too low for this request. Top up, or lower max_tokens.403
permission_errorRead-only key, IP / domain not allowed, account restricted, or management_key_required / a management key used for model calls.404
not_found_errorUnknown model (or the key may not use it), or preset_not_found.410
model_retiredThe model passed its sunset date and has no replacement. The message names what to use.409
idempotency_conflictA request with this Idempotency-Key is still running.429
rate_limit_errorToo many requests or concurrent requests. Honor retry-after.429
rate_limit_errortokens_limit_exceeded: the key's tokens-per-minute limit. Honor retry-after.429
insufficient_quotaThe key's spend limit (daily_ / weekly_ / monthly_spend_cap_reached, key_limit_reached for a lifetime limit) or the account's daily_spend_limit_reached.502 / 504
api_errorEvery model tried failed or timed out. Safe to retry.503
service_unavailableThe model is temporarily unavailable.