codex 使用 cc-switch 管理统一模型的时候,如何使用的中转站不是 codex 默认里面的gpt 模型,那么需要进行模型重定向到真实的模型地址,而中转站一般是支持默认/v1/chat/completions/v1/responses 接口协议,在 cc-switch 中不做任何配置的情况下,即便你有 gpt 的模型也无法正常使用,会存在下面的报错:

◦ Reconnecting... 1/5 (6s • esc to interrupt)
  └ We're currently experiencing high demand, which may cause temporary errors.

一开始以为是哪里没配置对,还尝试进行强制重定向到默认的即可模型,我这里使用的 minimax-m3。

只需要在 cc-switch 中做下简单的配置即可实现。

解决 Codex 使用 cc-switch 使用第三方模型报错 We're currently experiencing high demand, which may cause temporary errors.

如何需要本地模型映射就是 codex desktop 中能够选择的话那么你可以勾选本地路由映射。然后再下方写映射规则。

最后需要注意的是最后是需要把本地路由打开,如果还存在问题可以看下 codex 默认请求的模型是什么,在cc-switch 保存过后一定要重新启动 codex,不然这里可能因为缓存原因导致你一致没生效。

解决 Codex 使用 cc-switch 使用第三方模型报错 We're currently experiencing high demand, which may cause temporary errors.

最后你就可以使用任意第三方的 API 接入到 codex 中了。

codex-desktop上验证:

解决 Codex 使用 cc-switch 使用第三方模型报错 We're currently experiencing high demand, which may cause temporary errors.

codex-cli 也一样切换成功。

解决 Codex 使用 cc-switch 使用第三方模型报错 We're currently experiencing high demand, which may cause temporary errors.