TL;DR — Claude Code Router (CCR) is an MIT-licensed, self-hosted local gateway that sits between coding agents (Claude Code, Codex, Grok CLI, Kimi CLI and others) and model providers, exposing one local endpoint (http://127.0.0.1:3456 by default) so you can route requests across providers with your own rules. It is the right tool if you want to run and tune the gateway yourself. CodeRouter is the hosted alternative for teams that want the same routing without operating the box. Everything below about CCR comes from its README as of 2026-08-30.
What Claude Code Router actually is
CCR describes itself as "a local model gateway and control plane for coding agents." Concretely:
- One local endpoint — agents point at
127.0.0.1:3456instead of a provider API; CCR forwards to whichever provider/model your rules select - Multi-agent — Claude Code, Codex, Grok CLI, Kimi CLI and other agents share the same gateway
- Providers supported (per README): OpenAI, Anthropic, Gemini, OpenRouter, DeepSeek, SiliconFlow, Moonshot/Kimi, Mistral, Z.AI, Bailian, plus custom OpenAI-compatible endpoints
- Control-plane features: credential pools, model fallback chains, request rewrites, retries, tool integration (MCP, ToolHub, web search), and request logging with latency, token and cost tracking
- License: MIT
Installing and starting it
The README documents three paths:
- Desktop app (recommended by the project): download the Windows/Linux/macOS build from the releases page → launch → configure providers → start the server
- CLI:
npm install -g @musistudio/claude-code-routerthenccr ui— requires Node.js 22+ - Docker:
docker compose up -d --build— the README asks you to read its deployment guide before exposing CCR remotely
Once running, point your agent at the local endpoint (for Claude Code that is the standard base-URL override — see our Claude Code base URL guide for the mechanics, which are identical for any OpenAI-compatible gateway).
Where the work goes: local gateway vs hosted router
Both approaches solve the same problem — routing coding-agent traffic to the right model — but they put the operational burden in different places.
| | Claude Code Router (self-hosted) | CodeRouter (hosted) | |---|---|---| | Who runs the gateway | You (desktop app, CLI process, or Docker) | We do — one OpenAI-compatible endpoint | | Routing rules | You author and maintain them | Automatic model selection, override per request | | Credentials | Your provider keys, managed in CCR's credential pools | One CodeRouter key; providers behind it | | Fallback / retries | Configurable in CCR | Built in | | Logs, cost tracking | Local, per README | Dashboard | | Best for | Developers who want full control and local-only traffic | Teams who want routing without running infrastructure |
Choose CCR when you need requests to stay on your machine, want to hand-tune rules per agent, or are comfortable maintaining Node/Docker services. Choose a hosted router when the gateway is not something you want to babysit — especially across a team, where one endpoint and one key beats N local configs.
Routing decision card
- Local requirement or air-gapped workflow → CCR (or any self-hosted gateway); a hosted router cannot satisfy "traffic never leaves my machine"
- Team of more than one, or agents on more than one machine → hosted router; per-machine gateways drift
- Both are OpenAI-compatible in spirit: switching between them is a base-URL change, not a rewrite — try one, measure, switch
- Related reading: Is Agent Router safe? · Agent Router models · LLM API error reference
Facts about Claude Code Router are taken from the project README (MIT, github.com/musistudio/claude-code-router) as of 2026-08-30; the project moves quickly — check the repo for current provider and feature lists.