TroubleshootingReference

Error codes

Every status and code the gateway returns, and what to do about it.

By the end: You can map a failure to its cause and its fix.

Every failure carries a stable machine-readable code. Branch on the code, not the message text.

StatusCodeMeaningFix
401invalid_api_keyThe key is unknown or malformed.Check the value and that it starts with sk_live_.
401revoked_api_keyThe key was revoked.Create a new key.
401unauthorizedNo key was sent.Add the Authorization header.
402insufficient_balanceBalance is zero.Redeem a code or contact an administrator.
403account_suspendedThe account is disabled.Contact support.
400invalid_requestBody is not a JSON object, or a field is missing.Check model and messages.
400model_not_foundThe model is not served here.Use an ID from GET /v1/models.
404not_foundThe route or action does not exist.Check the path.
413payload_too_largeBody exceeds the limit.Send less data (1 MiB default).
429rate_limit_exceededToo many requests.Wait retry-after seconds.
429quota_exceededA daily or monthly quota is spent.Wait for the period to reset.
502provider_errorThe model service returned an error.Retry with backoff; if persistent, try another model.
502provider_unavailableThe service could not be reached.Retry shortly.
504provider_timeoutThe model service timed out.Retry, or reduce the request size.
500internal_errorUnexpected gateway failure.Retry once, then report the request ID.

Request IDs

Every response carries x-request-id. Quote it when reporting a problem; it identifies the exact upstream attempt.