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

farion1231/cc-switch v3.20.3

2026-09-11 16:10 · ⭐ 13.2万 · GitHub Release 原文 ↗
#版本发布 #Codex直连 #代理修复

farion1231/cc-switch v3.20.3

一句话概括:本版把 Kimi 的两条 Codex 预设改为原生 Responses 直连,使 DeepSeek、GLM、千问、MiniMax、小米 MiMo、LongCat、Kimi 等主流开源模型的官方 Codex 预设全部直连厂商端点,同时集中修复了一批由贡献者主导的正确性问题,并做了一轮预设与定价维护(无数据库迁移)。

新增能力

修复问题

预设与定价维护

Breaking change 与升级提醒

版本规模

▸ Release Notes 英文原文(27079 字符)
# CC Switch v3.20.3 > 如今主流开源模型的官方 API 大多已原生支持 OpenAI Responses 格式。本版把 Codex 里 Kimi 的两条预设也从 Chat Completions 转换改为**原生 Responses 直连**——至此 DeepSeek、智谱 GLM、千问、MiniMax、小米 MiMo、LongCat、Kimi 这些主流开源模型的官方 Codex 预设全部直连厂商端点,连同火山豆包与腾讯混元,不再需要开本地路由做格式转换。如果你的 Codex 卡片还是早先添加的 Chat 格式,重新添加一次预设,或在编辑页把「上游格式」改成 Responses,就能直连。其余是一波由贡献者主导的正确性修复:空 `reasoning_content` 占位符不再让 Claude Code 被空 Thought 块刷屏、Codex 长任务不再在一句进度汇报后戛然而止、Claude Desktop 的模型探针不再在 Responses 上游下误报「不可用」、每次退出都把 Claude 的代理重试与超时抄给 Codex/Gemini/Grok Build 的串写关闭、统一供应商同步不再清空子卡设置;Codex 侧补上省略 `model_provider` 时的代理路由、Windows 上正在增长的会话用量、托盘里托管账号的额度。预设与定价做了一轮维护:聚合平台目录刷新、千问AI平台改名并升到 Qwen 3.8、MiniMax 默认 M3、DeepSeek V4 家族按 V4.1 Flash 档调价。**本版不含数据库迁移。** **[English →](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/release-notes/v3.20.3-en.md) | [日本語版 →](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/release-notes/v3.20.3-ja.md)** --- ## 重点内容:你现在可以 - **在 Codex 里直连 Kimi,走原生 Responses**:Kimi 开放平台与 Kimi For Coding 两条预设从 `openai_chat` 改为 `openai_responses`,Codex 直接连厂商的 `/v1/responses`,不再需要开本地路由做 Responses→Chat 转换。至此 DeepSeek、智谱 GLM、千问、MiniMax、小米 MiMo、LongCat、Kimi 这些主流开源模型的官方 Codex 预设全部直连;仍只提供 Chat Completions 的端点(百度千帆、腾讯 Token Plan、QwenCloud For Coding、StepFun、百灵、ModelScope 与各聚合平台)继续经本地路由转换。如果你现有的卡片还是早先添加的 Chat 格式(Kimi,以及前几版已切换的 DeepSeek、GLM 等),重新添加一次预设,或在编辑页把「上游格式」改成 Responses,即可直连;详见升级提醒。 - **Claude Code 不再被空 Thought 块刷屏**([#7227](https://github.com/farion1231/cc-switch/pull/7227),修复 [#5028](https://github.com/farion1231/cc-switch/issues/5028)、[#4404](https://github.com/farion1231/cc-switch/issues/4404)):GLM、Qwen、DeepSeek 一类在每个 chunk 里带空 `reasoning_content` 占位的上游,不再让每个 token 变成一行外加一个空思考块。 - **Codex 长任务不再在一句进度汇报后戛然而止**([#7280](https://github.com/farion1231/cc-switch/pull/7280),修复 [#6529](https://github.com/farion1231/cc-switch/issues/6529)):经 Chat 上游时,commentary 与紧随的工具调用合并进同一条 assistant 消息,上游不再提前 `stop`。 - **Claude Desktop 在 Responses 上游下不再报「模型不可用」**([#7287](https://github.com/farion1231/cc-switch/pull/7287),修复 [#7103](https://github.com/farion1231/cc-switch/issues/7103)):探针的 `max_tokens=1` 在转换时夹到 Responses API 允许的最小值 16。 - **退出后 Codex、Gemini、Grok Build 的代理重试与超时设置不再被 Claude 的覆盖**([#7210](https://github.com/farion1231/cc-switch/pull/7210),修复 [#7204](https://github.com/farion1231/cc-switch/issues/7204))。 - **同步统一供应商不再清空子卡的用量脚本、通用配置退出与排序**([#7212](https://github.com/farion1231/cc-switch/pull/7212),修复 [#7134](https://github.com/farion1231/cc-switch/issues/7134))。 - **没写 `model_provider` 的 Codex 卡接管时也走本地代理**([#7263](https://github.com/farion1231/cc-switch/pull/7263),修复 [#6256](https://github.com/farion1231/cc-switch/issues/6256)),不再悄悄直连 `api.openai.com`。 - **Windows 上正在增长的 Codex 会话用量不再漏采**([#7219](https://github.com/farion1231/cc-switch/pull/7219),修复 [#6060](https://github.com/farion1231/cc-switch/issues/6060)):mtime 不动时也按文件大小判定。 - **托盘显示托管 Codex 卡所绑 ChatGPT 账号的额度**(修复 [#7267](https://github.com/farion1231/cc-switch/issues/7267)):绑定多个账号时不再只剩名字。 - **看到 Claude Fable 的周限额**:供应商卡片与托盘都解析用量 API 新的 `limits[]` 数组。 - **一键禁用 Claude Code 的 Artifact 工具**:DeepSeek 等严格校验工具 schema 的网关不再对每个请求返回 400。 - **DeepSeek 官方 Codex 预设能读图**([#7286](https://github.com/farion1231/cc-switch/pull/7286),修复 [#7283](https://github.com/farion1231/cc-switch/issues/7283));`deepseek-flash` 与 V4 家族按 V4.1 Flash 档记账,不再按 $0 或旧高峰价。 - **一键添加 千问AI平台 Token Plan**([#7183](https://github.com/farion1231/cc-switch/pull/7183));千问AI平台升到 Qwen 3.8、MiniMax 默认 M3([#7255](https://github.com/farion1231/cc-switch/pull/7255))、聚合平台 Codex 目录刷新。 --- ## 使用攻略 - **[添加供应商](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/user-manual/zh/2-providers/2.1-add.md)**:Codex 的原生 Responses 直连与 Chat 路由转换的区别、Claude 快捷开关表(含新增的「禁用 Artifact 工具」),以及「预设改动只影响新建供应商」的含义。 - **[请求路由](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/user-manual/zh/4-proxy/4.2-routing.md)**:接管模式下的配置改写与恢复——本版 Codex 缺 `model_provider` 时的路由修复落在这条路径。 - **[用量统计](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/user-manual/zh/4-proxy/4.4-usage.md)**:Codex 会话解析与定价配置,本版的字节游标与定价回填口径。 --- > [!WARNING] > > ## 唯一官方渠道声明(请务必阅读) > > CC Switch 是**完全免费、开源**的桌面应用,**不会向用户收取任何费用**。请仅通过下列官方渠道获取本软件: > > | 类别 | 唯一官方 | > | -------- | ------------------------------------------------------------------------------ | > | 官网 | **[ccswitch.io](https://ccswitch.io)** | > | 源码 | **[github.com/farion1231/cc-switch](https://github.com/farion1231/cc-switch)** | > | 下载 | **[GitHub Releases](https://github.com/farion1231/cc-switch/releases)** | > | 作者 | **[@farion1231](https://github.com/farion1231)** | > | 举报山寨 | **[GitHub Issues](https://github.com/farion1231/cc-switch/issues)** | > > **任何向你收费、要求充值、或索取登录凭据的"CC Switch"网站或客户端均为假冒**。如果你被诱导支付了费用,请立即停止操作并通过 GitHub Issues 反馈。 --- ## 概览 主流开源模型的官方 API 如今大多已原生提供 OpenAI Responses 端点,Codex 也早已以 Responses 为唯一原生协议。此前 CC Switch 对这些模型的 Codex 预设分两种形态:厂商端点原生支持 Responses 的直连,只提供 Chat Completions 的则由本地代理把 Codex 的 Responses 请求转换成 Chat、再把流式响应转换回来。转换路径能用,但多一层翻译就多一处出错的地方——本版修的 [#7280](https://github.com/farion1231/cc-switch/pull/7280) 正是这类转换缺陷。Kimi 开放平台与 Kimi For Coding 的端点现在都原生提供 `/v1/responses`,官方 Codex 接入指南也要求 `wire_api = "responses"`,于是这两条预设改为原生 Responses 直连。至此 DeepSeek、智谱 GLM、千问(千问AI平台 / QwenCloud)、MiniMax、小米 MiMo、LongCat、Kimi 这些主流开源模型的官方 Codex 预设全部直连厂商端点,连同火山豆包与腾讯混元;仍只提供 Chat Completions 的端点(百度千帆、腾讯 Token Plan、QwenCloud For Coding、StepFun、百灵、ModelScope 与各聚合平台)继续经本地路由转换,手册的「仅 Chat」示例也改为点名这些供应商。 其余是一波由贡献者主导的正确性修复,关闭了几个挂了数月的 issue。代理侧:在每个 chunk 里保留空 `reasoning_content` 占位的 OpenAI 兼容上游不再让 Claude Code 被空 Thought 块刷屏、逐 token 换行;Codex Responses→Chat 转换器不再把 commentary 消息与紧随的工具调用拆成两条 assistant 消息——这曾让长任务在一句进度汇报后就结束;Claude Desktop 的一 token 模型探针夹到 Responses API 的最小值,映射模型不再被报为「不可用」;Codex 路由下的图片生成补上贴完整端点、大小写后缀与流式用量三处。两个数据完整性问题关闭:每次正常退出都把 Claude 的重试与超时设置抄到 Codex、Gemini、Grok Build 的代理行;同步统一供应商会清空子卡的用量脚本、通用配置退出与端点自动选择,并把卡片挤到列表底部。Codex 侧:卡片省略 `model_provider` 时接管现在尊重代理地址;用量导入经持久化的字节游标在 Windows NTFS 上识别正在增长的 rollout;托盘为托管 Codex 卡显示所绑 ChatGPT 账号的额度;Claude Fable 的周限额出现在卡片与托盘。Claude 供应商编辑器新增「禁用 Artifact 工具」快捷开关,给拒收 Claude Code Artifact 工具 schema 的网关用。 预设侧:聚合平台 Codex 预设刷新到当前目录,DashScope/百炼改名千问AI平台并升到 Qwen 3.8([#7183](https://github.com/farion1231/cc-switch/pull/7183)),MiniMax 默认改到 M3([#7255](https://github.com/farion1231/cc-switch/pull/7255)),内置 DeepSeek Codex 目录镜像支持视觉的 `deepseek-flash`([#7286](https://github.com/farion1231/cc-switch/pull/7286)),DeepSeek V4 家族按 V4.1 Flash 档调价。本版不改数据库 schema。 **发布日期**:2026-09-11 **更新规模**:22 commits | 62 files changed | +3,458 / -802 lines --- ## 新功能 ### Claude 供应商编辑器新增「禁用 Artifact 工具」快捷开关 部分第三方 Anthropic 兼容网关(DeepSeek 在列)用严格的正则校验器检查工具 JSON Schema,拒收 Claude Code 的 Artifact 工具在其 `str_replace` 数据库能力铺开后发出的 Unicode 属性转义(`\p{Cc}`、`\p{Cf}` 等)——此后每个请求都 400 `Invalid schema for function 'Artifact'`,与所选模型无关。Claude 快捷开关旁新增第六个复选框,在供应商上设置 `env.CLAUDE_CODE_DISABLE_ARTIFACT="1"`,把 Artifact 工具整个排除出 tools 数组;取消勾选时像其他开关一样删掉该键。四语文案与手册(zh/en/ja)的开关表已同步。 ### Claude Fable 的周限额出现在供应商卡片与托盘 Claude OAuth 用量 API 现在把按模型的周限额放在顶层 `limits[]` 数组里(`kind: "weekly_scoped"`,带 `scope.model.display_name` 与 `percent`),不再是独立的顶层窗口;解析器只读旧窗口,Fable 的限额从未显示过。`limits[]` 现在解析进 `seven_day_fable`、`seven_day_opus` 与 `seven_day_sonnet`——scoped 行覆盖同名旧窗口,重复与畸形行跳过,旧窗口、额外用量与未知窗口都保留。托盘给 Fable 单独一组标签,不再并进周 max 值;四语补「Fable」标签。 ### 新增预设 千问AI平台 Token Plan([#7183](https://github.com/farion1231/cc-switch/pull/7183))加入 Claude Code、Claude Desktop、Codex、Hermes、OpenClaw、OpenCode 与 Pi 七个应用的预设库,与下文的改名同批。存量供应商不受影响。 ### `deepseek-flash` 与 `deepseek-v4-flash-vision-exp` 的定价行 `deepseek-flash` 是 DeepSeek 目前唯一推荐的 id,`deepseek-v4-flash-vision-exp` 是官方安装脚本 1.2.0 之前写入的旧视觉名;两者都由 V4.1 Flash 服务,按其 $0.30/$1.20 每百万、缓存读 $0.006 计费。此前两者都没有行,而 `LIKE '{id}-%'` 的前缀回退只匹配更长的 id,这两个 id 下的请求一律按 $0 入账。 --- ## 变更 ### Kimi 的 Codex 预设改为原生 Responses 直连 Kimi 开放平台(`api.moonshot.cn/v1`)与 Kimi For Coding(`api.kimi.com/coding/v1`)现在都原生提供 `/v1/responses`,官方 Codex 接入指南要求 `wire_api = "responses"`,于是两条预设从 `openai_chat`(本地代理做 Responses→Chat 转换、必须开路由接管)改为 `openai_responses`(Codex 直连)。两个端点都用真实密钥按 Codex 0.153.4 的完整请求形态实测(`reasoning.encrypted_content`、`reasoning.summary`、托管 web_search、回放的 reasoning 项),并用 `codex exec` 跑通端到端工具循环。`kimi-k3` 成为开放平台的默认模型与目录首行,`kimi-k2.7-code` 保留为第二行;只对 Chat 转换有意义的 `codexChatReasoning` 从两条预设移除,Kimi For Coding 的 `promptCacheRouting` 也去掉——原生路径上 Codex 自己发 `prompt_cache_key`;每个 Kimi 行声明 `supportsParallelToolCalls`,与官方 Kimi Code `models.json` 一致;不声明 reasoning 默认值,因为 `config.toml` 的 `model_reasoning_effort` 优先于目录默认值,后者只标记 `/model` 选择器。手册(zh/en/ja)的「仅 Chat」示例改为点名仍走 Chat 路由的供应商,「Kimi Code 拒收 `codex-cli` user agent」的过时说明已纠正。无后端改动。 ### 聚合平台的 Codex 预设刷新到当前目录 SiliconFlow(.cn)默认改为 `deepseek-ai/DeepSeek-V4-Flash`(1M 窗口,high/max 档,显式的 `enable_thinking`/`reasoning_effort` 约定),因为国内站的 MiniMax M2.5 已下线;Atlas Cloud 改为 `zai-org/glm-5.2`,其 Coding Plan 包含的最新 GLM(1M 窗口);Novita 改为 `zai-org/glm-5.3`(1M,纯文本);NVIDIA NIM 改为 `moonshotai/kimi-k3`(1M,文本+图片;NIM 接受 `reasoning_effort` 的 low/high/max、字段缺省时按 max,预设显式钉 high 与其 `config.toml` 一致);OpenCode Go 的 GLM/Kimi 条目更新——`glm-5.3`(新默认)、`glm-5.3-flash` 与 `kimi-k3` 替换 `glm-5.2`、`glm-5.1` 与 `kimi-k2.7-code`,窗口、模态与档位按 models.dev 镜像,DeepSeek V4 Pro/Flash 与 MiMo V2.5 Pro 行保留。平台未文档化新模型思考/档位约定的(Atlas Cloud、Novita),预设带一条显式的空覆盖,后端不再按模型名注入厂商原生思考字段。 ### DashScope/百炼预设改名千问AI平台并升到 Qwen 3.8([#7183](https://github.com/farion1231/cc-switch/pull/7183)) 国内百炼预设改名千问AI平台,配专属图标,控制台与 API Key 链接改到 `platform.qianwenai.com`;Qwen 系列在 Claude Code、Claude Desktop、Codex、Hermes、OpenClaw、OpenCode 与 Pi 七处升到 3.8 代——Opus/Sonnet/Haiku 角色对应 `qwen3.8-max` / `qwen3.7-plus` / `qwen3.8-flash`,统一使用官方的 983,616 token 窗口;国内 `Bailian For Coding` 预设(Claude Code、Claude Desktop、Hermes)改名 `千问AI平台 Coding Plan`,端点不变;OpenClaw/OpenCode/Pi 的模型元数据对齐官方客户端文档。国际 QwenCloud 预设保留名称、换专属图标;按量付费预设升到 Qwen 3.8,Token Plan 预设与之对齐(Codex 与 Hermes 本已带 3.8 行),QwenCloud For Coding 保留 `qwen3.7-plus`、`qwen3-coder-plus` 与 `coding-intl` 端点。端点只有一处例外:Pi 的 QwenCloud Token Plan 从 `/apps/anthropic`(Anthropic Messages)切到 `/compatible-mode/v1`(OpenAI Chat Completions),Hermes 与 OpenClaw 的 Token Plan 仍在 Anthropic 地址。 ### MiniMax 预设默认 M3、清掉过期优惠([#7255](https://github.com/farion1231/cc-switch/pull/7255),修复 [#7254](https://github.com/farion1231/cc-switch/issues/7254)) 官方 MiniMax 与 MiniMax (en) 预设在七套预设文件里都默认 `MiniMax-M3`——Claude Code 声明 1M 上下文(`MiniMax-M3[1M]` 配官方的 `CLAUDE_CODE_AUTO_COMPACT_WINDOW=1000000`),Claude Desktop 启用 1M 支持,OpenClaw/OpenCode/Pi 元数据带 1,000,000 token 上下文、131,072 token 输出预算、图片输入与推理支持。过期的 Coding Plan 促销从所有预设与四语文案移除。存量配置与第三方默认值不变。 ### DouBaoSeed 预设改名火山豆包 七个应用预设文件里的显示名本地化:zh/zh-TW 为「火山 豆包AI」,en/ja 为「Volcengine Doubao」,沿用七牛/Compshare 的惯例——顶层名保留拉丁字母回退,中英文都能搜到。OpenCode 与 Pi 写进客户端配置文件的 `settingsConfig.name` 同步改名但保持 ASCII 形式(`Volcengine Doubao`)。Live 配置里的标识符刻意不动:Codex TOML 的 provider 名、Hermes 节点键 `doubao_seed`、Pi 的 provider 键、OpenClaw 的模型引用前缀、推广键与图标。 ### DeepSeek V4 家族按 V4.1 Flash 档调价 DeepSeek 已下线 V4 Flash,并宣布 2026-09-14 12:00(北京时间)起 V4 Pro 请求路由到 V4.1 Flash、按 Flash 价计费;本版提前执行这次回调。`deepseek-v4-flash`、`deepseek-v4-flash-0731` 与 `deepseek-v4-pro` 改为 $0.30/$1.20、缓存读 $0.006,修复条目只纠正仍是上一档高峰值的行,并链在 2026-08-16 的峰谷行之后,旧数据库会逐档跳到位。`deepseek-chat` 与 `deepseek-reasoner` 没有权威来源,保持不动。`deepseek-v4-pro` 同时退出纯文本确认表——它现在落在支持视觉的模型上,图片清洗对它 fail-open。 ### Claude「应用到所有角色」按表单顺序取值 把一个模型名一键抄到 Claude 模型映射所有角色的按钮,此前先取 `ANTHROPIC_MODEL`;现在按面板从上到下(Sonnet、Opus、Fable、Haiku、子智能体)读取,默认模型只作最后回退。 ### Atlas Cloud 不再是赞助商 赞助商身份从 README 四语赞助表、横幅、`isPartner`/`partnerPromotionKey` 标记与推广文案中移除;七个应用的预设本身保留,从赞助组移到非赞助组,端点、模型与图标不变。 --- ## 修复 ### 空 `reasoning_content` 占位符不再让 Claude Code 被空 Thought 块刷屏 部分 OpenAI 兼容上游(GLM、Qwen、经 ModelScope/DashScope 的 DeepSeek-V4-Pro、百炼、京东云……)在每个内容 chunk 里保留 `reasoning_content: ""` 占位,而不是省略字段。OpenAI Chat→Anthropic SSE 转换器的 reasoning 分支只判断字段是否存在,又与内容分支共享「当前打开块」的状态,于是每个内容 chunk 都先关掉打开的文本块、开一个空 thinking 块、再重开文本块——N 个内容 chunk 变成 2N 个内容块,一半是空 thinking 块,Claude Code 渲染成每个 token 一行、外加几十个空 Thought 块,会话 JSONL 也随之膨胀。空 reasoning 现在在进入分支前就被过滤,与内容分支和非流式转换器已有的守卫一致;两条回归测试钉住占位形态与真实推理两种情况下的块索引、类型与顺序。([#7227](https://github.com/farion1231/cc-switch/pull/7227),修复 [#5028](https://github.com/farion1231/cc-switch/issues/5028)、[#4404](https://github.com/farion1231/cc-switch/issues/4404);取代 [#4869](https://github.com/farion1231/cc-switch/pull/4869)、[#6421](https://github.com/farion1231/cc-switch/pull/6421)、[#6576](https://github.com/farion1231/cc-switch/pull/6576)) ### Codex 长任务不再在一句进度汇报后停在 Chat 上游 Codex Responses→Chat Completions 转换器在同一模型回合里遇到 commentary 消息紧跟 `function_call` 项时,输出两条连续的 assistant 消息;Chat 上游把只有文本的那条当作完整回合,在预期的工具调用之前就返回 `finish_reason=stop`。待处理的工具调用现在合并进紧邻的、尚无 `tool_calls` 的 assistant 消息,待处理的 reasoning 按段附加以免并行调用重复,其他边界形态(user/tool 边界、上一批工具调用、媒体刷出)仍走新消息路径;合并后没有 reasoning 的调用仍做占位回填。([#7280](https://github.com/farion1231/cc-switch/pull/7280),修复 [#6529](https://github.com/farion1231/cc-switch/issues/6529);取代 [#6530](https://github.com/farion1231/cc-switch/pull/6530)、[#5895](https://github.com/farion1231/cc-switch/pull/5895);[#5860](https://github.com/farion1231/cc-switch/issues/5860) 同报) ### Claude Desktop 的模型探针在 Responses 上游下不再失败 Responses API 拒收小于 16 的 `max_output_tokens`,而 Anthropic 客户端会合法地发很小的探针预算——Claude Desktop 的模型可用性探针用 `max_tokens=1`——Anthropic→Responses 转换原样复制这个值,严格的上游返回 400,Claude Desktop 在本地路由下把映射模型报为不可用。1 到 15 在转换时夹到 16;16 及以上、0 与非整数保持透传语义,正常会话请求逐字节不变,Codex OAuth 路径仍在之后剥掉 `max_output_tokens`。([#7287](https://github.com/farion1231/cc-switch/pull/7287),修复 [#7103](https://github.com/farion1231/cc-switch/issues/7103)) ### Codex 路由下的图片生成:贴完整端点、大小写后缀、流式用量 `/images/edits` 路由与 Images/Responses/Compact/Chat 共用的后缀表已随 v3.20.2 发货,本轮补上围绕它们的三处缺口。Base URL 被贴成完整的 `/chat/completions` 或 `/responses` 端点且「完整 URL」开关关闭时,Images 与 Alpha Search 的兄弟端点现在按 Chat 路径已有的容错同样推导,不再把独立请求发到 `…/chat/completions/images/generations`。后缀识别与兄弟改写大小写不敏感(`/v1/Images/Edits/`、`/v1/Responses/Compact/`),并保留原 URL 前缀、百分号编码与查询串。流式 Images 用量从 `image_generation.completed` 事件的顶层 `usage` 解析(跳过不带 usage 的 `partial_image` 事件),再回落到 Chat Completions 流解析器,流式生图不再记 0 token。([#7177](https://github.com/farion1231/cc-switch/pull/7177),接续 [#7036](https://github.com/farion1231/cc-switch/pull/7036)) ### 退出与端口分配不再覆盖每应用的代理设置 正常退出时,代理的恢复路径调用了旧的全局代理配置写入器去清早已退役的 `live_takeover_active` 标志;该写入器读 Claude 行、跑一条没有 WHERE 的 UPDATE,于是每次关机都把 Claude 的 `max_retries` 与三个超时字段抄到 Codex、Gemini、Grok Build 的行上——而这条 UPDATE 根本不带那个标志,这一步除了串写没有任何效果。临时监听端口的路径在每次代理启动时也做同样的事。死掉的写回已删除(live 配置恢复、备份清理与健康重置不变),解析出的临时端口改经只碰共享监听/日志列的全局配置接口持久化;两条回归测试给四个应用各自不同的设置,并断言两条路径都保住它们。([#7210](https://github.com/farion1231/cc-switch/pull/7210),修复 [#7204](https://github.com/farion1231/cc-switch/issues/7204)) ### 统一供应商同步保留子卡的设置与位置 同步统一供应商会重新生成它的 Claude/Codex/Gemini 子供应商。子卡的 `settings_config` 与现有行合并,但 `meta`、`created_at` 与 `sort_index` 取自生成的对象,而统一供应商从 UI 过来时从不带这些——UPDATE 把子卡的用量脚本、通用配置退出、端点自动选择等每应用设置抹成 `{}`、排序索引置 NULL,卡片像被删除重建一样掉到列表底部。存量子卡现在保留这三个字段;名称、Base URL、密钥、模型、网站与备注仍由统一供应商驱动,首次创建仍继承父级的元数据。([#7212](https://github.com/farion1231/cc-switch/pull/7212),修复 [#7134](https://github.com/farion1231/cc-switch/issues/7134)) ### 省略 `model_provider` 的 Codex 卡接管时尊重代理地址 Codex 卡的 TOML 没有 `model_provider` 时,Codex 回落到内置的 `openai` 供应商,而接管把代理地址写成 Codex 根本不读的顶层 `base_url`,请求绕过本地代理直连 `api.openai.com`。缺失的选择器现在视为内置 `openai` 供应商,代理地址写到 `openai_base_url`,既有的 legacy-reroute 迁移再把它变成带 `PROXY_MANAGED` bearer 的 `cc-switch` 自定义供应商表——与其他所有第三方接管同一形状。显式的供应商选择不变。([#7263](https://github.com/farion1231/cc-switch/pull/7263),修复 [#6256](https://github.com/farion1231/cc-switch/issues/6256),关联 [#7217](https://github.com/farion1231/cc-switch/issues/7217)) ### Codex 用量导入在 Windows 上识别正在增长的 rollout Codex 在整个会话期间保持 rollout 的追加句柄打开,Windows NTFS 上文件增长时 mtime 不动,纯 mtime 的门永远跳过正在增长的 rollout。观察到的字节长度现在存进已有的 `session_log_sync.last_byte_offset` 列(Codex 行),只有 mtime 与大小都不变时才跳过;解析器手动按换行拆记录,不完整的尾记录下一轮再试、不推进行游标。后续修复把不完整尾巴的字节也算作已观察:此前只把完整消费的记录计入持久化长度,末尾停在半条记录或空白的 rollout(崩溃且未 resume 的会话)永远显得比文件短、每次同步全量重解析——行游标仍停在不完整记录之前,文件一增长就重试,未变的文件按 mtime+size 门跳过。([#7219](https://github.com/farion1231/cc-switch/pull/7219),修复 [#6060](https://github.com/farion1231/cc-switch/issues/6060);另有一条后续提交) ### 托盘显示托管 Codex 卡所绑 ChatGPT 账号的额度 自 [#6537](https://github.com/farion1231/cc-switch/pull/6537) 起,托盘刻意去掉了绑定托管 ChatGPT 账号的 Codex 官方卡的用量后缀,因为它只有一个由 Codex CLI 当前登录(先 macOS Keychain、后 `auth.json`)喂的全应用订阅缓存,绑定多个账号后无法安全地表示按账号的额度;供应商卡片查的是绑定账号,但结果到不了托盘,有多个 ChatGPT 登录的用户只看到 `Codex · <名称>` 而没有额度。用量缓存新增按账号键的 Codex OAuth 快照表,额度查询写穿——传输错误保留上一份好快照,鉴权/HTTP 失败则替换它,托盘隐藏失效的额度而不是显示过期的——每次写入排定一次托盘刷新。刷新与显示共用一个 `TrayUsageSource` 判定:托管 Codex 卡只读绑定账号的快照(绝不回落到供应商级或 CLI 快照),未保存用量开关时默认开启(与供应商卡片一致),带绑定的固定官方卡也走托管路径。重绑立即切到新账号的快照,旧账号的迟到响应不会覆盖标签。(修复 [#7267](https://github.com/farion1231/cc-switch/issues/7267)) ### DeepSeek 的 Codex 目录镜像支持视觉的 `deepseek-flash` 内置的 DeepSeek 官方 Codex 目录刷新为厂商当前的 `models.json`(slug `deepseek-flash`、图片输入模态、`supports_image_detail_original`),`deepseek-v4-flash` 退出纯文本确认表:DeepSeek 仍接受这个旧 id 并把它路由到支持视觉的 V4.1 Flash,代理的媒体清洗与生成的 Codex 目录现在对它 fail-open,不再把图片替换成 `[Unsupported Image]`、也不再对 Codex 隐藏图片输入。([#7286](https://github.com/farion1231/cc-switch/pull/7286),修复 [#7283](https://github.com/farion1231/cc-switch/issues/7283)) ### 第三方 Token Plan 的 DeepSeek V4 行显式声明纯文本 官方端点把 `deepseek-v4-flash` 路由到视觉模型后,这个 id 到处 fail-open,但百度千帆与腾讯 Token Plan 仍托管纯文本的 V4 部署——千帆 Coding Plan 文档写明图片输入返回 400,腾讯 2026-09-10 的计划名单只列 V4。它们的 Codex 预设行(flash 与 pro 两族,含 `-0731`/`-0813`/`-202605`/`-202606`)现在显式声明 `inputModalities: ["text"]`,不再依赖注册表;预设测试同时锁定官方 DeepSeek 预设保持不声明(fail-open)。(接续 [#7283](https://github.com/farion1231/cc-switch/issues/7283)) --- ## 升级提醒 ### 本版不含数据库迁移 schema 版本保持 18。Codex 的字节游标复用已有的 `session_log_sync.last_byte_offset` 列。 ### 升级后 Codex rollout 会重新解析一次 Codex 行还没有存储的字节长度,第一轮同步会在所有平台重读每个 rollout(只耗 CPU;已导入的事件按行偏移跳过,不会重复计数)。之后的轮次跳过未变文件。 ### 已被覆盖的每应用代理设置不会自动恢复 [#7210](https://github.com/farion1231/cc-switch/pull/7210) 止住了串写,但无法找回此前关机从 Claude 抄到 Codex、Gemini、Grok Build 的重试/超时值——到代理设置里检查一次,把与你配置不符的改回来。 ### 统一同步从此保留子卡设置 此前同步已经抹掉的设置(用量脚本、通用配置退出、端点自动选择、排序位置)需要重填一次。 ### 没写 `model_provider` 的 Codex 卡接管时改走本地代理 [#7263](https://github.com/farion1231/cc-switch/pull/7263) 之后这类卡不再悄悄直连 `api.openai.com`,与其他第三方接管一致。 ### 预设改动只影响新建的供应商 存量卡片保存的是创建时的快照。本版涉及:Kimi 的两条 Codex 预设——存量 Kimi 卡仍是 `openai_chat`,经路由继续可用;要直连就把卡片的上游格式改为 Responses,或重新导入预设(注意 Kimi 开放平台 Tier 0 密钥限 3 次/分钟,跑不完一个多请求的工具循环);聚合平台的 Codex 目录;千问AI平台改名与 Qwen 3.8(含 Pi 的 QwenCloud Token Plan 协议切换);MiniMax M3 默认值;火山豆包的显示名;以及千帆/腾讯 Token Plan 上 DeepSeek 行的纯文本声明(这些预设上的存量卡仍靠遇错剥图重试,或重新导入预设)。 ### Codex catalog 类修复在下一次切换供应商时生效 catalog 文件在切换时重新生成:本版是 DeepSeek 官方目录的 `deepseek-flash` 视觉条目([#7286](https://github.com/farion1231/cc-switch/pull/7286))。在 DeepSeek 卡上切走再切回一次即可。 ### 定价 `deepseek-flash` 与 `deepseek-v4-flash-vision-exp` 是新 seed 行,启动时的回填会把这些 id 此前按 $0 记录的历史请求补上价格。`deepseek-v4-flash` / `-0731` / `-pro` 的修复只纠正仍是 seed 高峰档值(0.44/1.32/0.014 与 1.32/3.96/0.044)的行;自定义过的行不动,历史费用_不会_重算。V4 Pro 的调整先于 DeepSeek 2026-09-14 的切换落地,在此之前的 V4 Pro 请求按 Flash 价计费。`deepseek-chat` 与 `deepseek-reasoner` 保持原值。 ### Anthropic 客户端向 Responses 上游探测时 `max_tokens` 1–15 现在发 16 无需配置。 ### Chat 上游的 Codex 卡升级后会有一次前缀缓存未命中 [#7280](https://github.com/farion1231/cc-switch/pull/7280) 合并后的 commentary+工具调用消息让请求字节变了一次;之后形状逐轮稳定。 ### 托管 Codex 卡默认在托盘显示额度 未保存过用量开关时默认显示,与供应商卡片一致;关掉卡片的用量开关即可隐藏。 --- ## 风险提示 ### 沿用的提示 **xAI Grok OAuth 登录**:复用官方 Grok CLI 的公开 OAuth 客户端身份,使用可能导致账号被限制或封禁——详见 [v3.18.0 release notes](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/release-notes/v3.18.0-zh.md#风险提示)。 **Codex OAuth 反向代理**:使用 ChatGPT 订阅的 Codex OAuth 反代可能违反 OpenAI 服务条款,详情见 [v3.13.0 release notes](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/release-notes/v3.13.0-zh.md#️-风险提示)。 **SuperGrok 配额查询**:供应商卡片的配额展示依赖 grok.com 的非公开计费端点,xAI 调整接口后可能失效——详见 [v3.19.0 release notes](https://github.com/farion1231/cc-switch/blob/v3.20.3/docs/release-notes/v3.19.0-zh.md#风险提示)。 **第三方供应商路由**:通过 CC Switch 本地代理把 Codex、Claude Desktop 或 Grok Build 的请求转换并转发到第三方供应商时,各供应商对计费、合规与数据留存的约束不同,请在使用前阅读目标供应商的服务条款。 用户启用上述功能即表示自行承担相关风险。CC Switch 不对因使用这些功能而导致的任何账号限制、警告或服务暂停承担责任。 --- ## 致谢 本版 22 个提交里有 11 个来自 8 位外部贡献者。 ### 代码贡献 - 感谢 @gongzhenhu:空 `reasoning_content` 占位符的过滤([#7227](https://github.com/farion1231/cc-switch/pull/7227),修复 [#5028](https://github.com/farion1231/cc-switch/issues/5028)、[#4404](https://github.com/farion1231/cc-switch/issues/4404)),首次投稿;同一问题 @AdJIa([#4869](https://github.com/farion1231/cc-switch/pull/4869))、@U1traTC([#6421](https://github.com/farion1231/cc-switch/pull/6421))与 @Hypocrite000([#6576](https://github.com/farion1231/cc-switch/pull/6576))更早各自提出过修法。 - 感谢 @fszcd:Codex commentary 与工具调用的合并([#7280](https://github.com/farion1231/cc-switch/pull/7280),修复 [#6529](https://github.com/farion1231/cc-switch/issues/6529)),首次投稿;@BigStrongSun 自报该问题并在 [#6530](https://github.com/farion1231/cc-switch/pull/6530) 提交过修法,@xu-xiang 在 [#5895](https://github.com/farion1231/cc-switch/pull/5895) 也尝试过。 - 感谢 @SailingLoong:Claude Desktop 探针的 `max_tokens` 夹到 16([#7287](https://github.com/farion1231/cc-switch/pull/7287),修复 [#7103](https://github.com/farion1231/cc-switch/issues/7103))与 DeepSeek 视觉目录镜像([#7286](https://github.com/farion1231/cc-switch/pull/7286),修复 [#7283](https://github.com/farion1231/cc-switch/issues/7283));探针夹值这一问题 @John1Tang 更早在 [#7126](https://github.com/farion1231/cc-switch/pull/7126) 也提出过修法。 - 感谢 @Komikawayi:三条修复——退出串写每应用代理设置([#7210](https://github.com/farion1231/cc-switch/pull/7210),修复 [#7204](https://github.com/farion1231/cc-switch/issues/7204))、统一供应商同步保留子卡元数据([#7212](https://github.com/farion1231/cc-switch/pull/7212),修复 [#7134](https://github.com/farion1231/cc-switch/issues/7134))、Codex 缺 `model_provider` 时尊重代理地址([#7263](https://github.com/farion1231/cc-switch/pull/7263),修复 [#6256](https://github.com/farion1231/cc-switch/issues/6256))。 - 感谢 @woniuxiaoshu:Codex 用量的持久化字节游标([#7219](https://github.com/farion1231/cc-switch/pull/7219),修复 [#6060](https://github.com/farion1231/cc-switch/issues/6060)),首次投稿;同一问题 @LimiChan-2026([#6080](https://github.com/farion1231/cc-switch/pull/6080),同时是 #6060 的报告者)、@woshimaxfive([#6027](https://github.com/farion1231/cc-switch/pull/6027),同时在 [#6023](https://github.com/farion1231/cc-switch/issues/6023) 报告了 Windows 下的同一现象)与 @puppnn([#6246](https://github.com/farion1231/cc-switch/pull/6246))更早各自提出过修法。 - 感谢 @thisTom:Codex 图片生成的三处 follow-up([#7177](https://github.com/farion1231/cc-switch/pull/7177)),接续他自己的 [#7036](https://github.com/farion1231/cc-switch/pull/7036)。 - 感谢 @shigzz:千问AI平台改名与 Qwen 3.8 刷新([#7183](https://github.com/farion1231/cc-switch/pull/7183)),首次投稿。 - 感谢 @jellyjelly814:MiniMax M3 默认值与过期优惠清理([#7255](https://github.com/farion1231/cc-switch/pull/7255)),自报自修 [#7254](https://github.com/farion1231/cc-switch/issues/7254),首次投稿;M3 默认值的升级 @octo-patch 更早在 [#3567](https://github.com/farion1231/cc-switch/pull/3567) 提出过,M3 定价与模态在 [#6396](https://github.com/farion1231/cc-switch/pull/6396)。 ### 问题反馈 - 感谢 @Sunshine-SACA 与 @snowing0427 报告空 thinking 块刷屏与内容块碎片化([#5028](https://github.com/farion1231/cc-switch/issues/5028)、[#4404](https://github.com/farion1231/cc-switch/issues/4404)),以及在 #4404 补充 v3.20.0 上 ModelScope Qwen3-Coder 复现的 @csj-ccc。 - 感谢 @BigStrongSun 与 @aducker2016 报告 Responses→Chat 转换拆分 assistant 回合([#6529](https://github.com/farion1231/cc-switch/issues/6529)、[#5860](https://github.com/farion1231/cc-switch/issues/5860))——后者定位到了 DeepSeek 无限复读的同一根因。 - 感谢 @haoyubai212 报告 Claude Desktop 探针在 Responses 上游下 400([#7103](https://github.com/farion1231/cc-switch/issues/7103))。 - 感谢 @HEYUESAMA 报告 DeepSeek 图片被替换为 `[Unsupported Image]`、目录声明纯文本([#7283](https://github.com/farion1231/cc-switch/issues/7283))。 - 感谢 @Jason-purse 报告重启后 Codex 的 failover 设置被 Claude 的覆盖([#7204](https://github.com/farion1231/cc-switch/issues/7204))。 - 感谢 @auqhjjqdo 报告统一供应商同步让用量查询等配置失效([#7134](https://github.com/farion1231/cc-switch/issues/7134))。 - 感谢 @pemagic 报告 Codex 直连 `api.openai.com` 绕过本地路由([#6256](https://github.com/farion1231/cc-switch/issues/6256)),以及 @Tiacoo 在 [#7217](https://github.com/farion1231/cc-switch/issues/7217) 记录同一现象在 Codex 0.153.x 上的表现。 - 感谢 @LimiChan-2026 与 @MoEternal 报告 Windows 上 Codex 用量漏采([#6060](https://github.com/farion1231/cc-switch/issues/6060)、[#7264](https://github.com/farion1231/cc-switch/issues/7264))。 - 感谢 @ringzxw 报告绑定多个 ChatGPT 账号时托盘不显示额度([#7267](https://github.com/farion1231/cc-switch/issues/7267))。 --- ## 下载与安装 访问 [Releases](https://github.com/farion1231/cc-switch/releases/latest) 下载对应版本,或从官网 [ccswitch.io](https://ccswitch.io) 获取(下载经 Cloudflare 边缘节点分发,不依赖 GitHub 可达)。 ### 系统要求 | 系统 | 最低版本 | 架构 | | ------- | -------------------------- | ----------------------------------- | | Windows | Windows 10 及以上 | x64 / ARM64 | | macOS | macOS 12 (Monterey) 及以上 | Intel (x64) / Apple Silicon (arm64) | | Linux | 见下表 | x64 / ARM64 | ### Windows | 文件 | 说明 | | ---------------------------------------- | ----------------------------------- | | `CC-Switch-v3.20.3-Windows.msi` | **推荐** - MSI 安装包,支持自动更新 | | `CC-Switch-v3.20.3-Windows-Portable.zip` | 便携版,解压即用,不写入注册表 | Windows ARM64 设备请选择文件名中带 `arm64` 标识的对应制品。 ### macOS | 文件 | 说明 | | -------------------------------- | --------------------------------------------- | | `CC-Switch-v3.20.3-macOS.dmg` | **推荐** - DMG 安装包,拖入 Applications 即可 | | `CC-Switch-v3.20.3-macOS.zip` | 解压后拖入 Applications,Universal Binary | | `CC-Switch-v3.20.3-macOS.tar.gz` | 用于 Homebrew 安装和自动更新 | Homebrew 安装: ```bash brew install --cask cc-switch ``` 更新: ```bash brew upgrade --cask cc-switch ``` ### Linux Linux 资产同时提供 **x86_64** 和 **ARM64**(`aarch64`)两种架构。资产文件名中包含架构标识,请按你机器的 `uname -m` 输出选择对应版本: - `CC-Switch-v3.20.3-Linux-x86_64.AppImage` / `.deb` / `.rpm` - `CC-Switch-v3.20.3-Linux-arm64.AppImage` / `.deb` / `.rpm` | 发行版 | 推荐格式 | 安装方式 | | --------------------------------------- | ----------- | ---------------------------------------------------------------------- | | Ubuntu / Debian / Linux Mint / Pop!\_OS | `.deb` | `sudo dpkg -i CC-Switch-*.deb` 或 `sudo apt install ./CC-Switch-*.deb` | | Fedora / RHEL / CentOS / Rocky Linux | `.rpm` | `sudo rpm -i CC-Switch-*.rpm` 或 `sudo dnf install ./CC-Switch-*.rpm` | | openSUSE | `.rpm` | `sudo zypper install ./CC-Switch-*.rpm` | | Arch Linux / Manjaro | `.AppImage` | 添加执行权限后直接运行,或使用 AUR | | 其他发行版 / 不确定 | `.AppImage` | `chmod +x CC-Switch-*.AppImage && ./CC-Switch-*.AppImage` |
▸ 主项目介绍 · 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