musistudio / claude-code-router
git clone https://github.com/musistudio/claude-code-router.git
v3.1.3 · 13d ago
One local control plane for every AI agent: route across models, fuse new capabilities, orchestrate tools, and stay fully in control.
+19
stars, 24h · #1,964
+~103
stars, 7 days · #2,093
+~440
stars, 30 days · #1,868
38k
★ total · +0% this week
3.2k
forks · 1.2k open issues
Star history (as recorded here)
LanguageTypeScript
LicenseMIT
Created2025-02-25 (1y ago)
Last push13d ago
Watchers139
OwnerUser
Links
- GitHub: github.com/musistudio/claude-code-router
- Homepage: https://ccrdesk.top/
- Releases · Issues · Hacker News mentions
README excerpt
# Claude Code Router ### Manage every agent and provider from one place. Connect Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, Kilo Code, OpenCode, Pi, ZCode, WorkBuddy, and compatible API clients to the providers you choose—then route, fail over, extend, and observe every request from one app. ## Why use Claude Code Router? Claude Code Router (CCR) is a local model gateway and control plane for coding agents. It gives Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, Kilo Code, OpenCode, Pi, ZCode, WorkBuddy, and compatible API clients **one stable local endpoint**, while you manage the providers, models, accounts, routing rules, and tools behind it from one place. Use CCR to: - **Manage all agents and providers together** instead of maintaining a separate model configuration for every client. - **Switch providers or models without changing your workflow** or repeatedly editing agent configuration files. - **Keep requests running** with retries, credential pools, key rotation, and ordered fallback models. - **Add capabilities to existing models** with Fusion vision, web search, MCP tools, and ToolHub. - **See what actually happened** through request logs, resolved routes, latency, token usage, cost estimates, and account status. CCR supports OpenAI Chat / Responses, Anthropic Messages, Gemini Generate Content / Interactions, OpenRouter, DeepSeek, SiliconFlow, Moonshot, Kimi Code, Mistral, Z.AI, Bailian, and custom compatible providers. Supported Agents Claude Code (CLI & APP) Codex (CLI & APP) Grok CLI (CLI) Kimi CLI (CLI) Kilo Code (CLI) OpenCode (CLI & APP) Pi (CLI) ZCode (APP) Claude Design (APP) WorkBuddy (APP) ## Quick Start ### Desktop app (recommended) 1. Download Claude Code Router for macOS, Windows, or Linux, then launch the app. Windows Linux macOS (Apple Silicon) macOS (Intel) 2. Open **Providers → Add Provider**. Choose a built-in preset or a custom endpoint, enter the API key, select the protocol and models, then save. 3. Open **Server** and click **Start**. The local model gateway listens on `http://127.0.0.1:3456` by default. 4. Open **Agent Config**, choose Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, Kilo Code, OpenCode, Pi, ZCode, or WorkBuddy, select a model, and apply the profile. 5. Start using your agent. Open **Logs** to confirm the resolved provider, model, status, tokens, latency, and errors. Your agent is now connected to CCR. To add conditions, retries, request rewrites, or fallback models, open **Routing**. ### CLI The npm CLI requires Node.js 22 or newer. It starts the same gateway and a browser-based management UI without Electron: [code] Open `http://127.0.0.1:3458`, then follow the same **Providers → Server → Agent Profiles** flow above. The model gateway remains at `http://127.0.0.1:3456`. See the CLI reference for service modes, authentication, and profile commands. ### Docker [code] Docker exposes the management UI and gateway routes through `http://