FAQ from Claude Code Router
What is Claude Code Router?
Claude Code Router is an open-source, MIT-licensed CLI extension that adds intelligent, policy-driven model routing to Anthropic’s Claude Code. It enables developers to treat LLMs as interchangeable, purpose-built components—selecting the right model, at the right time, for the right task—while continuously optimizing for speed, accuracy, and cost.
How does real-time cost optimization work?
The router integrates live pricing data from supported providers (e.g., per-token rates from OpenRouter, tiered costs from Volcengine) and correlates them with historical performance metrics. When a request matches predefined criteria—such as low-complexity code generation or non-critical documentation—it automatically selects the most cost-efficient model that meets minimum quality benchmarks—without user intervention.
Can I enforce cost caps or budget alerts?
Yes. Through advanced configuration, you can define daily or session-level spending limits, set automatic model downgrade thresholds, and enable console notifications—or even halt routing—when projected costs exceed configured budgets.
Does routing introduce noticeable latency?
No. The routing decision engine executes in under 5ms on modern hardware. For most workflows, latency is dominated by the selected LLM’s inference time—not the router itself. Optional caching and connection pooling further minimize overhead.
How are model roles enforced?
Roles are enforced through both automatic heuristics (e.g., detecting “explain this algorithm” triggers think-mode routing) and explicit user commands (/think, /bg, /long). You retain full control—override defaults anytime, or lock roles per project via config profiles.
Is support available for fine-tuned or private models?
Absolutely. Any model accessible via standard LLM APIs—including self-hosted Llama 3 variants on Ollama, custom fine-tunes on Volcengine, or enterprise-deployed Gemini instances—can be registered and routed with full parameter control.
How are credentials secured?
All API keys are stored locally in encrypted, user-owned config files (~/.claude-code-router/config.json) with strict filesystem permissions. No credentials ever leave your device or touch external servers.
Are usage analytics built-in?
Yes—opt-in, local-only telemetry provides detailed breakdowns: tokens consumed per model, cost per session, average latency by role, and routing success/failure rates. Data never leaves your machine unless explicitly exported.
What license applies?
Claude Code Router is released under the permissive MIT License—free for commercial use, modification, and redistribution, with no royalties or restrictions.
Where can I contribute?
We welcome contributions! Visit GitHub to report bugs, propose enhancements, or submit documentation improvements. Our contribution guide and issue templates ensure smooth onboarding.
Does it support advanced LLM features?
Fully. Function calling, structured output, image input (via Gemini and OpenRouter-compatible endpoints), and tool-use orchestration are all preserved and normalized across providers—so your prompts and plugins work consistently, regardless of backend.