Model Fallbacks
Specify backup models that are tried in order if the primary model fails or is unavailable.
Configure fallback models
Pass a models array in providerOptions.gateway:
{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Hello"}],
"providerOptions": {
"gateway": {
"models": ["anthropic/claude-sonnet-4-6", "groq/llama-3.1-8b-instant"]
}
}
}The gateway tries:
openai/gpt-4o(primary model)anthropic/claude-sonnet-4-6(first fallback)groq/llama-3.1-8b-instant(second fallback)
The response comes from the first model that succeeds.
Each model runs the full routing chain
For each model in the list, the gateway runs the full routing chain:
- Operators - try operators serving this model (if available)
- Direct provider - call the provider API directly
If both tiers fail for a model, the gateway moves to the next model in the list.
Combining with provider ordering
Use models with order to control both model fallback and provider preference:
{
"model": "openai/gpt-4o",
"providerOptions": {
"gateway": {
"models": ["anthropic/claude-sonnet-4-6"],
"order": ["bedrock", "anthropic"]
}
}
}This tries:
openai/gpt-4ovia available providersanthropic/claude-sonnet-4-6via Bedrock first, then Anthropic direct
Observability
When fallbacks occur, the routing trace shows every model and provider attempted:
X-Tangle-Routing-Trace: openai/gpt-4o[openai(err:5001ms)], anthropic/claude-sonnet-4-6[anthropic(200:1847ms)]