Skip to Content
Errors

Errors

Errors are returned in your ingress format’s native error shape with the correct HTTP status code. Upstream provider failures are mapped to a stable taxonomy — the code values below never change meaning, so you can switch models and providers without rewriting error handling.

Error envelopes per format

OpenAI-format requests get the OpenAI error object:

{ "error": { "message": "Workspace balance is not positive. Top up to resume.", "type": "insufficient_credits", "code": "insufficient_credits", "param": null } }

HTTP status: 402 Payment Required.

The taxonomy

This table is rendered from the gateway’s own error constants (@hyperinfer/shared), so it cannot drift from the implementation:

CodeHTTP statusMeaning
provider_auth502The upstream provider rejected our credentials. Not caused by your key.
provider_rate_limit429The upstream provider rate-limited the request. Retry with backoff.
provider_overloaded529The upstream provider is overloaded. Retry with backoff.
context_length_exceeded400The request exceeds the model's context window.
content_filter400The upstream provider's content filter blocked the request or response.
provider_timeout504The upstream provider timed out before completing the response.
provider_unavailable502The upstream provider could not be reached or returned a server error.
insufficient_credits402The workspace balance is not positive. Top up to resume.
key_limit_exceeded402A daily, monthly, or total spend limit on this API key was reached.
model_not_allowed403The key is pinned to specific models and this slug is not on its list.
invalid_api_key401The key is missing, malformed, revoked, disabled, or expired.
workspace_locked403The workspace has been locked by operations.
rate_limit_exceeded429Too many requests per minute on this key. Honor Retry-After.
invalid_request400The request body failed validation for the ingress format.
payload_too_large413The request body exceeds the 50 MB limit.
internal_error500Unexpected error on our side. Safe to retry.

Handling guidance

  • Retry with backoff: provider_rate_limit, provider_overloaded, provider_timeout, provider_unavailable, rate_limit_exceeded, internal_error. Honor the Retry-After header when present.
  • Fix the request: invalid_request, context_length_exceeded, payload_too_large, model_not_allowed.
  • Fix the account: insufficient_credits (top up), key_limit_exceeded (wait for the reset or raise the limit), invalid_api_key (rotate the key), workspace_locked (contact support).

The gateway itself retries upstream connect failures and pre-stream 5xx/429s at most twice with jittered backoff — and never retries once a response has started streaming, so you will never receive duplicated content.