Forge is available: build a website with AI from your RodiumAi account.

Try Forge
RodiumAi docs
Guides

Errors & retries

One table to decide whether to fix the request, top up, wait or retry, plus a retry loop you can copy.

Decision table

StatusMeaningRetry?What to do
400 · 404 · 413 · 422The request itself is wrongNoFix the body, the model id or the payload size.
401Credential rejectedNoCheck the key, or refresh the OIDC token.
402Balance too low for the pre-flight holdNoTop up, lower max_tokens or pick a cheaper model.
403Key restriction (scope, allowed models, monthly quota)NoChange the key's settings or use another key.
429Rate limited (yours or the provider's)Yes, after Retry-AfterBack off and spread traffic over time.
500Unexpected gateway errorOnce or twiceKeep the request_id for support.
502 · 503 · 504Provider or platform temporarily unavailableYes, exponential backoffConsider a fallback model.

Every status, type and code is listed in the API errors reference.

Retry with backoff

Retry only 429 and 5xx. Honour Retry-After (seconds) when present; otherwise back off exponentially with jitter and cap the number of attempts. The official OpenAI SDKs already retry 429 and 5xx twice by default: set max_retries=0 / maxRetries: 0 when you run your own loop so attempts do not multiply.

…

What gets billed

  • A request that fails before generation starts (validation, authentication, balance, limits, provider refusal) costs nothing: its pre-flight hold is released.
  • A cancelled or interrupted stream is billed on the input plus the output actually delivered.
  • Details: Pricing and billing.

Errors inside a stream

A stream that fails after it started still has HTTP status 200. On chat completions the gateway sends a data: event with an error object (the same sanitised error as outside a stream), then data: [DONE]. Treat that event as a failure of the whole response and decide from its code whether to retry. Responses and Messages formats: Errors during a stream.

…

Provider failures

RodiumAI never forwards raw provider errors. Account, billing or permission problems on the provider side (provider 401, 402, 403) become 502 provider_unavailable; provider throttling becomes 429 rate_limit_exceeded with Retry-After; timeouts become 504 timeout and other outages 502 provider_unavailable; provider 400, 404, 413 and 422 keep their status with a stable code and a sanitised message. None of the 5xx cases means your key or your wallet is wrong.

Contacting support

  • The X-Request-Id of the failing response (or error.request_id on a 500).
  • The UTC time, endpoint, model id, HTTP status and error.code.
  • Never send your API key or the full content of sensitive prompts.