Auto-detect task complexity for Claude models and route to the cheapest one that gets the job done. Simple tasks → Haiku. Complex tasks → Sonnet. Save 50%+ on API bills without touching output quality.
pip install claude-router
Route a prompt with a single call:
claude-router route "Explain quantum entanglement in one sentence"
claude-router route "Write a comprehensive technical spec for a distributed key-value store"
1. **Classify** — The router reads your prompt and scores it for complexity (factual, procedural, creative, analytical)
2. **Route** — Simple prompts (factual Q&A, greetings, lookups) go to Haiku. Complex (multi-step reasoning, code generation, analysis) go to Sonnet
3. **Respond** — You get the response. The routing is transparent — you can audit which model handled each request
| Pros | Cons |
|---|---|
| 50%+ cost reduction on typical workloads | Requires accurate complexity classification |
| Drop-in for existing Claude integrations | Some edge cases still need Sonnet |
|---|
| Transparent routing with full audit trail | Extra latency (~50ms) for classification |
|---|