Errors

Errors use OpenAI's shape { "error": { message, type, code, param } } (Anthropic's on /v1/messages), so the SDKs raise their usual typed exceptions.

400invalid_request_errorMalformed request; `param` names the field. unsupported_parameter: the model lacks tools / image input.
401authentication_errorMissing, invalid, revoked or expired key.
402insufficient_quotaBalance too low for this request. Top up, or lower max_tokens.
403permission_errorRead-only key, IP / domain not allowed, account restricted, or management_key_required / a management key used for model calls.
404not_found_errorUnknown model (or the key may not use it), or preset_not_found.
410model_retiredThe model passed its sunset date and has no replacement. The message names what to use.
409idempotency_conflictA request with this Idempotency-Key is still running.
429rate_limit_errorToo many requests or concurrent requests. Honor retry-after.
429rate_limit_errortokens_limit_exceeded: the key's tokens-per-minute limit. Honor retry-after.
429insufficient_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 / 504api_errorEvery model tried failed or timed out. Safe to retry.
503service_unavailableThe model is temporarily unavailable.