Skip to main content

Errors and status codes reference

Reference for the status codes and body shapes the gateway returns, split by request path, with exact message text for 401, 403, 404, 429 and 5xx replies.

Last updated

The gateway returns errors in three body shapes. The failed check and the request path set the shape.

Body shapes#

ShapeLooks likeWhere it appears
FastAPI{"detail": "..."}The key check and the console APIs
Anthropic{"type": "error", "error": {"type": "...", "message": "..."}}Spend limit, POST /v1/messages and some replies on the OpenAI paths
OpenAI-style{"error": {"message": "..."}}POST /v1/chat/completions and POST /v1/responses

Key check errors#

The key check runs before any routing and uses the FastAPI shape.

StatusTriggerBody
401No key in the accepted headers{"detail": "API key required"}
401The key does not exist, was revoked, is disabled or has expired{"detail": "Invalid API key"}
401The owner of the key is disabled{"detail": "Account is disabled"}

A revoked key, an expired key and an unknown key share one message. When the value looks like a proxy token, the Invalid API key message adds this hint: This value looks like a proxy token. Put the proxy token in the URL path, not in the key. See authentication headers.

Spend limit#

The key sets a daily limit or a token limit. The key, its team or the instance can set the monthly spend limit. When the key reaches a limit, the gateway serves the own accounts and private provider keys of the owner. A request that none can serve returns 429 in the Anthropic shape. Model lists and token counting do not return it.

Limit reachedmessage starts withretry_after and resets_atRetry-After header
Daily spend limitDaily spend limit reachedYesYes
Monthly spend limitMonthly spend limit reachedYesYes
Monthly token limitMonthly token limit reachedYesYes

retry_after counts seconds until the reset. A daily limit resets at the next UTC midnight. A monthly limit resets at the start of the next UTC month.

See spend limits.

Personal address#

On a personal address, the proxy token sits in the URL path.

  • An unknown or disabled token returns 404 with {"detail": "Proxy token not found"}.
  • Many requests with an unknown token from one IP address return 429 with {"detail": "Too many invalid proxy token requests"} and a Retry-After header. A valid token is not blocked. A token created or rotated less than 10 seconds ago can still get 429.
  • The monthly USD limit can return 429. Read spend limits.

Per-key limits do not apply on this path.

POST /v1/messages#

This path returns the Anthropic shape. Each reply carries error.type and error.message.

Statuserror.typeTriggererror.message
401authentication_errorNo account or provider key is available, and the instance has noneAuthentication failed.
403permission_errorThe key has no usable account or provider key, but the instance has someProvider not enabled for your account. Enabled: ['claude']
400invalid_request_errorThe provider rejects the request, for example a prompt that is too longThe provider message, with a hint in some cases
404not_found_errorThe provider reports that the model does not existThe provider text, or Not found
429rate_limit_errorEvery candidate account is rate limited or in cooldownStarts with This request would exceed your organization's rate limit.
529overloaded_errorThe provider reports overload, the gateway waits too long for an account, or a gateway concurrency or capacity limit appliesOverloaded
529overloaded_errorAn Antigravity model is at capacityModel <model> is at capacity upstream. Retry shortly.
529overloaded_errorThe client app is bound to credentials that are all unusable, and no other credentials are allowedOverloaded
500api_errorNo other case in this table appliesInternal server error

The 403 list shows the providers that your key allows. An instance setting can replace the 529 message Overloaded. Other 429 messages can appear on this path.

The full 429 message then points to the provider rate-limit documentation.

Retry-After on this path#

A 429 or 529 caused by exhausted Claude or Antigravity accounts carries a Retry-After header in seconds.

A non-streaming request that waits about 110 seconds for a Claude account gets a 529 with a Retry-After header. The same wait for an Antigravity model gets a 529 without it, as does the 529 for a bound client app.

If the last provider reply was another 4xx or 5xx status, the gateway returns that status with a generic Anthropic body and no Retry-After header.

Streaming requests#

A streaming request can already have status 200 when the gateway needs more than about 10 seconds to find an account. The error then arrives as an error event in the stream. The reply has no Retry-After header.

POST /v1/chat/completions#

This path returns the OpenAI-style shape in most cases.

StatusTriggerBody
403No ChatGPT account or provider key is available to your key. This includes an instance with none.{"error": {"message": "Provider not enabled for your account. Enabled: ['openai']", "type": "permission_error"}}
401See the two forms belowAuthentication failed. in the OpenAI-style or the Anthropic shape
429All provider keys that can serve the request are rate limited{"error": {"message": "Rate limit reached. Please try again later.", "type": "rate_limit_error"}}
503No other case in this table applies{"error": {"message": "The server had an error while processing your request. Please try again later.", "type": "service_unavailable"}}
500 or the provider statusA free-model route fails{"error": {"message": "<message>", "type": "api_error"}}

The 403 message can end with a hint about custom providers or the model. The 429 and 503 replies carry no Retry-After header on this path. The private key and spend limit 429 replies are the exceptions.

The 401 reply has two forms. The instance setting for the credential order picks the path.

  • When provider keys come first, no provider key or account served the request. The body is {"error": {"message": "Authentication failed.", "type": "authentication_error"}}.
  • On the other path, no account and no provider key is available, which is rare. The body is the Anthropic shape.

POST /v1/responses and the compact route#

These paths return the OpenAI-style shape without a type field. The 401 reply is the exception. It uses the Anthropic shape.

StatusTriggerBody
401Rare. No account or provider key is available, and the request has no key owner or the owner's private key gives no reply{"type": "error", "error": {"type": "authentication_error", "message": "Authentication failed."}}
403No account or provider key is available to your key. This includes an instance with none.{"error": {"message": "Provider not enabled for your account. Enabled: [...]"}}
429All provider keys that can serve the request are rate limited{"error": {"message": "Rate limit reached. Please try again later.", "retry_after": 60}}
503No other case in this table applies{"error": {"message": "The server had an error while processing your request. Please try again later."}}
529Local capacity or an Antigravity model capacity limitThe same message as the 503 reply, with a Retry-After header
400The provider rejects the request as a caller error{"error": {"message": "<the provider message>"}}
502The provider returns an invalid reply to a compact request{"error": {"message": "Invalid compact response from upstream."}}

On this path the 429 reply puts the wait in retry_after in the body and sends no Retry-After header. The private key and spend limit 429 replies are the exceptions.

A provider error can pass through with the provider's own status and body.

Private provider keys#

A request that uses a private provider key does not move to another account. When the key cannot serve the request, the reply names the key. The three POST paths above can return these replies.

StatusTriggerMessage
409The key is disabledYour private <provider> key is disabled.
502The gateway cannot reach the provider, or the provider answers 401 or 403Could not reach the <provider> provider with your private key. or Your private <provider> key was rejected by the provider.
429The provider rate limits the keyThe provider text, or Your private <provider> key is rate limited.
Provider statusAnother provider errorThe provider text with secrets removed, or a generic message

A 429 reply carries a Retry-After header when the wait is known. POST /v1/messages and POST /v1/chat/completions set the error type to invalid_request_error, rate_limit_error or api_error. POST /v1/responses sends none.

Unhandled errors#

An unhandled error returns 500 with {"error": {"message": "Internal server error"}}. The reply carries an x-request-id header when the request has an id.

Console actions#

A read-only auditor that sends a write request to a console management route gets 403 with {"detail": "Auditor role is read-only"}.

See roles and access.