Skip to main content
Define a cross-provider fallback chain that routes requests through progressively cheaper models when the primary model is unavailable. Starts with GPT-4o and falls back through GPT-4o-mini, Claude 3 Sonnet, and Claude 3 Haiku.

Policy JSON

What It Does

  • Routes requests to the first available model in the chain
  • Falls back automatically when a model returns an error or the circuit breaker is open
  • Cross-provider resilience — if OpenAI is down, requests route to Anthropic
  • Denies the request only if all four models in the chain are unavailable
  • Works with TealCircuit to skip models with open circuit breakers

Example

GPT-4o is down, GPT-4o-mini returns a 503: Decision object:

Install

Customize

Fallback models may have different capabilities and pricing. Ensure your application handles capability differences gracefully — for example, a model with a smaller context window may truncate long prompts.