Skip to main content
Every failure returns the same envelope. error.code is stable and safe to branch on; message is for humans and may change.
code is always present. provider_code appears when the failure came from a model provider and carries the more specific reason — branch on code first, then narrow on provider_code if you need to. Always log request_id. It is the only handle that ties your failure to our logs, and support cannot trace a report without it.

What to do about it

Every error falls into one of these classes. The class tells you where the remedy lies; the row then names the specific action.

Your request

Something about the request itself was rejected. Retrying it unchanged will fail the same way.

Your account

The request was well-formed, but your account’s own limits or balance stopped it. Nothing reached a model, and nothing was charged.

Service-side failures

The remedy differs per code — most clear on a retry with backoff, some need a different action. Each row says which.

Depends on the individual results

One code covering several attempts. Which side is at fault is in the per-attempt detail in the response body, not in the code itself.

Where it failed

Failed requests in the dashboard logs carry a failure_stage — how far the request got before it stopped. Successful requests have none.

What errors never contain

Messages are stripped of upstream internals before they reach you — SDK call frames, cloud resource identifiers and anything credential-shaped. Two consequences worth knowing:
  • Which provider served a request is not disclosed. A model is reachable through more than one upstream and we may fail over between them, so the provider is not part of the contract. X-Mesh-Routing-* response headers tell you that a fallback happened, not to where.
  • A problem with our own upstream account reads as a provider outage. If one of our provider credentials is rejected or throttled, you get upstream_error with a generic message rather than the specific cause. When you use your own provider key (BYOK) the real error is forwarded to you, because the account is yours to fix.