GOPURAM

Errors

Every error code, its HTTP status, and which ones to retry.

Errors use the OpenAI JSON shape, so existing SDK error handling works unchanged:

{
  "error": {
    "message": "Model 'nope/never' does not exist or is not available",
    "type": "invalid_request_error",
    "code": "model_not_found",
    "param": "model"
  }
}

type is invalid_request_error when the fix is on your side, api_error otherwise. code is the machine-readable taxonomy:

CodeHTTPRetry?Meaning
invalid_request400nomalformed body, or a feature this model doesn't support (the message names it)
model_not_found400nounknown or unavailable model id
context_length_exceeded400noprompt too long for the model's window
invalid_api_key401nomissing, malformed, disabled or expired key
insufficient_credits402after top-upbalance is zero or below
model_not_allowed403nofree tier or key allowlist blocks this model (the message says which models work)
key_limit_exceeded403nothis key's spend cap is reached
account_suspended403nocontact support
rate_limited429yes, after Retry-Afterper-key rate limit, or the upstream provider throttling
too_many_concurrent429yes, when a stream finishesper-key concurrent-stream limit
provider_overloaded502yes, with backoffupstream provider is overloaded
provider_error502yes, with backoffupstream provider failed
upstream_auth502yes, brieflygateway-side provider configuration issue (our pager is already ringing)
gate_unavailable503yes, after Retry-Afterbilling gate briefly unreachable — never results in a free or lost charge
timeout504yesupstream timed out

Guidance:

  • Retry only what the table marks retryable, with exponential backoff and jitter; honor Retry-After when present.
  • 4xx never fixes itself — don't retry it in a loop.
  • Failures after streaming has started arrive in-band with finish_reason: "error" — see Streaming.
  • One retry against an overloaded provider is already performed inside the gateway before you ever see provider_overloaded.

Include the X-Gopuram-Request-Id response header when reporting anything — it pinpoints the exact request in our logs (which contain metering data only, never your prompts).