cc-router

agent
Security Audit
Warn
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 5 GitHub stars
Code Warn
  • process.env — Environment variable access in .github/workflows/release.yml
  • process.env — Environment variable access in scripts/generate-latest-json.mjs
Permissions Pass
  • Permissions — No dangerous permissions requested
Purpose
This tool acts as a local proxy and smart router for AI coding tools like Claude Code. It aggregates various API subscriptions and token quotas (DeepSeek, Qwen, GLM, Claude, etc.) into a single virtual plan, automatically load-balancing and failing over between providers to maximize usage.

Security Assessment
Overall Risk: Medium. As a proxy, its core function is to intercept requests and forward them to third-party AI provider endpoints, meaning it inherently handles sensitive data (your source code and API keys). The scanner found environment variable access in a release workflow and a script (`generate-latest-json.mjs`), which is standard for managing secrets, not a sign of hardcoded credentials. No dangerous system permissions were requested. However, because this tool manages and routes your API keys locally, you must ensure your local environment is secure. Additionally, the tool's own disclaimer warns that routing paid subscriptions through a third-party proxy may violate provider Terms of Service and risk account bans.

Quality Assessment
The project is very new and currently has low visibility with only 5 GitHub stars. It is licensed under the permissive MIT standard and was actively pushed to within the last day. Built with a modern stack (Tauri, React, Rust), it appears to be well-structured, but it lacks widespread community vetting or a proven track record.

Verdict
Use with caution—while the open-source code itself is standard and transparent, handling sensitive API keys through a new, unvetted proxy inherently requires trust, and users must accept the risk of potential account restrictions from AI providers.
SUMMARY

订阅买多了 Claude Code 却只能用一家?cc-router 本地运行的智能路由把 DeepSeek、Qwen、Kimi、MiMo、MiniMax、GLM、Claude 的 Token Plan、Coding Plan、API 额度合并成一个虚拟 Plan,任意搭配 opus / sonnet / haiku 三槽位,按顺序或轮询调度,限流、失败自动切换——充分使用每一份额度。

README.md

cc-router logo

cc-router

License: MIT Tauri 2 Rust 1.77+ React 19 TypeScript 5 Tailwind CSS Platform

中文 · English · 日本語

📖 中文文档

订阅买多了 Claude Code 却只能用一家?cc-router 把 DeepSeek、Qwen、Kimi、MiMo、MiniMax、GLM、Claude 的 Token Plan、Coding Plan、API 额度合并成一个虚拟 Plan,任意搭配 opus / sonnet / haiku 三槽位,按顺序或轮询调度,限流、失败自动切换——充分利用每一份额度。

注意⚠️ 本工具仅限于自动切换订阅套餐,请求体几乎完全透传,不涉及逆向、不涉及破解等操作。用户需自行遵守每个编程套餐的使用规则。此工具只能用于 Claude Code 等编程工具,切勿用于其他用途。

各家 provider 的 ToS 不一定明确允许"订阅 Key 接第三方代理 + 多虚拟模型混调度"的用法,尤其是 Coding Plan / Token Plan 这类 per-seat 订阅,可能触发风控。因使用本工具导致账号被限速、被封禁、订阅被取消的,作者不承担任何责任。

本软件按 As-Is 提供,不对任何因使用造成的直接或间接损失负责,包括但不限于额度异常消耗、数据丢失、业务中断。

功能亮点:

  • 18 家 provider 一站调度 —— 内置 DeepSeek、Qwen、Kimi、MiMo、MiniMax、GLM、Claude 等 Token Plan / Coding Plan / API 额度,opus / sonnet / haiku 三槽位任意搭配,顺序或轮询自动切换
  • 任意自定义端点 —— 内置厂商不够时,把任何 Anthropic Messages 兼容的 API 直接配进来,与内置订阅同等调度
  • 用量小票 —— token 消费快照一键导出 PNG / PDF / HTML,黑白 / 彩色双模式,默认不显示价格只展示用量,扫底部二维码即跳仓库
  • 三语完整翻译 —— 简体中文 / English / 日本語,可跟随系统或在设置页手动切换
cc-router 虚拟模型配置页截图 cc-router 用量小票长图
cc-router 请求日志页截图

支持的编程套餐和API

