Fallback and Auto-Failover
If one provider goes down, your app should not go down with it. Routor handles this automatically by trying the next model in the chain without your app ever seeing an error.How It Works
Every routing decision comes with a fallback chain. It is an ordered list of models to try, from preferred to least preferred within the tier. Your app gets a successful response. If your Routor deployment hasDEBUG_ROUTING=1 set, the only sign something happened is the X-Routor-Fallback: true header - otherwise, check the dashboard’s request logs, which record fallback activity regardless of that setting.
What Triggers a Fallback
| Situation | What Routor does |
|---|---|
| Provider returns a 5xx error | Tries next model in chain |
| Request times out | Tries next model in chain |
| Provider rate-limits the request (429) | Tries next model in chain |
| Model context window too small | Tries next model with a larger window |
| All models in the chain fail | Returns 502 to your app |
Startup Validation
Before accepting any traffic, Routor pings every configured provider using their free/models endpoint. This costs nothing and takes a few seconds.
Any provider with an invalid key or an unreachable endpoint gets removed from the routing pool right there. They will not show up in any fallback chain until the server restarts with a working key.
So the fallback chain you get is always made of providers that are actually reachable right now.
Detecting a Fallback
When Routor falls back to a secondary model, and the server hasDEBUG_ROUTING=1 set, it adds a header:
Checking Provider Status
The Provider Health page in the dashboard shows which providers are active, their error rates, and latency over the past 5 minutes.If Everything Fails
If every model in the fallback chain fails, Routor returns a502: