【已解决】求助,我的CODEX CLI现在不读配置config.toml文件里面的中转站信息

2026-04-11 08:201阅读0评论SEO资讯
  • 内容介绍
  • 文章标签
  • 相关推荐
问题描述:

我想死了,我的CODEX CLI现在不读配置config.toml文件里面的中转站信息,直接去读官网的,有谁遇到过这种问题? 昨天装了个Quotio后配置没弄好,就没管;然后今天就出了问题,我把Quotio和CC SWITCH重装也没用,我回退了CODEX上个版本(0.115.0)也没用,按AI的建议去找查相关的文件也没有查看到,查看了~/.zshrc 也没有codex相关的内容,在~/.codex 目录下也没有.env文件;
不过我没有把.CODEX目录删除,各位佬友有遇到过吗?

【0322-01:47】 补充环境变量和.codex的配置
我按佬友们的建议,把.codex目录下的auth.json内的KEN清空,放到config.htoml中,但是问题依旧存在。
QQ20260322-0123422082×712 211 KB
QQ20260322-0144481212×624 55 KB
QQ20260322-0146091788×1510 451 KB

【0322-13:30】 完全卸载codex后的再次尝试
找不到问题所在,我尝试完全删除 codex cli,.codex目录也删除了;
然后通过npm install -g @openai/codex@0.110.0来重装codex cli,我把auth.json、config.toml文件再复制回新的.codex目录下,但是还是出现 认证跑到官方的API去,真是怪事了。

QQ20260322-1414021526×890 117 KB
QQ20260322-1415121794×842 255 KB

【0322-14:40】 使用opencode后能调用中转站了
我尝试在opencode里面配置这个中转站信息,能正常调用中转站的套餐了,但是失去了CLI的便利性了(能在任意的目录中直接调用CODEX)

【0322-21:10】 问题解决的办法
在尝试使用了opencode的卡顿之后,刚好看到佬友的一个建议,然后使用CC SWITCH v3.10.2 重新新建一个供应商,然后,问题解决了。唉,有时候问题的解决就是这么简单,下面是新旧参考。

这个事给我的教训就是 能用就不要乱升级。

能用的新建中转商配置- KEY写在了auth.json中

model_provider = "中转商名称" model = "gpt-5.2" model_reasoning_effort = "high" disable_response_storage = true [model_providers.中转商名称] name = "中转商名称" base_url = "https://中转商名称/codex/v1" wire_api = "responses" requires_openai_auth = true model_reasoning_effort = "high" disable_response_storage = true

而之前不能用的供应商配置

model = "gpt-5.4" base_url = "https://中转商名称/v1" model_reasoning_effort = "high" disable_response_storage = true [model_providers] [model_providers.中转商名称] name = "中转商名称" base_url = "https://中转商名称/codex/v1" wire_api = "responses" experimental_bearer_token = "中转商KEY" requires_openai_auth = true 网友解答:


--【壹】--:

我这个问题也是出现得莫名其妙的,不太能理解,按道理不应该被篡改,再不行我明天把CODEX目录都清空。


--【贰】--: YUAN JIANG:

model_provider

有呀,请看我上面贴的,第一行就是。


--【叁】--:

发下配置文件和~/.bashrc 后20行看看


--【肆】--:

请看补充的截图。


--【伍】--:

我使用了上面佬友的那个配置,里面没有这个参数的,也不行。


--【陆】--:

model_provider = “cliproxyapi”
你的这个好像没有带上


--【柒】--:

这个配置之前正常运行过?
把整个配置内容去敏后用代码块贴出来(按照下面的格式,删掉左右括号)
(```)

内容

(```)


--【捌】--: 是人类:

export Rightcode_KEY="这个中转站的key"

尝试了,还是不行,提示“ Missing environment variable”
QQ20260322-1919291920×653 135 KB


--【玖】--:

我最近装codex就只配置config.toml第三方,没有出现这种情况


--【拾】--:

清掉其他设置

/home/debian/.codex/auth.json

{ "OPENAI_API_KEY": "" }

/home/debian/.codex/config.toml

model_provider = "cliproxyapi" [model_providers.cliproxyapi] base_url = "https://???/v1" experimental_bearer_token = "???" name = "OpenAI" requires_openai_auth = true wire_api = "responses"


--【拾壹】--:

配置文件被搞乱了,按照下面步骤重新做

1.首先把auth.json删了,不是清空,直接删了就好
2.添加 key环境变量,写在~/.zshrc

export Rightcode_KEY="这个中转站的key"

3.用下面的内容覆盖config.htoml

