Auto Routing
Overview
Section titled “Overview”TokenRouter automatically selects the best AI provider for each request based on cost, quality, latency, and availability.
How It Works
Section titled “How It Works”- Analyzes Request - Input length, complexity, features needed
- Scores Providers - Based on your routing mode
- Applies Rules - Custom routing and firewall rules
- Selects Provider - Optimal choice
- Routes Request - Sends to provider
- Returns Response - With routing metadata
Routing Modes
Section titled “Routing Modes”Use auto:* for automatic provider selection:
model: 'auto:balance' // Default: balanced optimizationmodel: 'auto:cost' // Minimize costsmodel: 'auto:quality' // Maximize qualitymodel: 'auto:latency' // Minimize response timeResponse Metadata
Section titled “Response Metadata”{ "metadata": { "provider": "openai", "routing_mode": "balance", "routing_confidence": 0.95 }}