Find a file
musi f22f2a4c79
Some checks failed
Docs / Build (push) Has been cancelled
Docs / Deploy (push) Has been cancelled
chore: release 3.0.15 and cli docker 3.0.7
2026-07-20 22:30:19 +08:00
.github/workflows Remove obsolete CI workflow 2026-07-15 14:03:04 +08:00
benchmarks Refactor request routing and provider coordination 2026-07-15 13:32:14 +08:00
blog Update README acknowledgements and screenshots 2026-06-25 19:58:57 +08:00
build Update routing workflows and supporting configuration 2026-07-19 20:07:40 +08:00
cdn Remove CDN workflow and add MIT license info 2026-06-28 21:45:45 +08:00
docker Refactor router pipeline and improve provider handling 2026-07-14 06:23:02 +08:00
docs Support xAI video generation and isolate Codex authentication 2026-07-20 15:38:13 +08:00
examples/plugins Decouple Claude Design proxy from browser app 2026-06-26 22:48:53 +08:00
extension/chrome Refactor router context handling and update integrations 2026-07-07 18:56:28 +08:00
local/claude-gateway Refactor router internals and update related integrations 2026-07-16 09:29:48 +08:00
outputs Update routing workflows and supporting configuration 2026-07-19 20:07:40 +08:00
packages chore: release 3.0.15 and cli docker 3.0.7 2026-07-20 22:30:19 +08:00
scripts Refactor router implementation and configuration 2026-07-20 20:21:18 +08:00
tests Refactor router internals and remove obsolete code 2026-07-15 06:39:29 +08:00
.dockerignore Refactor routing and provider integration 2026-07-05 19:57:39 +08:00
.gitignore Refactor router internals and remove obsolete code 2026-07-15 06:39:29 +08:00
.npmrc init 2026-06-17 11:58:37 +08:00
components.json Refactor routing and provider integration 2026-07-05 19:57:39 +08:00
docker-compose.yml Simplify Docker networking and external URL handling 2026-07-06 22:16:30 +08:00
Dockerfile build: slim docker runtime image 2026-07-06 22:54:46 +08:00
electron-builder.json fix: set linux executable name for AppImage 2026-07-06 22:32:57 +08:00
LICENSE Remove CDN workflow and add MIT license info 2026-06-28 21:45:45 +08:00
musk-claude-code-router-sponsor.jpg Update routing workflows and supporting configuration 2026-07-19 20:07:40 +08:00
package-lock.json chore: release 3.0.15 and cli docker 3.0.7 2026-07-20 22:30:19 +08:00
package.json chore: release 3.0.15 and cli docker 3.0.7 2026-07-20 22:30:19 +08:00
playwright.config.ts Refactor routing and provider integration 2026-07-05 19:57:39 +08:00
README.md Add NVIDIA NIM provider preset and preserve Claude model selection 2026-07-20 11:08:04 +08:00
README_zh.md Add NVIDIA NIM provider preset and preserve Claude model selection 2026-07-20 11:08:04 +08:00
tsconfig.json Refactor router internals and remove obsolete code 2026-07-15 06:39:29 +08:00
tsconfig.node.json init 2026-06-17 11:58:37 +08:00

Kimi K2.7 Code sponsor banner
Kimi Code Subscription  ·  API Global  ·  API China

Thanks to Kimi for sponsoring this project! Kimi K2.7 Code is an open-source, coding-focused agentic model developed by Moonshot AI, with substantial gains on real-world long-horizon coding tasks and higher end-to-end success across complex software engineering workflows. It also cuts thinking-token usage by approximately 30% compared with K2.6. Inside CCR, Kimi ships as built-in provider presets: import the pay-as-you-go API or the Kimi Code subscription in one click and route your coding agent's requests to Kimi, the subscription endpoint passes straight through natively with no protocol conversion, API endpoints are adapted automatically, and your balance and subscription usage show up right in the CCR dashboard.

CCR already supports Kimi. Visit the Kimi Open Platform (中文站 | Global) to try the API, or explore the cost-effective Coding Plan.

Claude Code Router

Manage every agent and provider from one place.