model_provider = "rightcode" model = "gpt-5.4" model_reasoning_effort = "xhigh" network_access = "enabled" disable_response_storage = true model_verbosity = "high" [model_providers.rightcode] name = "rightcode" base_url = "https://right.codes/codex/v1" wire_api = "responses" env_key = "Rightcode_KEY" [projects] [projects."/Users/hhhhh/08.DEV/01.python/20250820_TACE"] trust_level = "trusted" [projects."/Users/hhhhh/.openclaw"] trust_level = "trusted" [projects."/Users/hhhhh/.nanobot"] trust_level = "trusted" [projects."/Users/hhhhh/08.DEV/zeroclaw"] trust_level = "trusted" [mcp_servers] [mcp_servers.playwright] type = "stdio" command = "npx" args = ["-y", "@playwright/mcp@latest", "--extension"] [mcp_servers.playwright.env] PLAYWRIGHT_MCP_EXTENSION_TOKEN = "" [mcp_servers.project_rules] type = "stdio" command = "python" args = ["/Users/hhhh/.codex/mcp-servers/project_rules/server.py"] [notice] [notice.model_migrations] "gpt-5.3-codex" = "gpt-5.4"

4.开新终端重新启动codex

codex


--【拾贰】--:

之前是一直正常能运行的

model = "gpt-5.4" base_url = "https://www.right.codes/v1" model_reasoning_effort = "high" disable_response_storage = true [model_providers] [model_providers.rightcode] name = "rightcode" base_url = "https://right.codes/codex/v1" wire_api = "responses" experimental_bearer_token = "hhhhh" requires_openai_auth = true [projects] [projects."/Users/hhhhh/08.DEV/01.python/20250820_TACE"] trust_level = "trusted" [projects."/Users/hhhhh/.openclaw"] trust_level = "trusted" [projects."/Users/hhhhh/.nanobot"] trust_level = "trusted" [projects."/Users/hhhhh/08.DEV/zeroclaw"] trust_level = "trusted" [mcp_servers] [mcp_servers.playwright] type = "stdio" command = "npx" args = ["-y", "@playwright/mcp@latest", "--extension"] [mcp_servers.playwright.env] PLAYWRIGHT_MCP_EXTENSION_TOKEN = "" [mcp_servers.project_rules] type = "stdio" command = "python" args = ["/Users/hhhh/.codex/mcp-servers/project_rules/server.py"] [notice] [notice.model_migrations] "gpt-5.3-codex" = "gpt-5.4"


--【拾叁】--:

尝试了,也不行。


--【拾肆】--:

我没有使用CliproxyAPI,直接用的是CC SWITCH的,就是莫名其妙的坏了。


--【拾伍】--:

看看是否有配置环境变量。


--【拾陆】--: 船长:

我按佬友们的建议,把.codex目录下的auth.json内的KEN清空,放到config.htoml中,但是问题依旧存在。

我看过,环境变量中没有相关内容。


--【拾柒】--:

我的意思是这个字段 model_provider


--【拾捌】--:

他的太复杂了,还要 export Rightcode_KEY,用回 CC Switch 的就行

我建议你直接在 CC Switch 重新创建一个 Provider 配置,启用新的


--【拾玖】--:

去掉 requires_openai_auth = true

问题描述:

我想死了,我的CODEX CLI现在不读配置config.toml文件里面的中转站信息,直接去读官网的,有谁遇到过这种问题? 昨天装了个Quotio后配置没弄好,就没管;然后今天就出了问题,我把Quotio和CC SWITCH重装也没用,我回退了CODEX上个版本(0.115.0)也没用,按AI的建议去找查相关的文件也没有查看到,查看了~/.zshrc 也没有codex相关的内容,在~/.codex 目录下也没有.env文件;
不过我没有把.CODEX目录删除,各位佬友有遇到过吗?

【0322-01:47】 补充环境变量和.codex的配置
我按佬友们的建议,把.codex目录下的auth.json内的KEN清空,放到config.htoml中,但是问题依旧存在。
QQ20260322-0123422082×712 211 KB
QQ20260322-0144481212×624 55 KB
QQ20260322-0146091788×1510 451 KB

【0322-13:30】 完全卸载codex后的再次尝试
找不到问题所在,我尝试完全删除 codex cli,.codex目录也删除了;
然后通过npm install -g @openai/codex@0.110.0来重装codex cli,我把auth.json、config.toml文件再复制回新的.codex目录下,但是还是出现 认证跑到官方的API去,真是怪事了。

QQ20260322-1414021526×890 117 KB
QQ20260322-1415121794×842 255 KB

【0322-14:40】 使用opencode后能调用中转站了
我尝试在opencode里面配置这个中转站信息,能正常调用中转站的套餐了,但是失去了CLI的便利性了(能在任意的目录中直接调用CODEX)

【0322-21:10】 问题解决的办法
在尝试使用了opencode的卡顿之后,刚好看到佬友的一个建议,然后使用CC SWITCH v3.10.2 重新新建一个供应商,然后,问题解决了。唉,有时候问题的解决就是这么简单,下面是新旧参考。

这个事给我的教训就是 能用就不要乱升级。

能用的新建中转商配置- KEY写在了auth.json中

model_provider = "中转商名称" model = "gpt-5.2" model_reasoning_effort = "high" disable_response_storage = true [model_providers.中转商名称] name = "中转商名称" base_url = "https://中转商名称/codex/v1" wire_api = "responses" requires_openai_auth = true model_reasoning_effort = "high" disable_response_storage = true

而之前不能用的供应商配置

