LLM fallback routing
When a model errors, times out or stops answering, the AI Stupid Level Smart Router sends the same request to the next model in a chain it built before the first attempt: up to 5 fallbacks, your own order first, then automatic picks that prefer another provider. A model that keeps failing is skipped for 60 seconds, and the response says which model answered.
1,000 routed requests a month free · your own provider keys · no card
01
Every routed request carries its fallbacks from the start: up to 5, taken in this order from the models your keys, exclusions and limits allow.
auto-split, each request draws its primary model by weight, and the other models of the split follow, heaviest first.02
An attempt that ends without an answer moves the request to the next model in the chain. Attempts run one after another, and the first answer is returned.
message.refusal. It is not sent to other providers and not counted against your plan.03
Fallbacks protect one request. The circuit breaker protects the ones after it, so they do not each pay a failed attempt on a failing model.
04
stream_interrupted.05
The sandbox can simulate one. The request below runs through the real routing, treats the first model as failed and answers from the second with a mock reply. No provider is called.
curl -i https://aistupidlevel.info/v1/chat/completions \ -H "Authorization: Bearer aism_your_key_here" \ -H "Content-Type: application/json" \ -H "X-ASL-Sandbox: true" \ -H "X-ASL-Sandbox-Simulate: fallback" \ -d '{"model": "auto-coding", "messages": [{"role": "user", "content": "Hello!"}]}' # Response headers # X-AISM-Sandbox: true # X-AISM-Model: <the second model in the chain> # X-AISM-Reasoning: Sandbox: Fallback activated: <first model> failed -> routed to <second model>. ...
X-AISM-ModelX-AISM-Provider.X-AISM-ReasoningPOST /v1/route/preview returns the chain before anything is sent: the primary model, the fallbacks in order and fallback_enabled. Both are in the router documentation.
06
What went wrong decides the status, so a client can tell an outage from a setting it has to fix. Each of these lists the models tried in tried_models.
502 model_unavailable429 provider_rate_limitedRetry-After says when to try again.429 provider_quota_exceededx-should-retry: false, so an OpenAI SDK does not retry it in a loop.400 provider_key_rejected400 provider_rejected_request07
Fallbacks work behind any tool that sends a routing mode: Cline, OpenCode, LangChain and n8n, with the rest on the integrations hub. What an AI router is sets fallbacks beside the other things a router does. Related guides:
08
Fallback routing sends a request to a second model when the first one fails, so an error at one model or provider need not become an error in your application. The AI Stupid Level Smart Router builds the chain before the first attempt: up to 5 fallbacks on every routed request, your own fallback order first, then up to 2 automatic picks that prefer another provider. The response headers name the model that answered.
They describe the same move at two scales. Fallback is the rule for one request: this model failed, try the next. Failover is what that adds up to when a provider is down: traffic moves to another provider and comes back when the first one answers again. In the Smart Router the chain does the first and the circuit breaker the second.
At most 5. With no fallback order of your own, a request has its primary model and up to 2 automatic fallbacks. Your own order can hold up to 10 models, and the chain takes them first.
Fallbacks belong to routed requests: auto and the auto-* modes. A request that names a model id is sent to that model and no other, which is what naming a model is for. To get a chain, send a mode.
No. Plans count successful requests. A request that fails on every model is not counted, and one that a fallback answers is counted once. Plans and prices.
Free includes 1,000 routed requests a month on every provider and every mode, with your own provider keys and no card.
1,000 routed requests a month free · your own provider keys · no card
Coding, Reasoning, Tool use and Combined, over 24 hours, 7 days and 30 days.
Already have an account? Log in