Routing Policies
Configure intelligent request routing across providers.
Routing Policies#
Routing policies control how the Gateway selects a provider for each request. Policies are evaluated in order of priority.
Policy Types#
- cost-optimized: select the cheapest provider that meets latency requirements
- latency-optimized: select the fastest provider
- round-robin: distribute requests evenly across providers
- failover: use a primary provider with automatic fallback
Example Policy#
yaml
policies:
- name: production-default
type: failover
primary: openai
fallback:
- anthropic
- google
healthCheck:
interval: 30s
timeout: 5s