id 名称 Token Plan API 兼容性
anthropic Anthropic 官方 API(仅按量付费,不含 Plan) verified
zhipu 智谱 GLM(按量付费/中国订阅) verified
deepseek DeepSeek(按量付费) verified
moonshot Moonshot Kimi(按量付费/中国订阅/国际订阅) untested
minimax MiniMax(按量付费/中国订阅/国际订阅) verified
xiaomi 小米 MiMo(按量付费/中国订阅/国际订阅) untested
alibaba 阿里云百炼(Token Plan 团队版 + 按量付费 2 地域 + 停售的 Coding Plan) verified
volcengine 火山方舟(Coding Plan 订阅 + 按量付费) untested
openrouter OpenRouter 聚合平台(500+ 模型路由) untested
tencent 腾讯云大模型(Token Plan 订阅 + TokenHub 按量付费境内/境外) untested
aiberm Aiberm(按量付费 API,模型按 token group 动态返回) untested
whatai 神马中转 API(按量付费,OpenAI/Anthropic 双协议中转,仅用 Anthropic 路径) untested
ollama Ollama 本地推理(仅 localhost:11434,含云端模型 tag 如 glm-4.7:cloud partial
fireworks Fireworks AI(按量付费/国际订阅Fire Pass) verified
stepfun 阶跃星辰(按量付费/中国订阅/国际订阅) untested
baidu 百度千帆(按量付费/中国订阅) untested
modelscope 魔搭 ModelScope(按量付费) partial
ucloud 优云智算 UCloud Modelverse(Coding Plan 订阅 + 按量付费 API 国内/海外) untested
自定义 自定义任意Anthropic协议API verified

Token Plan 列包含各厂商的套餐订阅形态(Token Plan / Coding Plan 等);API 列指按量付费的 Anthropic Messages 兼容端点。

社区可 PR 补充。

技术栈

  • Tauri 2
  • Tailwind 4
  • React 19

安装使用

  1. 在release里下载客户端并安装。
  2. 配置多厂商的大模型,配置虚拟模型对应的真实模型和调度模式。
  3. 配置到Claude Code中使用。

在 Claude Code 中使用

设置 页会动态显示完整的 env snippet;默认端口被占用时自动 +1 递增。

{
  "env": {
    "ANTHROPIC_BASE_URL": "http://127.0.0.1:23456",
    "ANTHROPIC_AUTH_TOKEN": "your token, show in this app settings",
    "API_TIMEOUT_MS": "3000000",
    "ANTHROPIC_MODEL": "model-opus",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "model-opus",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "model-sonnet",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "model-haiku",
    "CLAUDE_CODE_SUBAGENT_MODEL": "model-opus",
    "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
    "CLAUDE_CODE_DISABLE_NONSTREAMING_FALLBACK": "1",
    "CLAUDE_CODE_EFFORT_LEVEL": "max"
  }
}

OPUS_MODEL支持1m上下文的时候,可以设置为model-opus[1m]以获得Claude code工具的完整上下文支持。

也兼容 LiteLLM 风格的 anthropic/ 前缀:anthropic/model-opus / anthropic/model-sonnet / anthropic/model-haiku 等同于无前缀写法,方便接入需要带 provider 前缀才能识别 Anthropic 协议的工具。

开发

依赖:Node.js ≥ 20(推荐 pnpm),Rust ≥ 1.77,Xcode CLT(macOS)。

pnpm install
pnpm tauri dev      # 启动开发模式(同时运行前端 + Rust 后端 + 代理)

首次启动 app 会进入 onboarding:

  1. 添加一个订阅(选厂商 → 选接入点 → 填 API Key → 自动抓取模型列表)
  2. 一键把订阅绑定到三个虚拟模型
  3. 复制 Claude Code 环境变量配置,粘到你的 ~/.claude/settings.json

添加新provider

如果你使用Claude Code,我提供了一个SKILL,可以执行new-provider并附加provider的官方文档或接口地址等信息,能够自动创建provider的配置。

打包

pnpm tauri build

产出:src-tauri/target/release/bundle/ 下对应平台的安装包。

图标

Provider 品牌 logo 来自 @lobehub/icons(MIT)。各品牌商标归原所有者所有。

证书

MIT

Reviews (0)

No results found