Add fallback models
Set the primary model withmodel. Set fallback models with models.
gpt-4o first. If that request fails, it tries each entry in models in order until one succeeds.
Choose the provider for each fallback
Fallback models can use model IDs orprovider:model.
Fall back from a private model to a hosted model
Fallback works with custom providers, too.my-ollama provider first. If that request fails, it falls back to OpenAI.
Choose fallback models carefully
Pick fallback models that can handle the same kind of request as the primary model. Check each model for:- Input modality.
- Tool calling support.
- Output size.
- Context window.
- Latency expectations.
- Provider credentials.
Access restrictions still apply
Fallback models must be allowed by the access key configuration assigned to the access key. If a fallback model isn’t allowed, the gateway rejects that model before routing the request upstream.Next steps
- Choose a model: Choose a model by ID or provider
- Restrict providers and models: Limit what an access key can call
- Model catalog: Compare model capabilities