DocsError handling

Error handling

Error shapes

Gateway errors use {"error": {"code": "..."}}. Errors from upstream keep the native shape of the protocol you called: {"type": "error", "error": {...}} for Messages, {"error": {"type", "message"}} for OpenAI, and {"error": {"code", "message", "status"}} for Gemini.

Status & codeMeaning & fix
400invalid_requestGatewayThe body is not valid JSON or a field is invalid.Check the JSON and send Content-Type: application/json.
400request_not_coveredGatewayThis key does not accept something in the request: a built-in tool such as web search on Responses or Chat, background mode, or non-text output. The response message says which.Remove what the message names. The same request will not succeed on retry.
401invalid_api_keyGatewayThe key is missing, malformed, or a demo_ key.Send a real key: Authorization: Bearer <KEY>.
401INVALID_API_KEY / API_KEY_DISABLEDUpstreamThe key does not exist or is disabled.Check the key in your workspace or create a new one.
403https_requiredGatewayThe request used plain http://. The gateway does not process or forward it. With Always Use HTTPS enabled the site may instead redirect it to https://; either way the key was already sent in cleartext.Use an https:// base URL, and rotate any key already sent over http://.
403model_not_allowedGatewayThis model is not enabled on this site.Call GET /v1/models for the IDs you can use.
403INSUFFICIENT_BALANCEUpstreamYour balance is exhausted.Top up and retry. If a provider issued your key, contact them.
403API_KEY_EXPIRED / GROUP_NOT_ALLOWEDUpstreamThe key has expired or its group is unavailable.Create a new key or choose another group.
404route_not_foundGatewayThe path is not a public endpoint.OpenAI-compatible clients need /v1 at the end of the base URL; clients that add /v1 themselves, such as Claude Code, work with or without it. Then check the path and method against the API reference.
413body_too_largeGatewayThe body is larger than 32 MB.Trim the context or use caching.
429rate_limitedGatewayToo many requests per minute from one IP.Back off and retry after Retry-After.
429API_KEY_QUOTA_EXHAUSTED / rate_limit_exceededUpstreamThe key quota is used up, or a key or group rate limit was hit.Raise the key quota or back off per Retry-After.
429managed_credit_large_requests_busyUpstreamToo many large requests (over 4 MB each) are being handled at once.Retry after Retry-After, or compact the context.
429gateway_concurrency_limitUpstreamToo many concurrent requests.Lower concurrency and retry.
502upstream_errorUpstreamThe upstream provider rejected the request or failed.Retry later; if it persists, contact support with x-request-id.
503inference_not_configuredGatewayThis site does not serve inference right now.Check the status page for availability.
503overloaded_errorUpstreamUpstream is overloaded or no account is available.Retry with exponential backoff or switch to a similar model.

Retrying

Retry only 429, 502, and 503, with exponential backoff that honours Retry-After. 400, 401, and 403 are terminal and will not succeed on retry. Include x-request-id when reporting an issue.

Service availabilityAccounts and key delivery live in your workspace (/workspace). Available endpoints and models depend on current service status and account access. Top up in US dollars by card, or by Alipay or WeChat Pay where the checkout lists them; if you already hold USDC, you can use native USDC on Solana. View service status