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

Reliability

When a provider fails, the request moves to the next provider serving the same model. What happens before and during a response, and what you pay.

2 min readEdit this page

A request can fail because a provider is down, slow, rate limited or out of capacity. Spare retries it on the next provider that serves the same model before you see an error, so most provider failures never reach your code. It never switches to a different model.

Before the response starts

Every request to https://api.spareinference.ai gets this, with no setup. Each model has several providers; when the one serving your request fails, the next one in line takes it.

What happenedFalls back?
The provider returned a server error, or was unavailableYes
The provider timed outYes
The provider rate limited the request (429)Yes
The provider rejected the request's parameters, or its own credentialsYes; another provider may accept it
The provider doesn't serve the model after allYes
Your request is malformed, your key is invalid or lacks a scopeNo: every provider would refuse it
Your balance can't cover it (402)No

If every provider fails, you get the last provider's error, with x-bitrouter-error-source: upstream so you can tell it came from the providers and not from Spare. The error codes are the same as without fallback.

While a response is streaming

What happens when a provider fails after it has started streaming, what your client receives, and how the partial response is billed.

Which providers are tried

The providers tried are the ones your request allows: with a routing preset that sets routing.only or routing.ignore, fallback stays inside that list. Each request's settlement and the console's Activity page show which provider finally served it, and you pay the price of that provider.

Requests that fail

If every provider fails, the request isn't charged.

Falling back to a different model

Spot only ever answers with the model you asked for. To fall back to another model, such as your own Claude model when Spot can't answer, see Model fallbacks.

How is this guide?