model = "gpt-5.4" base_url = "https://中转商名称/v1" model_reasoning_effort = "high" disable_response_storage = true [model_providers] [model_providers.中转商名称] name = "中转商名称" base_url = "https://中转商名称/codex/v1" wire_api = "responses" experimental_bearer_token = "中转商KEY" requires_openai_auth = true 网友解答:


--【壹】--:

我这个问题也是出现得莫名其妙的,不太能理解,按道理不应该被篡改,再不行我明天把CODEX目录都清空。


--【贰】--: YUAN JIANG:

model_provider

有呀,请看我上面贴的,第一行就是。


--【叁】--:

发下配置文件和~/.bashrc 后20行看看


--【肆】--:

请看补充的截图。


--【伍】--:

我使用了上面佬友的那个配置,里面没有这个参数的,也不行。


--【陆】--:

model_provider = “cliproxyapi”
你的这个好像没有带上


--【柒】--:

这个配置之前正常运行过?
把整个配置内容去敏后用代码块贴出来(按照下面的格式,删掉左右括号)
(```)

内容

(```)


--【捌】--: 是人类:

export Rightcode_KEY="这个中转站的key"

尝试了,还是不行,提示“ Missing environment variable”
QQ20260322-1919291920×653 135 KB


--【玖】--:

我最近装codex就只配置config.toml第三方,没有出现这种情况


--【拾】--:

清掉其他设置

/home/debian/.codex/auth.json

{ "OPENAI_API_KEY": "" }

/home/debian/.codex/config.toml

model_provider = "cliproxyapi" [model_providers.cliproxyapi] base_url = "https://???/v1" experimental_bearer_token = "???" name = "OpenAI" requires_openai_auth = true wire_api = "responses"


--【拾壹】--:

配置文件被搞乱了,按照下面步骤重新做

1.首先把auth.json删了,不是清空,直接删了就好
2.添加 key环境变量,写在~/.zshrc

export Rightcode_KEY="这个中转站的key"

3.用下面的内容覆盖config.htoml

model_provider = "rightcode" model = "gpt-5.4" model_reasoning_effort = "xhigh" network_access = "enabled" disable_response_storage = true model_verbosity = "high" [model_providers.rightcode] name = "rightcode" base_url = "https://right.codes/codex/v1" wire_api = "responses" env_key = "Rightcode_KEY" [projects] [projects."/Users/hhhhh/08.DEV/01.python/20250820_TACE"] trust_level = "trusted" [projects."/Users/hhhhh/.openclaw"] trust_level = "trusted" [projects."/Users/hhhhh/.nanobot"] trust_level = "trusted" [projects."/Users/hhhhh/08.DEV/zeroclaw"] trust_level = "trusted" [mcp_servers] [mcp_servers.playwright] type = "stdio" command = "npx" args = ["-y", "@playwright/mcp@latest", "--extension"] [mcp_servers.playwright.env] PLAYWRIGHT_MCP_EXTENSION_TOKEN = "" [mcp_servers.project_rules] type = "stdio" command = "python" args = ["/Users/hhhh/.codex/mcp-servers/project_rules/server.py"] [notice] [notice.model_migrations] "gpt-5.3-codex" = "gpt-5.4"

4.开新终端重新启动codex

codex


--【拾贰】--:

之前是一直正常能运行的

model = "gpt-5.4" base_url = "https://www.right.codes/v1" model_reasoning_effort = "high" disable_response_storage = true [model_providers] [model_providers.rightcode] name = "rightcode" base_url = "https://right.codes/codex/v1" wire_api = "responses" experimental_bearer_token = "hhhhh" requires_openai_auth = true [projects] [projects."/Users/hhhhh/08.DEV/01.python/20250820_TACE"] trust_level = "trusted" [projects."/Users/hhhhh/.openclaw"] trust_level = "trusted" [projects."/Users/hhhhh/.nanobot"] trust_level = "trusted" [projects."/Users/hhhhh/08.DEV/zeroclaw"] trust_level = "trusted" [mcp_servers] [mcp_servers.playwright] type = "stdio" command = "npx" args = ["-y", "@playwright/mcp@latest", "--extension"] [mcp_servers.playwright.env] PLAYWRIGHT_MCP_EXTENSION_TOKEN = "" [mcp_servers.project_rules] type = "stdio" command = "python" args = ["/Users/hhhh/.codex/mcp-servers/project_rules/server.py"] [notice] [notice.model_migrations] "gpt-5.3-codex" = "gpt-5.4"


--【拾叁】--:

尝试了,也不行。


--【拾肆】--:

我没有使用CliproxyAPI,直接用的是CC SWITCH的,就是莫名其妙的坏了。


--【拾伍】--:

看看是否有配置环境变量。


--【拾陆】--: 船长:

我按佬友们的建议,把.codex目录下的auth.json内的KEN清空,放到config.htoml中,但是问题依旧存在。

我看过,环境变量中没有相关内容。


--【拾柒】--:

我的意思是这个字段 model_provider


--【拾捌】--:

他的太复杂了,还要 export Rightcode_KEY,用回 CC Switch 的就行

我建议你直接在 CC Switch 重新创建一个 Provider 配置,启用新的


--【拾玖】--:

去掉 requires_openai_auth = true