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

Model fallbacks

Chain Spot, your own Claude or OpenAI model and your local models in the CLI, so a request that fails on one moves to the next.

1 min readEdit this page

Spot already retries a failed request on another provider of the same model. It never switches models. To fall back to a different model, such as your Claude model when Spot can't answer, define a chain in the CLI on your machine.

Define a chain

bitrouter.yaml
models:
  coding:
    strategy: priority
    endpoints:
      - provider: <spare-provider>          # the provider id `spare models` shows for Spare
        service_id: deepseek-v4.1-flash
      - provider: anthropic                 # your key or subscription
        service_id: <your-claude-model>

Send "model": "coding" to the CLI, or start your agent with spare claude --model coding. Endpoints are tried in order, and the next one is used only after a failure: a server error, a timeout, a rate limit or an unavailable provider. A successful answer is never retried because of its quality.

The non-Spare endpoints use your key or subscription. A local model can sit in the same chain, first or last.

Fallbacks replace a request that failed. To choose a model for a request that would succeed, use the Cost routing.

Billing

Who answeredWho bills it
A Spot modelSpare, at the price of the provider that served it
Your Claude or OpenAI model, with your key or subscriptionYour provider; Spare bills nothing for the request
Your local modelFree

How is this guide?