For AI agents, the documentation index lists all pages. Append .md to a documentation URL for Markdown, or request text/markdown.

Skip to Content
spare inference

Errors

Error shapes, status codes and how provider failures surface.

1 min readEdit this page

Each endpoint returns errors in the shape of the API it follows, so existing error handling keeps working. /v1/messages uses Anthropic's shape; the others use OpenAI's. error.code is a stable machine-readable code.

StatusWhen
400The request is malformed
401The key is missing or invalid
402Your balance can't cover the request. Top up and retry
403The key lacks the scope this endpoint needs
404The model, or the request id, doesn't exist for this key
429Rate limited. error.code is rate_limit_exceeded for our limit, upstream_rate_limited when every provider was; Retry-After is set when known
502, 503, 504Every provider that could serve the model failed, was unavailable or timed out

When a provider fails, the request moves to the next provider that serves the model before you see an error. x-bitrouter-error-source: upstream on an error means it came from the providers, not from us.

How is this guide?