Connect Claude Code, Codex, Grok CLI, ZCode, and compatible API clients to the providers you choose—then route, fail over, extend, and observe every request from one app.

Download Desktop Quick Start Read the Docs

Chinese README Discord X License


Claude Code Router Desktop dashboard

Why use Claude Code Router?

Claude Code Router (CCR) is a local model gateway and control plane for coding agents. It gives Claude Code, Codex, Grok CLI, 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:

  • 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.

Quick Start

  1. Download Claude Code Router for macOS, Windows, or Linux, then launch the app.
  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, Codex, Grok CLI, or ZCode, 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.

Desktop packages and local data locations
  • macOS Apple Silicon: Claude-Code-Router_<version>-mac-Apple-Silicon-arm64.dmg or .zip
  • macOS Intel: Claude-Code-Router_<version>-mac-Intel-x64.dmg or .zip
  • Windows: Claude Code Router_<version>.exe
  • Linux: Claude Code Router_<version>.AppImage

Runtime configuration is stored in SQLite at ~/.claude-code-router/config.sqlite on macOS/Linux and %APPDATA%\claude-code-router\config.sqlite on Windows. A legacy config.json is read once for migration only when no SQLite configuration exists.

CLI

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 Config 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

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.

How it works

Claude Code · Codex · Grok CLI · ZCode · Compatible API clients
                              │
                              ▼
                 Claude Code Router :3456
          Profiles · Routing · Credentials · Tools · Logs
                              │
                              ▼
             Selected provider, model, and account

Core capabilities

Area Highlights
Agents Profiles for Claude Code, Codex, Grok CLI, 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
Network & relay Local HTTP / HTTPS proxy, optional CA, network capture, and bot relay through Weixin iLink, WeCom, Slack, Discord, Telegram, LINE, Feishu, and DingTalk

Go deeper when you are ready

The complete documentation lives at ccrdesk.top.

Acknowledgements

Codex support is powered by musistudio/codexl.

Support & Sponsoring

If you find this project helpful, please consider sponsoring its development. Your support is greatly appreciated.

Support on Ko-fi
One-time support via Ko-fi
Sponsor with PayPal
International sponsorship
Alipay
Alipay QR code
WeChat Pay
WeChat Pay QR code

Our Sponsors

A huge thank you to all our sponsors for their generous support.

Zhipu icon
Z智谱
AIHubmix icon
AIHubmix
BurnCloud icon
BurnCloud
302.AI icon
302.AI
RunAPI icon
RunAPI
TeamoRouter icon
TeamoRouter
code0.ai icon
code0.ai
claudeapi icon
claudeapi
Qiniu Cloud AI icon
Qiniu Cloud AI
Fenno.ai icon
Fenno.ai
Unity2.Ai icon
Unity2.Ai

Community Sponsors

@Simon Leischnig @duanshuaimin @vrgitadmin @*o @ceilwoo @*说
@*更 @K*g @R*R @bobleer @*苗 @*划
@Clarence-pan @carter003 @S*r @*晖 @*敏 @Z*z
@*然 @cluic @*苗 @PromptExpert @*应 @yusnake
@*飞 @董* @*汀 @*涯 @*:- @**磊
@*琢 @*成 @Z*o @*琨 @congzhangzh @*_
@Z*m @*鑫 @c*y @*昕 @witsice @b*g
@*亿 @*辉 @JACK @*光 @W*l @kesku
@biguncle @二吉吉 @a*g @*林 @*咸 @*明
@S*y @f*o @*智 @F*t @r*c @qierkang
@*军 @snrise-z @*王 @greatheart1000 @*王 @zcutlip
@Peng-YM @*更 @*. @F*t @*政 @*铭
@*叶 @七*o @*青 @**晨 @*远 @*霄
@**吉 @**飞 @**驰 @x*g @**东 @*落
@哆*k @*涛 @苗大 @*呢 @d*u @crizcraig
s*s *火 *勤 **锟 *涛 **明
*知 *语 *瓜

If your name is masked, please contact me via my homepage email to update it with your GitHub username.

License

This project is licensed under the MIT License.