README_zh.md
</a>
<sub>
<a href="https://www.kimi.com/code?aff=ccr"><strong>Kimi Code 订阅</strong></a>
·
<a href="https://platform.kimi.com?aff=ccr"><strong>API 中文站</strong></a>
·
<a href="https://platform.kimi.ai?aff=ccr">API Global</a>
</sub>
</td>
让 Claude Code、Claude Design、Codex、Grok CLI、Kimi CLI、OpenCode、Pi、ZCode 和兼容 API 客户端连接你选择的供应商,并在一个应用里完成每次请求的路由、降级、增强与观测。
<p> <a href="#桌面端推荐"></a> <a href="#快速开始"></a> <a href="https://ccrdesk.top/"></a> </p> <p> <a href="README.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)是面向编程 Agent 的本地模型网关与控制平面。它为 Claude Code、Claude Design、Codex、Grok CLI、Kimi CLI、OpenCode、Pi、ZCode 和兼容 API 客户端提供一个稳定的本地入口,让你在一个地方管理入口背后的供应商、模型、账号、路由规则与工具。
你可以使用 CCR:
CCR 支持 OpenAI Chat / Responses、Anthropic Messages、Gemini Generate Content / Interactions、OpenRouter、DeepSeek、SiliconFlow、Moonshot、Kimi Code、Mistral、Z.AI、百炼以及自定义兼容供应商。
<details open> <summary><strong>支持的 Agent</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/cn">
<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>
打开 供应商 → 添加供应商。选择内置预设或自定义端点,填写 API Key,选择协议与模型,然后保存。
打开 服务 并点击 启动。本地模型网关默认监听 http://127.0.0.1:3456。
打开 Agent配置,选择 Claude Code、Claude Design、Codex、Grok CLI、Kimi CLI、OpenCode、Pi 或 ZCode,指定模型并应用配置档案。
开始使用 Agent。在 日志 中确认最终供应商、模型、状态、Token、耗时与错误。
现在 Agent 已经连接到 CCR。如需增加条件规则、自动重试、请求改写或 Fallback 模型,请打开 路由。
npm CLI 要求 Node.js 22 或更高版本。无需 Electron,也能启动相同的模型网关与浏览器管理界面:
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 compose up -d --build
Docker 默认通过 http://127.0.0.1:3458 提供管理界面与网关路由。远程暴露 CCR 前,请先阅读 Docker 部署指南。
Claude Code · Claude Design · Codex · Grok CLI · Kimi CLI · OpenCode · Pi · ZCode · 兼容 API 客户端
│
▼
Claude Code Router :3456
配置档案 · 路由 · 凭据 · 工具 · 日志
│
▼
命中的供应商、模型与账号
| 能力领域 | 功能亮点 |
|---|---|
| Agent | Claude Code、Claude Design、Codex、Grok CLI、Kimi CLI、OpenCode、Pi 和 ZCode 配置档案;模型覆盖;作用范围;环境变量;CLI / App 启动入口;多开工作流 |
| 供应商 | 内置预设和自定义端点;协议探测;模型发现;连通性检测;按支持情况导入本机登录态;单 Key 与凭据池 |
| 模型与路由 | 可搜索模型目录;用于任务选择的模型描述;Header / Body 条件;模型前缀;请求改写;重试;有序 Fallback |
| 工具与扩展 | Fusion 模型;ToolHub;内置浏览器自动化;Chrome 登录态导入;wrapper / core gateway plugin;本地路由与虚拟模型 |
| 访问与额度 | 独立的 CCR 客户端 Key,可设置有效期以及本地请求、Token 和图片限额 |
| 日志与观测 | 请求 / 响应详情;最终供应商、模型与凭据;状态;耗时;Token;成本估算;工具调用;Agent 执行链路 |
| AgentClaw | 通过微信 iLink、企业微信、Slack、Discord、Telegram、LINE、飞书和钉钉接力 Agent |
完整文档位于 ccrdesk.top。
</a>
<sub>通过 Ko-fi 单次赞助</sub>
</td>
<td align="center" width="220">
<a href="https://paypal.me/musistudio1999">
</a>
<sub>国际赞助通道</sub>
</td>
</td>
<td align="center" width="220">
<strong>微信支付</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>七牛云 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>如果你的名字被打码,请通过我的主页邮箱联系我更新为 GitHub 用户名。</sub>
</div>本项目基于 MIT License 发布。