README.md
</a>
<sub>
<a href="https://www.kimi.com/code?aff=ccr"><strong>Kimi Code Subscription</strong></a>
·
<a href="https://platform.kimi.ai?aff=ccr"><strong>API Global</strong></a>
·
<a href="https://platform.kimi.com?aff=ccr">API China</a>
</sub>
</td>
Connect Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, OpenCode, Pi, ZCode, and compatible API clients to the providers you choose—then route, fail over, extend, and observe every request from one app.
<p> <a href="https://github.com/musistudio/claude-code-router/releases"></a> <a href="#quick-start"></a> <a href="https://ccrdesk.top/"></a> </p> <p> <a href="README_zh.md"></a> <a href="https://discord.gg/rdftVMaUcS"></a> <a href="https://x.com/musistudio2026"></a> <a href="https://github.com/musistudio/claude-code-router/blob/main/LICENSE"></a> </p> </div>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, OpenCode, Pi, ZCode, 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:
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.
<details open> <summary><strong>Supported Agents</strong></summary> <div align="center"> <table width="100%"> <tr> <td align="center" width="330"> <a href="https://github.com/anthropics/claude-code"> <strong>Claude Code (CLI & APP)</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://github.com/openai/codex">
<strong>Codex (CLI & APP)</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://github.com/xai-org/grok-build">
<strong>Grok CLI (CLI)</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://github.com/MoonshotAI/kimi-cli">
<strong>Kimi CLI (CLI)</strong>
</a>
</td>
<strong>OpenCode (CLI & APP)</strong>
</a>
</td>
<td align="center" width="330">
<span>
<strong>Pi (CLI)</strong>
</span>
</td>
<td align="center" width="330">
<a href="https://zcode.z.ai/en">
<strong>ZCode (APP)</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://claude-design.ccrdesk.top/design">
<strong>Claude Design (APP)</strong>
</a>
</td>
<strong>Windows</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://github.com/musistudio/claude-code-router/releases/download/v3.0.16/Claude-Code-Router_3.0.16.AppImage">
<strong>Linux</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://github.com/musistudio/claude-code-router/releases/download/v3.0.16/Claude-Code-Router_3.0.16-mac-Apple-Silicon-arm64.dmg">
<strong>macOS (Apple Silicon)</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://github.com/musistudio/claude-code-router/releases/download/v3.0.16/Claude-Code-Router_3.0.16-mac-Intel-x64.dmg">
<strong>macOS (Intel)</strong>
</a>
</td>
Open Providers → Add Provider. Choose a built-in preset or a custom endpoint, enter the API key, select the protocol and models, then save.
Open Server and click Start. The local model gateway listens on http://127.0.0.1:3456 by default.
Open Agent Config, choose Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, OpenCode, Pi, or ZCode, select a model, and apply the profile.
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.
The npm CLI requires Node.js 22 or newer. It starts the same gateway and a browser-based management UI without Electron:
npm install -g @musistudio/claude-code-router
ccr ui
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 compose up -d --build
Docker exposes the management UI and gateway routes through http://127.0.0.1:3458 by default. Read the Docker deployment guide before exposing CCR remotely.
Claude Code · Claude Design · Codex · Grok CLI · Kimi CLI · OpenCode · Pi · ZCode · Compatible API clients
│
▼
Claude Code Router :3456
Profiles · Routing · Credentials · Tools · Logs
│
▼
Selected provider, model, and account
| Area | Highlights |
|---|---|
| Agents | Profiles for Claude Code, Claude Design, Codex, Grok CLI, Kimi CLI, OpenCode, Pi, and ZCode; model overrides; scopes; environment settings; CLI and app launch entries; multi-instance workflows |
| Providers | Presets and custom endpoints; protocol probing; model discovery; connectivity checks; local login import where supported; single keys and credential pools |
| Models & routing | Searchable catalog; model descriptions for task selection; conditions on headers and bodies; prefixes; rewrites; retries; ordered fallbacks |
| Tools & extensions | Fusion models; ToolHub; built-in browser automation; Chrome login-state import; wrapper and core gateway plugins; local routes and virtual models |
| Access & quotas | Separate CCR client keys with expiration and local request, token, and image limits |
| Observability | Request and response details; resolved provider, model, and credential; status; latency; tokens; estimated cost; tool calls; agent traces |
| AgentClaw | Agent relay through Weixin iLink, WeCom, Slack, Discord, Telegram, LINE, Feishu, and DingTalk |
The complete documentation lives at ccrdesk.top.
</a>
<sub>One-time support via Ko-fi</sub>
</td>
<td align="center" width="220">
<a href="https://paypal.me/musistudio1999">
</a>
<sub>International sponsorship</sub>
</td>
</td>
<td align="center" width="220">
<strong>WeChat Pay</strong>
</td>
<strong>Z智谱</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://aihubmix.com/">
<strong>AIHubmix</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://ai.burncloud.com">
<strong>BurnCloud</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://share.302.ai/ZGVF9w">
<strong>302.AI</strong>
</a>
</td>
<strong>RunAPI</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://teamorouter.com/">
<strong>TeamoRouter</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://code0.ai/agent/register/9n9jOsSnYQoemIVL?utm_source=claudecoderouter&utm_medium=partner&utm_campaign=claudecoderouter_2026&utm_content=default">
<strong>code0.ai</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://console.claudeapi.com/agent/register/LbmB7Y9kPloyzhwF?utm_source=claudecoderouter&utm_medium=partner&utm_campaign=claudecoderouter_2026&utm_content=default">
<strong>claudeapi</strong>
</a>
</td>
<strong>Qiniu Cloud AI</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://api.fenno.ai/register?redirect=/purchase?tab=subscription%26group=16&aff=9HHHAB5QLAES">
<strong>Fenno.ai</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://unity2.ai/register?source=claudecoderouter">
<strong>Unity2.Ai</strong>
</a>
</td>
<td align="center" width="330">
<a href="https://infistar.ai">
<strong>无限星河</strong>
</a>
</td>
<sub>If your name is masked, please contact me via my homepage email to update it with your GitHub username.</sub>
</div>This project is licensed under the MIT License.