简报·YT
← 返回 GitHub 动态
farion1231/cc-switch · ⭐ 已Star 已完成

farion1231/cc-switch v4.0.4

2026-10-07 10:56 · ⭐ 14.1万 · GitHub Release 原文 ↗
#版本发布 #配置切换 #聚合模式

farion1231/cc-switch v4.0.4

一句话概括:这是 CC Switch 迄今规模最大的更新,v4.0 首个正式版,带来全新侧边栏界面、跨供应商「聚合模式」、重写的用量统计与会话管理,并把配置写入机制从全量覆盖改为关键字段替换。

要点

版本信息

全新界面

聚合模式(新能力)

用量统计

配置写入机制重写(Breaking Change)

会话管理重写

MCP 同步到 Pi

其他改进

升级须知(Breaking Change)

主要修复

▸ Release Notes 英文原文(11065 字符)
# CC Switch v4.0 ### 正式版(4.0.4):全新界面,全新聚合模式,更稳的配置切换 这是 v4.0 的首个正式版,应用内会自动更新。它包含 4.0 预览版的全部内容,以及预览期间 4.0.1 到 4.0.4 的修复和新增。 这是 CC Switch 迄今规模最大的一次更新。这次更新,我们重新梳理了 CC Switch 最核心的体验:如何接入模型、如何切换供应商,以及如何管理越来越多的 AI 编程工具。 界面从侧边栏到托盘全部重新设计,应用、配置、用量和会话都有了清楚的位置。新推出的聚合模式可以把多家供应商的模型放进 Claude Code 或 Codex 的同一个模型列表,在客户端里随手切换。用量统计页面也重新设计了:每一次请求的 Token 用量、花费和输出速度都有记录;时间范围选「全部」,还能用热力图看过去一年每天的用量。会话管理也从头重写,AI 每一轮做了什么、改了什么、哪一步失败了,都一目了然。重写了配置写入的底层机制:切换供应商时,由全量重写改为关键字段替换,大幅降低复杂度的同时避免了一系列配置丢失问题。MCP 服务器现在也能同步到 Pi 了,一份 MCP 配置可以同时用在 8 个 AI 编程工具里。 > **从 3.x 升级?** 切换供应商的方式、数据库版本和几个设置都有变化,建议先看一下下方的「升级须知」。 **[English →](https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v4.0.4-en.md) | [日本語版 →](https://github.com/farion1231/cc-switch/blob/main/docs/release-notes/v4.0.4-ja.md)** --- ## 全新界面 新界面采用侧边栏布局和橙色主题。应用切换,以及 MCP、Skills、提示词、会话、授权中心、用量统计这些全局功能,都可以从侧边栏直接进入。 <p align="center"><img src="https://raw.githubusercontent.com/farion1231/cc-switch/main/assets/release-notes/v4.0.0/main-zh.png" alt="新界面:侧边栏、模式标签和供应商卡片" width="720"></p> - **模式一目了然**:每个应用页的顶部是「直连 / 路由 / 聚合」三个标签。点标签只切换查看的内容,不会改动配置;真正切换模式的按钮会写明会发生什么,回到直连只需一步,还能撤销 - **工具有了自己的家**:新的「应用」页集中显示每个 AI 编程工具的版本、安装位置和来源,支持安装、升级和批量升级 - **更简洁的添加供应商面板**:搜索、选预设,填表单。搜索支持中文名和域名;同一家的不同套餐和地区合并成一行,Claude 的预设合并后行数明显减少。取消了所有预设供应商的高亮推荐 - **额度显示剩余量**:卡片上直接写「5 小时剩余 94%」「余额 8.99 CNY」,每一档后面还会显示重置倒计时,比如「⏱ 2h30m」。平时用灰色,不抢眼;百分比额度低于 10% 时加粗提醒,余额用完时才变红;点击额度会重新查询,并显示查询结果。Codex 订阅显示剩余重置次数和过期时间,ChatGPT 订阅还会显示 Codex Credits 余额,并按 API 价折算成美元 - **托盘按应用重新组织**:每行显示「名称 · 模式 · 供应商 · 额度」,子菜单里只列出当前能切换的供应商。只有真正需要你处理时,托盘图标才显示提醒点 - **设置按用途分组**:通用、应用配置、本地路由、网络、数据、关于。本地路由的服务状态、监听地址和故障转移参数都集中在一处 - **编辑不再是弹窗**:供应商、MCP 和提示词都在内容区打开整页编辑,侧栏照常可用。有未保存的修改时,点侧栏、按 ⌘, 或从托盘切走都会先问一句 <p align="center"><img src="https://raw.githubusercontent.com/farion1231/cc-switch/main/assets/release-notes/v4.0.0/apps-zh.png" alt="应用页:集中管理各个 AI 编程工具的版本、安装与升级" width="720"></p> 老用户第一次打开新版时,会看到一次简短的说明,告诉你常用功能搬到了哪里。之后每次更新,首次打开还会弹出一份更新摘要;想再看,可以在「设置 → 关于」里点「近期更新」。 --- ## 聚合:一个模型列表,多家供应商 以前想用另一家供应商的模型,得先回到 CC Switch 切换供应商,再回到客户端继续工作。 现在开启**聚合**模式,把几家供应商添加进来,它们的模型会同时出现在 Claude Code 或 Codex 的模型选择器里。选哪个模型,请求就发给哪一家,不用离开客户端。 <p align="center"><img src="https://raw.githubusercontent.com/farion1231/cc-switch/main/assets/release-notes/v4.0.0/agg-codex-zh.png" alt="Codex 的模型选择器里同时列出多家供应商的模型" width="560"></p> - **随时添加和移除**:在供应商卡片上点「添加」或「移除」。再选一家作为默认供应商,没有指定聚合模型的请求都交给它 - **一眼认出模型**:每个模型名后面都标着来自哪家供应商,比如「Kimi K3(Kimi For Coding)」;说明里还会写出上游真实的模型 ID 和上下文窗口,比如 `kimi-k3 · 256K` - **精简的配置表单**:在「聚合」页添加或编辑供应商时,连接信息和模型列表放在同一页,只需要填这些;在「直连」「路由」页用的是完整表单 - **Codex 混用不报错**:把官方账号设为默认,官方模型和第三方模型会并列显示。在不同供应商的模型之间来回切换,上下文压缩和推理状态都能接上 - **同一会话里换模型**:可以在一个会话中途换用其他模型。注意每次切换后,新模型都要重新建立提示词缓存,切换后的第一轮费用会明显高一些 - **重启提醒**:Codex 的模型列表变化后会提示重启,Codex CLI 可以在横幅里一键重启后台服务;Claude Code 的聚合模型改动立即生效,不用重启 <p align="center"><img src="https://raw.githubusercontent.com/farion1231/cc-switch/main/assets/release-notes/v4.0.0/agg-zh.png" alt="聚合模式:一家默认供应商,另外添加了 6 家" width="720"></p> 聚合需要手动开启,目前支持 Claude Code 和 Codex。Claude Code 的聚合模型列表需要 Claude Code 2.1.243 或更新版本。它按你选的模型分发请求,不提供故障转移。 | 模式 | 请求怎么走 | 适合什么情况 | |------|-----------|--------| | **直连** | 客户端直接连供应商 | 日常使用 | | **路由** | 经本地路由转发给一家供应商,可以转换协议、设置故障转移 | 协议不兼容,或者需要故障转移 | | **聚合** | 经本地路由,按模型分发给多家供应商 | 在一个会话里混用多家模型 | > **致敬 opencodex** > > 聚合模式大量学习和参考了 [opencodex](https://github.com/lidge-jun/opencodex)。给模型 ID 加上供应商前缀,让多家模型同时出现在 Claude Code 和 Codex 的选择器里;让 Codex 在第三方模型上也能做上下文压缩;检测后台服务是否还在用旧的模型列表,并提醒重启。这些思路都来自 opencodex 的探索。感谢 opencodex 的作者(@lidge-jun)和贡献者们把这些成果开源出来,向他们的开源精神致以崇高的敬意! > > 如果你想要一个专注于「任意模型接入 Codex 和 Claude Code」的工具,非常推荐试试 opencodex! --- ## 用量统计 **用量页**重新设计了指标、趋势图、请求日志,以及供应商、模型、定价四张统计表,都支持分页。新增「全部」时间范围,用 53 周热力图显示每天的用量。大范围统计时,窗口不再卡顿。 <p align="center"><img src="https://raw.githubusercontent.com/farion1231/cc-switch/main/assets/release-notes/v4.0.0/usage-zh.png" alt="用量统计:53 周热力图与请求日志" width="720"></p> - **输出速度**改为只按生成时间计算,去掉了首字等待。即使没开路由,从 Claude Code、Codex 会话日志导入的请求也能显示估算速度,用「≈」标记 - **模型表格加上成功率和速度两列**。「平均成本」列去掉了,悬停在成本上可以看到 - **供应商和模型表格计入缓存 token**,各行加起来和顶部的总 token 数对得上 - 没开路由时从会话日志导入的用量,供应商显示为「Claude Code · 会话日志」这样的名字,悬停会说明为什么分不出具体供应商 - 写入用量记录改到单独的线程,硬盘慢时也不会拖慢路由服务 --- ## 切换供应商,你的配置原封不动 这是这次更新里最重要的底层变化,适用于 Claude Code、Codex、Gemini CLI、Grok Build 和 Claude Desktop。 CC Switch 发布于 2025 年 8 月,那个时候 API 的生态远没有现在成熟,各家官方和第三方供应商之间的 API 格式往往差距非常大,所以在最初设计的时候,切换供应商选择了全量覆盖。但这个选择带来了一系列的问题和复杂度。随着生态的成熟,现在是时候重构了。 **以前**:切换供应商时,会用这家存下的快照重写整个配置文件。你在 `settings.json` 里加的 hooks、插件、权限设置,在 `config.toml` 里加的 MCP 服务器,要么在切换时丢失,要么被收进某一家供应商的快照,切到别家就没了。 **现在**:切换只替换地址、凭据、模型、协议这几项,以及这家供应商自己的开关。其他内容原样保留: - TOML 和 `.env` 文件里,没改到的行连同注释、顺序,逐字节保持不变 - JSON 文件里,其他每个键的值和顺序都保持不变 - 共享设置本来就留在配置文件里,所以「通用配置片段」功能也就不需要了 **编辑器底部会预览切换后配置文件的样子**。在这里直接改的全局设置会写进配置文件,保存前还会检查文件是否被别的程序改过。 新的写入机制同时带来几层保护: - 配置文件格式有误时停止写入,原文件保持不动 - 写入前先检查外部改动,不会覆盖其他程序刚保存的内容 - 同时改多个文件时先记下意图,即使中途意外退出,下次启动也会自动收尾,不会停在只改了一半的状态 - 每个文件第一次由新版写入前,原样备份一份 - 含密钥的配置文件只允许本人读写 开启或关闭路由,也不再依赖「备份、还原」整份配置。Codex 切到第三方供应商时被覆盖的 ChatGPT 登录会暂存在本机,切回官方账号时自动还原。 --- ## 会话管理:每一次 AI 编程,都看得清清楚楚 AI 编程工具会把每次会话完整地记在本机,但原始记录是成千上万行 JSON,几乎没法直接读。这一版我们从头重写了会话管理,让会话记录尽可能地易读,同时添加了用量和消耗金额统计。 <p align="center"><img src="https://raw.githubusercontent.com/farion1231/cc-switch/main/assets/release-notes/v4.0.0/session-zh.png" alt="会话阅读页:执行过程摘要、工具调用详情和对话目录" width="720"></p> - **九个客户端,同一种读法**:Claude Code、Codex、Gemini CLI、Grok Build、OpenCode、OpenClaw、Hermes、Pi、MiniMax Code 的记录都解析成结构化内容,正文、思考、工具调用、工具结果和图片各自呈现 - **一轮工作,一行摘要**:AI 的一长串操作折叠成一行,比如「执行过程 · 44 步 · 27 个命令 · 改了 2 个文件 · 1 个失败 · 27m45s」。失败的命令标成红色,展开就能看到参数、输出和退出码;连续读文件、搜索这类步骤会合并成「查看了 N 个文件、搜索 N 次」 - **对话目录**:右侧列出你的每一次提问,以及这一轮用了多少步、得出了什么结论。有失败步骤的轮次带红点,点一下就跳过去 - **三种视图**:「全部」看完整过程,「对话」只看你和 AI 说了什么,「改动」只看改了哪些文件 - **会话全貌一眼可见**:顶部显示项目目录、起止时间、提问次数、工具调用次数、模型、总 Token 数,以及按 API 价格算的费用 - **会话内查找**:命中的内容即使藏在折叠的工具输出里,也会自动展开定位;长会话里输入也不卡 - **从阅读到继续工作**:一键在你常用的终端(比如 Ghostty)里恢复会话,也可以复制恢复命令;还支持导出 Markdown、复制单轮或整段对话 - **列表更好找**:按项目或时间分组,搜索标题、目录、首末消息或会话 ID,支持批量删除 - 支持 OpenCode 2.x 和 Gemini CLI 新版 JSONL 格式的会话,Hermes 会话也能正常打开了 会话阅读页的重做由 @Owlbay 主导完成,感谢 Owlbay 投入的大量心血。 --- ## MCP 同步到 Pi Pi 1.0 内置了 MCP,配置格式和 Claude Code 相同。现在在 MCP 页面给 Pi 打开同步,你已有的 MCP 服务器就能在 Pi 里直接用。加上 Claude Code、Codex、Gemini CLI、Grok Build、OpenCode、Hermes、MiniMax Code,一份 MCP 配置可以同时管理 8 个 AI 编程工具。 - **只写连接相关的字段**:超时、工具暴露、OAuth 这些 Pi 自己的设置原样保留 - **关掉同步不会删条目**:只是在 Pi 里标成停用,再打开时这些设置都还在 - **不支持的配置会直接提示**:Pi 不支持的 SSE 传输、名称里带特殊字符的服务器不会写进文件 Pi 的 MCP 同步由 @Owlbay 和 @LystranG 完成。 --- ## 更多改进 - **Claude Code 快捷开关**:新增「关闭 auto mode 服务端检查」。Claude Code 2.1.281 起,经过第三方网关或本地路由时,每个会话都会先提示一次「不符合条件」,勾选后直接用本机检查,不再提示;新建第三方供应商时默认勾上,官方端点不要勾。每个快捷开关后面都加了「?」,说明它做什么、是全局设置还是跟着供应商切换 - **MCP**:可以一次粘贴多个服务器配置,JSON、TOML、Codex 和 OpenCode 格式都能识别。某个应用写入失败时可以单独重试,一个服务器出错也不会影响其他服务器 - **Skills**:「已安装」和「发现」合并成一页,可以一键全部更新,同步方式可选自动、仅符号链接、仅复制;已安装列表的表头加了全选框 - **提示词**:八个应用的提示词在同一页管理,支持复制到其他应用、导入已有文件、删除后撤销 - **授权中心**:账号、重新登录入口和剩余额度一目了然 - **备份一目了然**:「备份与恢复」里新增可展开的「其他备份」,列出 `~/.cc-switch` 下每类备份的路径、大小和数量,可以打开所在位置,也可以整类删除,删除前会说明会失去什么 - **模型参数自动补全**:选中拉取到的模型时,会从预设和 models.dev 补上上下文窗口、输出上限、推理档位和输入类型,不覆盖你已经填过的值 - **Claude Desktop**:使用模型映射时,本地路由服务会自动启动,用完自动停止 - **OpenCode**:支持 OpenCode 2.0 的新版供应商配置,新旧格式都能读写,格式有误会指出具体字段;可以选择思考档位,已知支持推理的模型会自动标记,档位由 OpenCode 自己生成;`opencode.jsonc` 里的注释和格式在同步时会保留,支持 2.x 的用量统计 - **MiniMax Code**:可以在「应用」页安装和升级,新建供应商时可以自己填供应商 key - **预设与定价**:新增 Command Code、OpenCode Zen(Claude Code、Codex,和 OpenCode Go 合成一行)、模力方舟(Claude Code、Codex、Pi、OpenCode、OpenClaw)预设,更新 Claude Opus 5.5、GPT-6 Sol / Luna、MiMo V2.6 等模型的定价;已有的预设都有了正式图标 - **日志更好排查**:切换供应商和进出路由、聚合时,日志会写明从哪切到哪、结果如何 - **项目切换器默认隐藏**:大多数用户用不到「项目」,新安装时主页和托盘不再显示项目切换器,需要时在设置里打开;已经在用的不受影响 --- ## 升级须知 **配置的归属变了。** 共享设置直接留在客户端配置文件里,「通用配置片段」功能已经移除。在客户端里临时选的模型或推理强度,切到别家再切回来时,会恢复成供应商设定的值。想固定下来,在供应商编辑器里保存即可。 **有些修复需要切换一次才生效。** Codex 模型目录和会话分组的修复,要等 CC Switch 下一次写入 Codex 配置时才会应用,升级后切换一次供应商即可。已有的 MCP 配置重新同步一次,就能清掉旧的 `type` 字段。 **切换后记得按提示重启。** Codex、Gemini CLI、Grok Build 切换模型后需要重启,Codex 的聚合列表变化后也需要重启;Claude Code 的聚合模型改动不需要重启。 **数据库结构升到了 20。** 升级前的数据库会自动备份在 `~/.cc-switch/backups/`(`db_backup_` 开头);之后再装回 3.x 会提示「数据库版本过新」。 **已有的卡片保持原样。** 预设更新只影响新建的供应商,比如已有的 Claude 供应商不会自动勾上「关闭 auto mode 服务端检查」,需要的话在编辑器里勾选。新定价只回补之前按 $0 记录的请求,其余历史费用不会重算。 **Claude Code 的聚合模式需要 2.1.243 或更新版本。** 聚合的模型通过 Claude Code 新增的 `modelPicker` 设置列进 `/model`,更早的版本会忽略它,`/model` 里就看不到聚合的模型。用 `claude --version` 查看版本,`claude update` 升级。 **几个设置移除了。** 供应商成本倍率(中转站价格本身已经包含倍率,再乘一次只会算错);连通性检查的高级设置(现在使用内置默认值);Claude 的「Teammates」和「最大强度」两个快捷开关(每个 Claude Code 会话现在都自带团队功能;最大强度会把所有会话锁在最贵的档位,需要时在会话里用 `/effort max`)。已经写在配置里的变量不会被删除。 --- ## 修复 - **用 ChatGPT 账号的 Claude Code 对话报 400 中断。** 官方 Codex 后端在思考记录里多了一个字段,下一轮请求就被拒收。现在已经出错的对话会自动恢复 - **Claude Code 映射到 GPT、Grok 后,关了思考仍然全力推理。** 现在关闭思考时推理强度降到 low,目标模型不支持的档位会自动调整,GPT-5.x pro 用 `/effort low` 不再报 400 - macOS 上用 `⌘Q`、Dock「退出」或注销退出后,客户端仍然指向已经停止的本地路由 - Codex 官方路由的回复迟迟不显示,用量记为 0 - Codex 模型目录里的 GPT 模型丢失官方提示词、工具能力和推理档位 - Codex 0.158 起,MCP 配置里的 `type` 字段导致报错,甚至无法启动 - MiniMax 工具调用参数解析失败;部分模型的思考内容混在正文里显示 - 部分上游在流式响应里混用 LF 和 CRLF 换行,工具调用丢失 - 上游拒绝请求,却被报成「输出达到上限」;现在如实报告为上游错误并带上原因 - Claude Desktop 用 OpenCode Go 报 `400 MissingSessionID`,本地路由会自动补上会话标识 - 导入 Skill 时勾选的其他应用实际收不到;同步 Skills 时误删 OpenClaw 目录下的同名文件夹 - 新增或导入提示词时,可能清空你手写的提示词文件 - WSL 下的 Codex 拖慢启动和会话扫描 - 时间 MCP 预设一启动就退出,改用 `uvx mcp-server-time`(已添加的服务器需手动把命令改成 `uvx`、参数改成 `mcp-server-time`) - 部分 CLI 升级时额外装出一份 npm 副本 - 清理旧日志后,数据库文件没有缩小 - 设置里「保存并重启服务」没有真正重启服务 - macOS 上应用内更新或更改配置目录后重启,新窗口被压在其他应用后面(这次升级的重启仍由旧版执行,从下一次更新起生效) - Grok Build 的「获取 API Key」打开官网首页;Hermes、OpenClaw 的小米 MiMo 预设默认用了不支持图片的模型 --- ## 相对 4.0.0 预览版的变化 已经装过 4.0.0 到 4.0.3 预览版的用户,这一节列出预览期间的改动,上面的正文已经包含这些内容。 **新增**:Claude Code「关闭 auto mode 服务端检查」快捷开关和每个开关的说明;MCP 同步到 Pi 1.0;MCP 和提示词整页编辑、离开前提醒保存;「其他备份」总览;Codex Credits 余额;OpenCode 2.0 新版供应商配置和思考档位;用量模型表格的成功率和速度列;OpenCode Zen、模力方舟预设;已安装 Skill 全选;切换日志;更新后显示更新摘要。 **修复**:ChatGPT 账号对话报 400;关了思考仍全力推理;Claude Code 聚合模式下 `/model` 顶部是四行同一个模型;导入 Skill 勾选的应用收不到;其他工具改过 Codex 模型目录设置后,模型映射和聚合模型不生效;Gemini CLI 会话读不到;WSL 下的 Codex 拖慢扫描;上游错误被报成输出达到上限;Claude Desktop 用 OpenCode Go 报 400;流式工具调用丢失;用量表格没算缓存 token;写用量拖慢路由;时间 MCP 预设启动即退出;Codex 用量同步可能卡死;以及侧边栏动画、分隔线、推理等级多选撑宽、时间范围选择器边框、图标铺满等界面细节。 **体验改进**:改了 Claude Code 的聚合模型不用再重启;供应商表单跟着所在标签页走,Codex 完整表单里获取的模型可以直接挑进模型映射表;去掉了 Claude 的「Teammates」和「最大强度」快捷开关。 **4.0.4 新增的改动**: - macOS 上应用内更新或更改配置目录后重启,新窗口回到最前面 - 新安装默认隐藏项目切换器 - 用量页窗口较窄时,请求日志的速度列不再被挤到横向滚动区外 - 「关于」页的 Star 提示改成单独一条,可以关闭 --- ## 致谢 感谢这一版的贡献者: @Owlbay(会话阅读页重做、用量页热力图与性能、整页编辑和未保存提醒、Pi 的 MCP 同步、时间 MCP 预设、MiMo 预设)、@qyinter(大量 UI/UX 打磨)、@allenxu09、@parkavenue9639、@ggbdpq、@SailingLoong、@DEAN-Cherry、@LystranG、@lcgash、@Chris-Xie369、@fisHarly0、@minc-nice-100、@funkpopo、@ISuuuu、@tingfeng347、@Hexc01、@zhengkaics、@7ten7、@2doright、@RemindZ、@M3chD09、@Richard-Zhang1019、@YuxuZhou-CN、@Eureka0w0v0、@Ne1ther、@h6rime、@bigben446、@szupzj18、@AnxForever 感谢 @PnutCN、@Aaron-WealthTech、@RuriLothlorien、@Ming-Sir-69、@juntaosun、@killServer0、@shangchaovo、@gsmchen、@winter-maple、@guangzh3n、@AltCtrlFn、@R-Tsubasa、@Lingbou、@Enough1122、@IAld010 详细的问题报告、排查和建议,帮我们准确定位了问题。 特别感谢 [opencodex](https://github.com/lidge-jun/opencodex) 项目,聚合模式的许多设计都受益于它的开源探索。 也感谢每一位提交 issue、帮忙复现问题的用户。完整的技术细节请见 [CHANGELOG](https://github.com/farion1231/cc-switch/blob/main/CHANGELOG.md)。
▸ 主项目介绍 · farion1231/cc-switch
▸ README 原文(同步于 2026-07-20 03:47)
<div align="center"> # CC Switch ### The All-in-One Manager for Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw & Hermes Agent [![Version](https://img.shields.io/github/v/release/farion1231/cc-switch?color=blue&label=version)](https://github.com/farion1231/cc-switch/releases) [![Platform](https://img.shields.io/badge/platform-Windows%20%7C%20macOS%20%7C%20Linux-lightgrey.svg)](https://github.com/farion1231/cc-switch/releases) [![Built with Tauri](https://img.shields.io/badge/built%20with-Tauri%202-orange.svg)](https://tauri.app/) [![Downloads](https://img.shields.io/github/downloads/farion1231/cc-switch/total)](https://github.com/farion1231/cc-switch/releases/latest) <a href="https://trendshift.io/repositories/15372" target="_blank"><img src="https://trendshift.io/api/badge/repositories/15372" alt="farion1231%2Fcc-switch | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a> <a href="https://www.star-history.com/#farion1231/cc-switch&Date"><picture><source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/badge?repo=farion1231/cc-switch&theme=dark" /><img alt="Star History Rank" src="https://api.star-history.com/badge?repo=farion1231/cc-switch" width="196" height="55" /></picture></a> ### 🌐 The Only Official Website: **[ccswitch.io](https://ccswitch.io)** English | [中文](README_ZH.md) | [日本語](README_JA.md) | [Deutsch](README_DE.md) | [Changelog](CHANGELOG.md) </div> ## ❤️Sponsor > [Want to appear here?](mailto:farion1231@gmail.com) <details open> <summary>Click to collapse</summary> [![Kimi K2.7 Code](assets/partners/banners/kimi-banner-en.png)](https://platform.kimi.ai?aff=cc-switch) Kimi K2.7 Code is an open-source, coding-focused agentic model developed by Moonshot AI. It delivers stronger coding and agent performance, with substantial improvements in real-world long-horizon coding tasks. These gains translate into higher end-to-end task success rates across complex software engineering workflows. K2.7 Code also improves reasoning efficiency, reducing thinking-token usage by approximately 30% compared with K2.6. **[Click here to start using Kimi](https://platform.kimi.ai?aff=cc-switch)** Doing mostly coding work? Try the **[Kimi For Coding plan](https://www.kimi.com/code/?aff=cc-switch)** — a subscription service built for coding! --- <table> <tr> <td width="180"><a href="https://www.packyapi.com/register?aff=cc-switch"><img src="assets/partners/logos/packycode.png" alt="PackyCode" width="150"></a></td> <td>Thanks to PackyCode for sponsoring this project! PackyCode is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more. PackyCode provides special discounts for our software users: register using <a href="https://www.packyapi.com/register?aff=cc-switch">this link</a> and enter the "cc-switch" promo code during first recharge to get 10% off.</td> </tr> <tr> <td width="180"><a href="https://aigocode.com/invite/CC-SWITCH"><img src="assets/partners/logos/aigocode.png" alt="AIGoCode" width="150"></a></td> <td>Thanks to AIGoCode for sponsoring this project! AIGoCode is an all-in-one platform that integrates Claude Code, Codex, and the latest Gemini models, providing you with stable, efficient, and highly cost-effective AI coding services. The platform offers flexible subscription plans, zero risk of account suspension, direct access with no VPN required, and lightning-fast responses. AIGoCode has prepared a special benefit for CC Switch users: if you register via <a href="https://aigocode.com/invite/CC-SWITCH">this link</a>, you'll receive an extra 10% bonus credit on your first top-up!</td> </tr> <tr> <td width="180"><a href="https://www.aicodemirror.com/register?invitecode=9915W3"><img src="assets/partners/logos/aicodemirror.jpg" alt="AICodeMirror" width="150"></a></td> <td>Thanks to AICodeMirror for sponsoring this project! AICodeMirror provides official high-stability relay services for Claude Code / Codex / Gemini CLI, with enterprise-grade concurrency, fast invoicing, and 24/7 dedicated technical support. Claude Code / Codex / Gemini official channels at 38% / 2% / 9% of original price, with extra discounts on top-ups! AICodeMirror offers special benefits for CC Switch users: register via <a href="https://www.aicodemirror.com/register?invitecode=9915W3">this link</a> to enjoy 20% off your first top-up, and enterprise customers can get up to 25% off!</td> </tr> <tr> <td width="180"><a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF"><img src="assets/partners/logos/shengsuanyun.png" alt="Shengsuanyun" width="150"></a></td> <td>Thanks to Shengsuanyun for sponsoring this project! Shengsuanyun is a super factory serving AI Native Teams — an industrial-grade AI task parallel execution platform. Its model marketplace aggregates Claude, ChatGPT, Gemini, and other domestic and international LLM and multimedia model capabilities with direct supply. Absolutely no reverse engineering or dilution — platform-wide model SLA availability reaches 99.7%, with <a href="https://watch.shengsuanyun.com/status/shengsuanyun">monitoring dashboards</a> showing green across the board. It also offers enterprise-grade custom gateways for fine-grained team cost and permission management, smart routing, security protection, and BYOK (Bring Your Own Key) hosting. The platform charges on a pay-per-use and tokens plan (coming soon) basis, with invoicing available. Register via <a href="https://www.shengsuanyun.com/?from=CH_4HHXMRYF">this link</a> as a new user to receive ¥10 in credits plus a 10% bonus on your first top-up.</td> </tr> <tr> <td width="180"><a href="https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/"><img src="assets/partners/logos/pateway.png" alt="PatewayAI" width="150"></a></td> <td>Thanks to PatewayAI for sponsoring this project! PatewayAI is an API relay service provider built for heavy AI developers, focused on directly relaying official high-quality model APIs. It offers the full Claude lineup and the Codex series, 100% sourced from official channels — no dilution, no fakes, verification welcome. Billing is transparent and every token-level invoice can be audited line by line. It also supports enterprise-grade concurrency and provides a dedicated management platform for enterprise customers — formal contracts and invoicing are available; visit the official website for contact details. Register now via <a href="https://pateway.ai/?ch=etzpm8&aff=WB6M6F67#/">this link</a> to receive $3 in trial credit. Top-ups go as low as 60% of the original price, with a two-way referral bonus of up to $150!</td> </tr> <tr> <td width="180"><a href="https://teamorouter.com/?utm_source=cc_switch&utm_medium=referral&utm_campaign=ai_directory"><img src="assets/partners/logos/TeamoRouter-banner.png" alt="TeamoRouter" width="150"></a></td> <td>Thanks to TeamoRouter for sponsoring this project! TeamoRouter is an enterprise-grade Agentic LLM gateway built for developers, AI teams, and businesses. Without requiring any subscriptions, it lets you access Claude Code, Codex, Gemini CLI, OpenAI Codex, and other popular AI agents through a single unified API, while offering API pricing at discounts of up to 90%. Unlike typical API relay services, TeamoRouter aggregates hundreds of official model providers and trusted infrastructure partners, including OpenAI, Anthropic, Vertex, Azure, and AWS bedrock. Every provider is verified for 100% Agent protocol compatibility, cache performance, and request traceability, ensuring stable quality instead of reverse-engineered or diluted endpoints. The platform delivers near-official TTFT, 99.6% SLA, enterprise-scale throughput up to 5,000 QPM, and industry-leading cache hit rates that dramatically reduce token costs for long-running agent workflows. TeamoRouter also offers enterprise features including centralized billing, team management, BYOK, smart routing, usage analytics, dynamic provider optimization, and dedicated support. For an even simpler experience, Teamo Desktop lets you use Claude Code, Codex, Gemini CLI, and other popular AI agents with one-click setup—no API key management or manual gateway configuration required. Register via <a href="https://teamorouter.com/?utm_source=cc_switch&utm_medium=referral&utm_campaign=ai_directory">this link</a> as a new user to receive 10% off your first top-up.</td> </tr> <tr> <td width="180"><a href="https://zetaapi.ai/go/ccs"><img src="assets/partners/logos/zetaapi-banner.png" alt="ZetaAPI" width="150"></a></td> <td>Thanks to ZetaAPI for sponsoring this project! ZetaAPI focuses on real model fidelity, no watered-down responses, no quality degradation, and pricing as low as 35% of official rates. The platform does not mix traffic, secretly replace models with lower-quality alternatives, or use fake model routing. It supports Claude Code, Codex, Gemini, ChatGPT, and other mainstream AI models, helping users significantly reduce API costs while maintaining reliable model quality. At the same time, ZetaAPI provides enterprise-grade SLA-backed stability, standard API compatibility, one API key for multiple models, fast integration, and pay-as-you-go billing, making it suitable for AI products, coding agents, internal business tools, customer service systems, content generation, and automation workflows. If any model is verified to be inconsistent with its stated quality, ZetaAPI backs it with a 10x compensation guarantee, giving users a more stable, transparent, and trustworthy experience. Register via <a href="https://zetaapi.ai/go/ccs">this link</a> and use the promo code CC-SWITCH during your first recharge to enjoy an exclusive 10% discount on your first top-up, just for CC Switch users!</td> </tr> <tr> <td width="180"><a href="https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch"><img src="assets/partners/logos/byteplus.png" alt="BytePlus" width="150"></a></td> <td>Thanks to Dola seed for sponsoring this project! Dola Seed 2.0 is a full‑modal general large model independently developed by ByteDance for the global market. Built on a unified multimodal architecture, it supports joint understanding and generation of text, images, audio, and video. It natively enables agent collaboration, with strong reasoning, long‑task execution, tool integration, and coding capabilities. It is widely applicable to smart cockpits, personal assistants, education, customer support, marketing, retail, and other scenarios. It excels in multimodal perception, end‑to‑end complex task delivery, stable interaction, and data security, and is readily accessible and deployable via the ModelArk platform.Register via <a href="https://www.byteplus.com/en/product/modelark?utm_campaign=hw&utm_content=ccswitch&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch">this link</a> to get 500,000 tokens of free inference quota per model.<a href="https://www.volcengine.com/activity/ai618?utm_campaign=hw&utm_content=hw&utm_medium=devrel_tool_web&utm_source=OWO&utm_term=ccswitch"> >>中国大陆地区的开发者请点击这里</a></td> </tr> <tr> <td width="180"><a href="https://cloud.siliconflow.cn/i/YflgU2Ve"><img src="assets/partners/logos/silicon_en.jpg" alt="SiliconFlow" width="150"></a></td> <td>Thanks to SiliconFlow for sponsoring this project! SiliconFlow is a high-performance AI infrastructure and model API platform, providing fast and reliable access to language, speech, image, and video models in one place. With pay-as-you-go billing, broad multimodal model support, high-speed inference, and enterprise-grade stability, SiliconFlow helps developers and teams build and scale AI applications more efficiently. Register via <a href="https://cloud.siliconflow.cn/i/YflgU2Ve">this link</a> and complete real-name verification to receive ¥16 in bonus credit, usable across models on the platform. SiliconFlow is also now compatible with OpenClaw, allowing users to connect a SiliconFlow API key and call major AI models for free.</td> </tr> <tr> <td width="180"><a href="https://cubence.com/signup?code=CCSWITCH&source=ccs"><img src="assets/partners/logos/cubence.png" alt="Cubence" width="150"></a></td> <td>Thanks to Cubence for sponsoring this project! Cubence is a reliable and efficient API relay service provider, offering relay services for Claude Code, Codex, Gemini, and more with flexible billing options including pay-as-you-go and monthly plans. Cubence provides special discounts for CC Switch users: register using <a href="https://cubence.com/signup?code=CCSWITCH&source=ccs">this link</a> and enter the "CCSWITCH" promo code during recharge to get 10% off every top-up!</td> </tr> <tr> <td width="180"><a href="https://www.dmxapi.cn/register?aff=bUHu"><img src="assets/partners/logos/dmx-en.jpg" alt="DMXAPI" width="150"></a></td> <td>Thanks to DMXAPI for sponsoring this project! DMXAPI provides global large model API services to 200+ enterprise users. One API key for all global models. Features include: instant invoicing, unlimited concurrency, starting from $0.15, 24/7 technical support. GPT/Claude/Gemini all at 32% off, domestic models 20-50% off, Claude Code exclusive models at 66% off! <a href="https://www.dmxapi.cn/register?aff=bUHu">Register here</a></td> </tr> <tr> <td width="180"><a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch"><img src="assets/partners/logos/ucloud.png" alt="Compshare" width="150"></a></td> <td>Thanks to Compshare for sponsoring this project! Compshare is UCloud's AI cloud platform, providing stable and comprehensive domestic and international model APIs with just one key. Featuring cost-effective monthly and per-use domestic-model Coding Plan packages, alongside stable officially-relayed overseas models. Supports Claude Code, Codex, and API access. Enterprise-grade high concurrency, 24/7 technical support, and self-service invoicing. Users who register via <a href="https://www.compshare.cn/coding-plan?ytag=GPU_YY_YX_git_cc-switch">this link</a> will receive a free 5 CNY platform trial credit!</td> </tr> <tr> <td width="180"><a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch"><img src="assets/partners/logos/crazyrouter.png" alt="Crazyrouter" width="150"></a></td> <td>Thanks to Crazyrouter for sponsoring this project! Crazyrouter is a high-performance AI API aggregation platform — one API key for 300+ models including Claude Code, Codex, Gemini CLI, and more. All models at 55% of official pricing with auto-failover, smart routing, and unlimited concurrency. Crazyrouter offers an exclusive deal for CC Switch users: register via <a href="https://crazyrouter.com/register?aff=OZcm&ref=cc-switch">this link</a> and contact customer support to claim <strong>$2 free credit</strong>, plus enter promo code `CCSWITCH` on your first top-up for an extra <strong>30% bonus credit</strong>! </td> </tr> <tr> <td width="180"><a href="https://www.right.codes/register?aff=CCSWITCH"><img src="assets/partners/logos/rightcode.jpg" alt="RightCode" width="150"></a></td> <td>Thank you to Right Code for sponsoring this project! Right Code reliably provides routing services for models such as Claude Code, Codex, and Gemini, with both pay-as-you-go and monthly subscription billing options available. Invoices are available upon top-up, and enterprise and team users can receive dedicated one-on-one support. Right Code also offers an exclusive discount for CC Switch users: register via <a href="https://www.right.codes/register?aff=CCSWITCH">this link</a>, and with every top-up you will receive pay-as-you-go credit equivalent to 5% of the amount paid.</td> </tr> <tr> <td width="180"><a href="https://www.sssaicode.com/register?ref=DCP0SM"><img src="assets/partners/logos/sssaicode.png" alt="SSSAiCode" width="150"></a></td> <td>Thanks to SSSAiCode for sponsoring this project! SSSAiCode is a stable and reliable API relay service, dedicated to providing stable, reliable, and affordable Claude and Codex model services, with same-day fast invoicing. SSSAiCode offers a special deal for CC Switch users: register via <a href="https://www.sssaicode.com/register?ref=DCP0SM">this link</a> to enjoy $10 extra credit on every top-up!</td> </tr> <tr> <td width="180"><a href="https://www.micuapi.ai/register?aff=aOYQ"><img src="assets/partners/logos/mikubanner.svg" alt="Micu" width="150"></a></td> <td>Thanks to Micu API for sponsoring this project! Micu API is a global LLM relay service provider dedicated to delivering the best cost-performance ratio with high stability. Backed by a registered enterprise for core assurance, eliminating any risk of service discontinuation, with fast official invoicing support! We champion "zero cost to try": top up from as low as ¥1 with no minimum, and get fee-free refunds anytime! Micu API offers an exclusive deal for CC Switch users: register via <a href="https://www.micuapi.ai/register?aff=aOYQ">this link</a> and enter promo code "ccswitch" when topping up to enjoy a <strong>10% discount</strong>!</td> </tr> <tr> <td width="180"><a href="https://etok.ai"><img src="assets/partners/logos/etok.png" alt="ETok" width="150"></a></td> <td>Thanks to ETok.ai for sponsoring this project! ETok.ai is dedicated to building a one-stop AI programming tool service platform. We offer professional Claude Code packages and technical community services, with support for Google Gemini and OpenAI Codex. Through carefully designed plans and a professional tech community, we provide developers with reliable service guarantees and continuous technical support, making AI-assisted programming a true productivity tool. Click <a href="https://etok.ai">here</a> to register!</td> </tr> <tr> <td width="180"><a href="https://console.claudeapi.com/register?aff=pCLD"><img src="assets/partners/logos/claudeapi.png" alt="ClaudeAPI" width="150"></a></td> <td>This project is sponsored by <a href="https://console.claudeapi.com/register?aff=pCLD">Claude API</a>. Direct Claude API access — connect Claude Code and Agent apps in 3 minutes. New users can claim a free trial credit.Powered by official Anthropic API keys + AWS Bedrock official channels. No reverse engineering, no model degradation. Full support for Opus / Sonnet / Haiku model lineup, with official capabilities preserved including Tool Use, 1M context window, and more. Built for Claude Code power users, Agent engineers, and enterprise engineering teams. Invoicing and dedicated team support available. Click <a href="https://console.claudeapi.com/register?aff=pCLD">here</a> to register!</td> </tr> <tr> <td width="180"><a href="https://code0.ai/agent/register/B2XHxGjGmRvqgznY"><img src="assets/partners/logos/code0.png" alt="code0.ai" width="150"></a></td> <td>Thanks to <a href="https://code0.ai/agent/register/B2XHxGjGmRvqgznY">code0.ai</a> for sponsoring this project! code0.ai is an AI coding service platform built for developers, supporting Claude Code, Codex, Gemini, and other mainstream AI coding capabilities. It helps individual developers and teams use AI Agents more stably and efficiently for coding, debugging, refactoring, and automation workflows. ccswitch users can contact customer support via the <a href="https://code0.ai/agent/register/B2XHxGjGmRvqgznY">code0.ai website</a> to claim test credits and experience a reliable AI coding service.</td> </tr> <tr> <td width="180"><a href="https://claudecn.top"><img src="assets/partners/logos/claudecn.jpg" alt="ClaudeCN" width="150"></a></td> <td>Thanks to ClaudeCN for sponsoring this project! ClaudeCN is an enterprise-grade AI gateway platform operated by a registered company. It delivers high-availability commercial API access to popular models including Claude, GPT, and DeepSeek, and is built around formal enterprise procurement workflows — corporate bank transfers, signed contracts, and full compliance. Register via <a href="https://claudecn.top">this link</a>!</td> </tr> <tr> <td width="180"><a href="https://runapi.co"><img src="assets/partners/logos/runapi.jpg" alt="RunAPI" width="150"></a></td> <td>Thanks to RunAPI for sponsoring this project! RunAPI is a high-performance and reliable AI model API gateway — one API key gives you access to 150+ mainstream models including OpenAI, Claude, Gemini, DeepSeek, and Grok, with prices as low as 10% of the official rate and excellent stability. It works seamlessly with Claude Code, OpenClaw, and other tools. Exclusive benefit for CC Switch users: register and contact customer support to claim a free ¥14 credit. Register via <a href="https://runapi.co">this link</a>!</td> </tr> <tr> <td width="180"><a href="https://apikey.fun/register?aff=CCSwitch"><img src="assets/partners/logos/apikey_banner.png" alt="APIKEY.FUN" width="150"></a></td> <td>Thanks to APIKEY.FUN for sponsoring this project! APIKEY.FUN is a professional enterprise-grade AI relay platform dedicated to providing stable, efficient, and low-cost AI model API access for enterprises and individual developers. The platform supports popular mainstream models such as Claude, OpenAI, and Gemini, with prices as low as 7% of official rates. Register through this project's <a href="https://apikey.fun/register?aff=CCSwitch">exclusive link</a> to enjoy an exclusive offer of up to <strong>permanent 5% off top-ups</strong>.</td> </tr> <tr> <td width="180"><a href="https://apinebula.com/02rw5X"><img src="assets/partners/logos/apinebula_banner.png" alt="APINebula" width="150"></a></td> <td>Thanks to APINEBULA for sponsoring this project! APINEBULA, an enterprise-grade AI aggregation platform under Galaxy Video Bureau, leverages extensive platform resources to provide developers, teams, and enterprises with stable, cost-effective access to large language model APIs. The platform integrates leading, full-powered models like Claude, GPT, and Gemini, allowing you to connect to the world's top AI models through a single API, with prices starting as low as 10% of the original cost. Designed for AI programming, Agent development, and business system integration, APINEBULA supports enterprise-grade high concurrency, formal contracts, corporate bank transfers, and invoicing services. APINEBULA provides special discounts for our software users: register using <a href="https://apinebula.com/02rw5X">this link</a> and enter the <strong>"ccswitch"</strong> promo code during your first recharge to get <strong>10% off</strong>.</td> </tr> <tr> <td width="180"><a href="https://www.atlascloud.ai/coding-plan?utm_source=github&utm_campaign=cc-switch"><img src="assets/partners/logos/atlascloud_banner.png" alt="Atlas Cloud" width="150"></a></td> <td>Atlas Cloud is a full-modal AI inference platform that gives developers a single AI API to access video generation, image generation, and LLM APIs. Instead of managing multiple vendor integrations, you connect once and get unified access to 300+ curated models across all modalities. Check out Atlas Cloud's new <a href="https://www.atlascloud.ai/coding-plan?utm_source=github&utm_campaign=cc-switch">coding plan</a> promotion for more budget-friendly API access!</td> </tr> <tr> <td width="180"><a href="https://www.ccsub.net/register?ref=Y6Z8DXEA"><img src="assets/partners/logos/ccsub.svg" alt="CCSub" width="150"></a></td> <td>Thanks to CCSub for sponsoring this project! CCSub is a stable, affordable AI API relay platform — your drop-in replacement for a Claude.ai subscription. One API key gives you access to Claude Opus 4.8, Sonnet, Haiku, GPT-5, Gemini, and DeepSeek at roughly 30% of direct API cost, with no VPN required from anywhere in the world. Compatible with Claude Code, Codex, Cursor, Cline, Continue, Windsurf, and all major AI coding tools. Register via <a href="https://www.ccsub.net/register?ref=Y6Z8DXEA">this link</a> and get $5 free credit on sign-up.</td> </tr> <tr> <td width="180"><a href="https://unity2.ai/register?source=ccs"><img src="assets/partners/logos/unity2.jpg" alt="Unity2.ai" width="150"></a></td> <td>Thanks to Unity2.ai for sponsoring this project! Unity2.ai is a high-performance AI model API relay platform for individual developers, teams, and enterprises. Long trusted by leading companies in China, it serves over 30 billion tokens per day and supports high concurrency at the 5,000 RPM level. It offers balance-based billing, first top-up bonuses, bundle subscriptions, corporate invoicing, and dedicated support. Register via <a href="https://unity2.ai/register?source=ccs">this link</a> to get $2 in credits, plus another $10 for joining the official group — up to $12 in free credits!</td> </tr> <tr> <td width="180"><a href="https://api.fenno.ai/register?redirect=/purchase?tab=subscription%26group=16&aff=P9MR3D3PLCNL"><img src="assets/partners/logos/fenno-banner.png" alt="Fenno.ai" width="150"></a></td> <td>Thanks to Fenno.ai for sponsoring this project! Fenno.ai is a stable and efficient API relay service provider, currently focused on Codex relay. It is compatible with the OpenAI and Anthropic protocols and can be flexibly used from Codex, Claude Code, OpenCode, and other mainstream coding tools. It reliably supports enterprise-grade workloads of hundreds of billions of tokens per day, with corporate (B2B) settlement and invoicing for both domestic and overseas entities. Fenno.ai offers an exclusive benefit for CC Switch users: subscribe via <a href="https://api.fenno.ai/register?redirect=/purchase?tab=subscription%26group=16&aff=P9MR3D3PLCNL">this link</a> to the incredible ¥9.9 Coding Plan worth $150 in credits, and earn up to 20% in referral rewards — invite more, earn more!</td> </tr> <tr> <td width="180"><a href="https://nekocode.ai?aff=CCSWITCH"><img src="assets/partners/logos/nekocode-banner.png" alt="NekoCode" width="150"></a></td> <td>Thanks to <a href="https://nekocode.ai?aff=CCSWITCH">NekoCode</a> for sponsoring this project! NekoCode provides developers with a stable, efficient, and reliable API relay service for Claude, Codex, and other AI models. With transparent pricing and flexible pay-as-you-go billing, it offers a simple and cost-effective way to access AI models. CC Switch users can enjoy an exclusive 10% discount: register via <a href="https://nekocode.ai?aff=CCSWITCH">this link</a> and enter promo code <code>cc-switch</code> during recharge to receive 10% off your top-up!</td> </tr> <tr> <td width="180"><a href="https://www.newapi.ai/"><img src="assets/partners/logos/newapi-banner.png" alt="new-api" width="150"></a></td> <td>Thanks to the open-source AI infrastructure project <a href="https://www.newapi.ai/">new-api</a> for its strong support of this project! new-api is an open-source AI infrastructure project from QuantumNous and one of the leading unified LLM access-and-distribution projects by activity and adoption, focused on helping developers, teams, and enterprises build manageable, scalable AI service platforms at lower cost. As a fellow project rooted in the open-source ecosystem, new-api hopes to sponsor and support the continued growth of more outstanding open-source projects. 🌟 Star new-api to show your support: <a href="https://github.com/QuantumNous/new-api">https://github.com/QuantumNous/new-api</a>. Website: <a href="https://www.newapi.ai/">https://www.newapi.ai/</a>.</td> </tr> <tr> <td width="180"><a href="https://subrouter.ai/register?aff=l3ri"><img src="assets/partners/logos/subrouter-banner.png" alt="SubRouter" width="150"></a></td> <td>Thanks to SubRouter for sponsoring this project! SubRouter is a marketplace and smart routing platform for AI service operators. Merchants can launch operating sites, publish packages, manage users, models, and pricing, while users discover services and access reliable AI models through one unified API. Register via <a href="https://subrouter.ai/register?aff=l3ri">this link</a>!</td> </tr> </table> </details> ## Why CC Switch? Modern AI-powered coding relies on tools like Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, and Hermes — but each has its own configuration format. Switching API providers means manually editing JSON, TOML, or `.env` files, and there is no unified way to manage MCP and Skills across multiple tools. **CC Switch** gives you a single desktop app to manage all supported AI tools. Instead of editing config files by hand, you get a visual interface to import providers with one click, switch between them instantly, with 50+ built-in provider presets, unified MCP and Skills management, and system tray quick switching — all backed by a reliable SQLite database with atomic writes that protect your configs from corruption. - **One App, Eight Tools** — Manage Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, and Hermes from a single interface - **No More Manual Editing** — 50+ provider presets including AWS Bedrock, NVIDIA NIM, and community relays; just pick and switch - **Unified MCP & Skills Management** — One panel to manage MCP servers and Skills across Claude, Codex, Gemini, Grok Build, OpenCode, and Hermes with bidirectional sync - **System Tray Quick Switch** — Switch providers instantly from the tray menu, no need to open the full app - **Cloud Sync** — Sync provider data across devices via Dropbox, OneDrive, iCloud, or WebDAV servers - **Cross-Platform** — Native desktop app for Windows, macOS, and Linux, built with Tauri 2 - **Built-in Utilities** — Includes various utilities for first-launch login confirmation, signature bypass, plugin extension sync, and more ## Screenshots | Main Interface | Add Provider | | :-----------------------------------------------: | :--------------------------------------------: | | ![Main Interface](assets/screenshots/main-en.png) | ![Add Provider](assets/screenshots/add-en.png) | ## Features [Full Changelog](CHANGELOG.md) | [Release Notes](docs/release-notes/v3.16.1-en.md) ### Provider Management - **8 supported tools, 50+ presets** — Claude Code, Claude Desktop, Codex, Gemini CLI, Grok Build, OpenCode, OpenClaw, Hermes; copy your key and import with one click - **Universal providers** — One config syncs to Claude Code, Codex, and Gemini CLI - One-click switching, system tray quick access, drag-and-drop sorting, import/export ### Proxy & Failover - **Local proxy with hot-switching** — Format conversion, auto-failover, circuit breaker, provider health monitoring, and request rectifier - **App-level takeover** — Independently proxy Claude, Codex, Gemini, or Grok Build, down to individual providers ### MCP, Prompts & Skills - **Unified MCP panel** — Manage MCP servers across Claude, Codex, Gemini, Grok Build, OpenCode, and Hermes with bidirectional sync and Deep Link import - **Prompts** — Markdown editor with cross-app sync (CLAUDE.md / AGENTS.md / GEMINI.md) and backfill protection - **Skills** — One-click install from GitHub repos or ZIP files, custom repository management, with symlink and file copy support ### Usage & Cost Tracking - **Usage dashboard** — Track spending, requests, and tokens with trend charts, detailed request logs, and custom per-model pricing ### Session Manager & Workspace - Browse, search, and restore conversation history across supported session sources - **Workspace editor** (OpenClaw) — Edit agent files (AGENTS.md, SOUL.md, etc.) with Markdown preview ### System & Platform - **Cloud sync** — Custom config directory (Dropbox, OneDrive, iCloud, NAS) and WebDAV server sync - **Deep Link** (`ccswitch://`) — Import providers, MCP servers, prompts, and skills via URL - Dark / Light / System theme, auto-launch, auto-updater, atomic writes, auto-backups, i18n (zh/zh-TW/en/ja) ## FAQ <details> <summary><strong>Which AI tools does CC Switch support?</strong></summary> CC Switch supports eight tools: **Claude Code**, **Claude Desktop**, **Codex**, **Gemini CLI**, **Grok Build**, **OpenCode**, **OpenClaw**, and **Hermes**. Each tool has dedicated provider presets and configuration management. </details> <details> <summary><strong>Do I need to restart the terminal after switching providers?</strong></summary> For most tools, yes — restart your terminal or the CLI tool for changes to take effect. The exception is **Claude Code**, which currently supports hot-switching of provider data without a restart. </details> <details> <summary><strong>My plugin configuration disappeared after switching providers — what happened?</strong></summary> CC Switch provides a "Shared Config Snippet" feature to pass common data (beyond API keys and endpoints) between providers. Go to "Edit Provider" → "Shared Config Panel" → click "Extract from Current Provider" to save all common data. When creating a new provider, check "Write Shared Config" (enabled by default) to include plugin data in the new provider. All your configuration items are preserved in the default provider imported when you first launched the app. </details> <details> <summary><strong>macOS installation</strong></summary> CC Switch for macOS is code-signed and notarized by Apple. You can download and install it directly — no extra steps needed. We recommend using the `.dmg` installer. </details> <details> <summary><strong>Why can't I delete the currently active provider?</strong></summary> CC Switch follows a "minimal intrusion" design principle — even if you uninstall the app, your CLI tools will continue to work normally. The system always keeps one active configuration, because deleting all configurations would make the corresponding CLI tool unusable. If you rarely use a specific CLI tool, you can hide it in Settings. To switch back to official login, see the next question. </details> <details> <summary><strong>How do I switch back to official login?</strong></summary> Add an official provider from the preset list. After switching to it, run the Log out / Log in flow, and then you can freely switch between the official provider and third-party providers. Codex supports switching between different official providers, making it easy to switch between multiple Plus or Team accounts. </details> <details> <summary><strong>Where is my data stored?</strong></summary> - **Database**: `~/.cc-switch/cc-switch.db` (SQLite — providers, MCP, prompts, skills) - **Local settings**: `~/.cc-switch/settings.json` (device-level UI preferences) - **Backups**: `~/.cc-switch/backups/` (auto-rotated, keeps 10 most recent) - **Skills**: `~/.cc-switch/skills/` (symlinked to corresponding apps by default) - **Skill Backups**: `~/.cc-switch/skill-backups/` (created automatically before uninstall, keeps 20 most recent) </details> <details> <summary><strong>Linux (Wayland + NVIDIA): clicks don't register and the window black-screens on resize</strong></summary> The AppImage forces `GDK_BACKEND=x11` (XWayland) to avoid a historical native-Wayland crash. On newer Wayland + NVIDIA setups this can leave the web content area unclickable (the title-bar buttons still work) and black-screen on resize. Launch with the opt-in escape hatch to switch back to native Wayland: ```bash CC_SWITCH_GDK_BACKEND=wayland ./CC-Switch-*.AppImage ``` If you launch from a desktop icon, add it to the `.desktop` `Exec=` line (e.g. `env CC_SWITCH_GDK_BACKEND=wayland /path/to/AppImage`) or set it in your session environment. The variable is generic: on tiling Wayland compositors (sway/Hyprland) where clicks don't register, try `CC_SWITCH_GDK_BACKEND=x11` instead. Leaving it unset keeps the default behavior. </details> ## Documentation For detailed guides on every feature, check out the **[User Manual](docs/user-manual/en/README.md)** — covering provider management, MCP/Prompts/Skills, proxy & failover, and more. ## Quick Start ### Basic Usage 1. **Add Provider**: Click "Add Provider" → Choose a preset or create custom configuration 2. **Switch Provider**: - Main UI: Select provider → Click "Enable" - System Tray: Click provider name directly (instant effect) 3. **Takes Effect**: Restart your terminal or the corresponding CLI tool to apply changes (Claude Code does not require a restart) 4. **Back to Official**: Add an "Official Login" preset, restart the CLI tool, then follow its login/OAuth flow ### MCP, Prompts, Skills & Sessions - **MCP**: Click the "MCP" button → Add servers via templates or custom config → Toggle per-app sync - **Prompts**: Click "Prompts" → Create presets with Markdown editor → Activate to sync to live files - **Skills**: Click "Skills" → Browse GitHub repos → One-click install to supported apps - **Sessions**: Click "Sessions" → Browse, search, and restore conversation history across supported session sources > **Note**: On first launch, you can manually import existing CLI tool configs as the default provider. ## Download & Installation ### System Requirements - **Windows**: Windows 10 and above - **macOS**: macOS 12 (Monterey) and above - **Linux**: Ubuntu 22.04+ / Debian 11+ / Fedora 34+ and other mainstream distributions ### Windows Users Download the latest `CC-Switch-v{version}-Windows.msi` installer or `CC-Switch-v{version}-Windows-Portable.zip` portable version from the [Releases](../../releases) page. ### macOS Users **Method 1: Install via Homebrew (Recommended)** ```bash brew install --cask cc-switch ``` Update: ```bash brew upgrade --cask cc-switch ``` **Method 2: Manual Download** Download `CC-Switch-v{version}-macOS.dmg` (recommended) or `.zip` from the [Releases](../../releases) page. > **Note**: CC Switch for macOS is code-signed and notarized by Apple. You can install and open it directly. ### Arch Linux Users **Install via paru (Recommended)** ```bash paru -S cc-switch-bin ``` ### Linux Users Download the latest Linux build from the [Releases](../../releases) page: - `CC-Switch-v{version}-Linux.deb` (Debian/Ubuntu) - `CC-Switch-v{version}-Linux.rpm` (Fedora/RHEL/openSUSE) - `CC-Switch-v{version}-Linux.AppImage` (Universal) > **Flatpak**: Not included in official releases. You can build it yourself from the `.deb` — see [`flatpak/README.md`](flatpak/README.md) for instructions. <details> <summary><strong>Architecture Overview</strong></summary> ### Design Principles ``` ┌─────────────────────────────────────────────────────────────┐ │ Frontend (React + TS) │ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │ │ Components │ │ Hooks │ │ TanStack Query │ │ │ │ (UI) │──│ (Bus. Logic) │──│ (Cache/Sync) │ │ │ └─────────────┘ └──────────────┘ └──────────────────┘ │ └────────────────────────┬────────────────────────────────────┘ │ Tauri IPC ┌────────────────────────▼────────────────────────────────────┐ │ Backend (Tauri + Rust) │ │ ┌─────────────┐ ┌──────────────┐ ┌──────────────────┐ │ │ │ Commands │ │ Services │ │ Models/Config │ │ │ │ (API Layer) │──│ (Bus. Layer) │──│ (Data) │ │ │ └─────────────┘ └──────────────┘ └──────────────────┘ │ └─────────────────────────────────────────────────────────────┘ ``` **Core Design Patterns** - **SSOT** (Single Source of Truth): All data stored in `~/.cc-switch/cc-switch.db` (SQLite) - **Dual-layer Storage**: SQLite for syncable data, JSON for device-level settings - **Dual-way Sync**: Write to live files on switch, backfill from live when editing active provider - **Atomic Writes**: Temp file + rename pattern prevents config corruption - **Concurrency Safe**: Mutex-protected database connection avoids race conditions - **Layered Architecture**: Clear separation (Commands → Services → DAO → Database) **Key Components** - **ProviderService**: Provider CRUD, switching, backfill, sorting - **McpService**: MCP server management, import/export, live file sync - **ProxyService**: Local proxy mode with hot-switching and format conversion - **SessionManager**: Conversation history browsing across supported session sources - **ConfigService**: Config import/export, backup rotation - **SpeedtestService**: API endpoint latency measurement </details> <details> <summary><strong>Development Guide</strong></summary> ### Environment Requirements - Node.js 18+ - pnpm 8+ - Rust 1.85+ - Tauri CLI 2.8+ ### Development Commands ```bash # Install dependencies pnpm install # Dev mode (hot reload) pnpm dev # Type check pnpm typecheck # Format code pnpm format # Check code format pnpm format:check # Run frontend unit tests pnpm test:unit # Run tests in watch mode (recommended for development) pnpm test:unit:watch # Build application pnpm build # Build debug version pnpm tauri build --debug ``` ### Rust Backend Development ```bash cd src-tauri # Format Rust code cargo fmt # Run clippy checks cargo clippy # Run backend tests cargo test # Run specific tests cargo test test_name # Run tests with test-hooks feature cargo test --features test-hooks ``` ### Testing Guide **Frontend Testing**: - Uses **vitest** as test framework - Uses **MSW (Mock Service Worker)** to mock Tauri API calls - Uses **@testing-library/react** for component testing **Running Tests**: ```bash # Run all tests pnpm test:unit # Watch mode (auto re-run) pnpm test:unit:watch # With coverage report pnpm test:unit --coverage ``` ### Tech Stack **Frontend**: React 18 · TypeScript · Vite · TailwindCSS 3.4 · TanStack Query v5 · react-i18next · react-hook-form · zod · shadcn/ui · @dnd-kit **Backend**: Tauri 2.8 · Rust · serde · tokio · thiserror · tauri-plugin-updater/process/dialog/store/log **Testing**: vitest · MSW · @testing-library/react </details> <details> <summary><strong>Project Structure</strong></summary> ``` ├── src/ # Frontend (React + TypeScript) │ ├── components/ │ │ ├── providers/ # Provider management │ │ ├── mcp/ # MCP panel │ │ ├── prompts/ # Prompts management │ │ ├── skills/ # Skills management │ │ ├── sessions/ # Session Manager │ │ ├── proxy/ # Proxy mode panel │ │ ├── openclaw/ # OpenClaw config panels │ │ ├── settings/ # Settings (Terminal/Backup/About) │ │ ├── deeplink/ # Deep Link import │ │ ├── env/ # Environment variable management │ │ ├── universal/ # Cross-app configuration │ │ ├── usage/ # Usage statistics │ │ └── ui/ # shadcn/ui component library │ ├── hooks/ # Custom hooks (business logic) │ ├── lib/ │ │ ├── api/ # Tauri API wrapper (type-safe) │ │ └── query/ # TanStack Query config │ ├── locales/ # Translations (zh/zh-TW/en/ja) │ ├── config/ # Presets (providers/mcp) │ └── types/ # TypeScript definitions ├── src-tauri/ # Backend (Rust) │ └── src/ │ ├── commands/ # Tauri command layer (by domain) │ ├── services/ # Business logic layer │ ├── database/ # SQLite DAO layer │ ├── proxy/ # Proxy module │ ├── session_manager/ # Session management │ ├── deeplink/ # Deep Link handling │ └── mcp/ # MCP sync module ├── tests/ # Frontend tests └── assets/ # Screenshots & partner resources ``` </details> ## Contributing Issues and suggestions are welcome! Before submitting PRs, please ensure: - Pass type check: `pnpm typecheck` - Pass format check: `pnpm format:check` - Pass unit tests: `pnpm test:unit` For new features, please open an issue for discussion before submitting a PR. PRs for features that are not a good fit for the project may be closed. ## Star History [![Star History Chart](https://api.star-history.com/svg?repos=farion1231/cc-switch&type=Date)](https://www.star-history.com/#farion1231/cc-switch&Date) ## License MIT © Jason Young