musistudio /claude-code-router
One local control plane for every AI agent: route across models, fuse new capabilities, orchestrate tools, and stay fully in control.
★ 38,075⑂ 3,202👁 133⑃ 489● 1,415▤ 27◈ 18
38,075
stars
+15
3,202
forks
133
watchers
489
prs
1,415
issues
27
releases
18
discussions
README
Claude Code Router
在一个地方,管理你所有的 Agent 与 Provider
让 Claude Code、Claude Design、Codex、Grok CLI、Kimi CLI、Kilo Code、OpenCode、Pi、ZCode、WorkBuddy 和兼容 API 客户端连接你选择的供应商,并在一个应用里完成每次请求的路由、降级、增强与观测。
为什么使用 Claude Code Router?
Claude Code Router(CCR)是面向编程 Agent 的本地模型网关与控制平面。它为 Claude Code、Claude Design、Codex、Grok CLI、Kimi CLI、Kilo Code、OpenCode、Pi、ZCode、WorkBuddy 和兼容 API 客户端提供一个稳定的本地入口,让你在一个地方管理入口背后的供应商、模型、账号、路由规则与工具。
你可以使用 CCR:
- 统一管理所有 Agent 与 Provider,不再为每个客户端维护一套独立模型配置。
- 切换供应商或模型而不改变工作流,无需反复修改 Agent 配置文件。
- 通过重试、凭据池、Key 轮换和 Fallback 保持请求可用。
- 通过 Fusion 视觉、联网搜索、MCP 工具和 ToolHub 扩展现有模型。
- 通过请求日志、最终路由、耗时、Token、成本估算和账号状态了解真实运行情况。
CCR 支持 OpenAI Chat / Responses、Anthropic Messages、Gemini Generate Content / Interactions、OpenRouter、DeepSeek、SiliconFlow、Moonshot、Kimi Code、Mistral、Z.AI、百炼以及自定义兼容供应商。
支持的 Agent
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)
快速开始
桌面端(推荐)
1.
下载 Claude Code Router,选择 macOS、Windows 或 Linux 版本并启动应用。
Windows
Linux
macOS (Apple Silicon)
macOS (Intel)
2. 打开 供应商 → 添加供应商。选择内置预设或自定义端点,填写 API Key,选择协议与模型,然后保存。
3. 打开 服务 并点击 启动。本地模型网关默认监听 http://127.0.0.1:3456。
4. 打开 Agent配置,选择 Claude Code、Claude Design、Codex、Grok CLI、Kimi CLI、Kilo Code、OpenCode、Pi、ZCode 或 WorkBuddy,指定模型并应用配置档案。
5. 开始使用 Agent。在 日志 中确认最终供应商、模型、状态、Token、耗时与错误。
现在 Agent 已经连接到 CCR。如需增加条件规则、自动重试、请求改写或 Fallback 模型,请打开 路由。
CLI
npm CLI 要求 Node.js 22 或更高版本。无需 Electron,也能启动相同的模型网关与浏览器管理界面:
sh
npm install -g @musistudio/claude-code-router
ccr ui
打开 http://127.0.0.1:3458,然后按照上面的 供应商 → 服务 → Agent 配置档案 流程操作。模型网关仍位于 http://127.0.0.1:3456。服务模式、鉴权和 Profile 命令见 CLI 命令参考。
Docker
sh
npm run docker:compose:up
Docker 默认通过 http://127.0.0.1:3458 提供管理界面与网关路由。这个 npm 脚本会在存在 ../../next-ai/gateway 时先准备本地支持插件的 ai-gateway runtime,再构建镜像。远程暴露 CCR 前,请先阅读 Docker 部署指南。
构建桌面应用
先安装 Node.js 22+,然后执行 npm ci。
| 目标 | 命令 | 产物目录 |
| --- | --- | --- |
| macOS 本地 DMG/ZIP | npm run build:app:mac | release-local/ |
| Windows 本地 NSIS 安装包 | npm run build:app:win | release-local/ |
Windows App 打包必须在 Windows x64 上运行,因为 beTop issues
#245About kimi-k238 comments · 2025-07-18#160Using this with various GEMINI proxy tools33 comments · 2025-07-13#852vscode的claude code扩展如何使用ccr code26 comments · 2025-09-30#23API Error: A.map is not a function26 comments · 2025-06-16#542⎿ API Error: 400 {"error":"Missing model in request body"}25 comments · 2025-08-12#527API Error: 50024 comments · 2025-08-11#614请问 transformer 块的自定义有教程吗?文档太含糊了,也找不到脚本示例23 comments · 2025-08-18#377fireworks or other providers23 comments · 2025-07-30
Discussions
#1948KinetAios — run CCR-routed Claude Code inside a multi-engine desktop dashboard0 comments · 2026-11-06#1947KinetAios: open-source desktop workbench that hosts ccr as a plugin engine (stream-json UI, resume, parallel routed channels)0 comments · 2026-11-05#1921[配置分享] 在 claude-code-router 中接入 Twinkle Model(OpenAI / Anthropic 兼容)0 comments · 2026-10-26#1907I'm getting API Error: 400 All target providers failed3 comments · 2026-10-20#1897Claude Code Router is included in the AgentManager tool catalog0 comments · 2026-10-16#1743项目赞助合作询价0 comments · 2026-08-31#1719MCP Servers Persisting in Claude Desktop App1 comments · 2026-08-25#1646remote CCR deployment1 comments · 2026-08-09
Latest release
v3.1.3 v3.1.3 2026-10-09Highlights - Rebuild the bundled model catalog and publish it to models.ccrdesk.top. The catalog refreshes from the CDN at startup and hourly, with bundled and cached data available offline. - Improve routing script token estimation, gateway restart recovery, and raw trace delivery. - Fix Codex session affinity, protocol-specific provider aliases, and upstream streaming resets. - Add the Y-API provider preset and bound OpenRouter catalog requests with a timeout. What's Changed fix(gateway): propagate upstream stream resets instead of crashing the core by @Louayzouaoui1 in https://github.co