Documentation Index
Fetch the complete documentation index at: https://to11.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
Fallback Routing
To configure automatic failover, use thefallback strategy. The gateway tries targets in declaration order and moves to the next one when it encounters a connection error or 5xx response.
Prerequisites
- At least two targets for the same model, each backed by a different provider or API key.
Full configuration example
The following config sets OpenAI as the primary target and Azure OpenAI as the backup forgpt-4o.
How fallback works
The gateway tries targets in the order they appear in thetargets list. If the current target fails (connection error or HTTP 5xx), the next target is attempted immediately.
When all targets have been tried and failed, the gateway retries the first target one additional time. This degraded-mode fallback avoids returning an error when a transient issue on the primary has already resolved by the time the chain completes.
Retry configuration
Add exponential backoff to each attempt with[routing.retry]. Retry wraps every managed-route attempt — combined with fallback, this gives automatic failover with retries.
Per-route retry override
Override the global retry settings for a specific route when you need different behaviour.gpt4o-failover route. All other routes continue to use the global [routing.retry] settings.
Multi-step fallback
For complex scenarios where each step in the fallback chain uses its own routing strategy, usesteps instead of targets.
When
steps is present, the top-level targets field on the route is ignored. Each step defines its own strategy and targets.Deprecation notice
Testing it
Simulate a provider outage by pointing a target at an unreachable URL, then verify the gateway falls back to the next target.Next steps
Function Routing
Decouple task names from model names with named functions.
Weighted Routing
Split traffic across providers by weight.
Configuration
Full TOML reference for all gateway settings.