codex+deepseek

如果直接在codex上使用deepseek, 会提示如下内容:

› who are you?


⚠ Falling back from WebSockets to HTTPS transport. unexpected status 401 Unauthorized: Incorrect API key provided: sk-a5aa7***********************b241. You can
  find your API key at https://platform.openai.com/account/api-keys., url: wss://api.openai.com/v1/responses, cf-ray: a12320b11b44d756-NRT, auth error: 401,
  auth error code: invalid_api_key

■ unexpected status 401 Unauthorized: Incorrect API key provided: sk-a5aa7***********************b241. You can find your API key at
https://platform.openai.com/account/api-keys., url: https://api.openai.com/v1/responses, cf-ray: a12320eadddbd75a-NRT, auth error: 401, auth error code:
invalid_api_key

网上已经有很多解释,就是codex和deepseek使用的api接口不兼容所致,所以需要找一个翻译,让它来翻译翻译——把deepseek的api翻译成codex可以识别的api.

我选择ccswtich

  1. 打开cc-switch
  2. 在顶栏点击OpenAI图表后再点击右上角+
  3. 添加deepseek, 填入api-key即可

注意,在Linux下,配置cc-switch和使用codex的应该是同一账户。

Last updated on