Routing & Failover
Configure smart routing rules, automatic failover, and load balancing for high-availability AI.
Cencori's Routing Engine allows you to decouple your application logic from specific providers.
Smart Routing Strategy
You can configure routing rules in the Dashboard > Gateway > Policies.
- Lowest Cost: Routes to the cheapest provider that meets the model capabilities (e.g.,
gpt-4ovsclaude-sonnet-4.5). - Lowest Latency: Routes to the provider with the fastest current response time.
- Performance: Routes based on historical quality scores (user feedback).
Automatic Failover
Web Dashboard Configuration
You can configure project-wide failover settings directly in the dashboard:
- Go to Settings > Providers.
- Scroll to the Fallback Configuration section.
- Toggle Enable automatic fallback.
- Select a Fallback Provider (e.g., if OpenAI fails, switch to Anthropic).
- Set Max Retries (default is 3 attempts before switching).
Tip
This helps prevent downtime during minor provider outages without changing your code.
Advanced Policy Configuration
For more complex logic, you can define routing policies via the Gateway API:
Example Configuration:
// Policy: "Reliability First"
{
"primary": "openai/gpt-4o",
"fallbacks": [
"anthropic/claude-sonnet-4.5",
"google/gemini-1.5-pro",
"mistral/large"
],
"conditions": {
"on_status": [429, 500, 503, 502]
}
}When OpenAI returns a 503 Service Unavailable, Cencori instantly rewrites the request and sends it to Anthropic.
Load Balancing
Distribute traffic across multiple API keys organization-wide to avoid hitting rate limits on a single account.
- Round Robin: Cycles through keys evenly.
- Weighted: Assign more traffic to higher-tier accounts.
- Rate Limit Aware: Automatically shifts traffic away from keys nearing their limit.

