Find a file
musi 057abaa1f9
Some checks failed
Docs / Build (push) Has been cancelled
Docs / Deploy (push) Has been cancelled
Merge pull request #1871 from mertkayacs/fix/docker-no-token-in-redirect
fix(docker): stop handing the management token to unauthenticated clients
2026-10-10 11:35:09 +08:00
.github feat: update bundled model catalog from R2 CDN 2026-10-09 18:11:41 +08:00
blog Update README acknowledgements and screenshots 2026-06-25 19:58:57 +08:00
build feat: update bundled model catalog from R2 CDN 2026-10-09 18:11:41 +08:00
cdn feat: update bundled model catalog from R2 CDN 2026-10-09 18:11:41 +08:00
docker fix(docker): stop handing the management token to unauthenticated clients 2026-10-09 13:51:13 +03:00
docs Merge pull request #1871 from mertkayacs/fix/docker-no-token-in-redirect 2026-10-10 11:35:09 +08:00
examples/routing Fix recent issue regressions in config, OAuth, routing and observability 2026-09-27 11:34:24 +08:00
extension/chrome Improve router configuration and request handling 2026-08-06 17:41:41 +08:00
packages Release v3.1.3 with refreshed CDN model catalog 2026-10-09 19:37:21 +08:00
scripts Release v3.1.3 with refreshed CDN model catalog 2026-10-09 19:37:21 +08:00
tests fix(docker): stop handing the management token to unauthenticated clients 2026-10-09 13:51:13 +03:00
.dockerignore chore(release): v3.1.2 2026-10-08 18:37:56 +08:00
.gitignore Implement comprehensive application updates 2026-09-02 18:37:11 +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 Implement comprehensive application updates 2026-09-02 18:37:11 +08:00
electron-builder.json feat: bundle Claude Design for desktop app 2026-07-26 18:09:01 +08:00
LICENSE Remove CDN workflow and add MIT license info 2026-06-28 21:45:45 +08:00
package-lock.json Release v3.1.3 with refreshed CDN model catalog 2026-10-09 19:37:21 +08:00
package.json Release v3.1.3 with refreshed CDN model catalog 2026-10-09 19:37:21 +08:00
playwright.config.ts Refactor routing and provider integration 2026-07-05 19:57:39 +08:00
pnpm-lock.yaml fix(claude-design): preserve interactive style questions 2026-09-10 11:20:47 +08:00
README.md Release v3.1.3 with refreshed CDN model catalog 2026-10-09 19:37:21 +08:00
README_zh.md Release v3.1.3 with refreshed CDN model catalog 2026-10-09 19:37:21 +08:00
tsconfig.json chore(tsconfig): drop baseUrl so the configs survive TypeScript 7 2026-09-07 20:02:05 +07:00
tsconfig.node.json Merge pull request #1771 from ntdatt812/fix/tsconfig-node-project-inputs 2026-09-16 19:34:42 +08:00

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.

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

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, 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:

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

npm run docker:compose:up

Docker exposes the management UI and gateway routes through http://127.0.0.1:3458 by default. The npm script prepares the local plugin-capable ai-gateway runtime before building the image when ../../next-ai/gateway exists. Read the Docker deployment guide before exposing CCR remotely.

Build desktop apps

Install Node.js 22+, then run npm ci.

Target Command Output
macOS local DMG/ZIP npm run build:app:mac release-local/
Windows local NSIS installer npm run build:app:win release-local/

Windows app packaging must run on Windows x64 because better-sqlite3 ships a native Electron module. The release workflow builds macOS on macOS runners and Windows on windows-latest when a v* tag is pushed.

How it works

Claude Code · Claude Design · Codex · Grok CLI · Kimi CLI · Kilo Code · OpenCode · Pi · ZCode · WorkBuddy · 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, Claude Design, Codex, Grok CLI, Kimi CLI, Kilo Code, OpenCode, Pi, ZCode, and WorkBuddy; 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

Go deeper when you are ready

The complete documentation lives at ccrdesk.top.

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
无限星河 icon
无限星河

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.