@@ -56,11 +56,10 @@ test ! -f ~/.codex/config.toml || \
5656cp ~ /codex-settings/config.toml ~ /.codex/config.toml
5757```
5858
59- 如需保留其他模型提供商和 LiteLLM 示例,一并复制:
59+ 如需保留其他模型提供商的 Profiles 和 LiteLLM 示例,一并复制:
6060
6161``` bash
62- mkdir -p ~ /.codex/configs
63- cp -R ~ /codex-settings/configs/. ~ /.codex/configs/
62+ cp ~ /codex-settings/* .config.toml ~ /.codex/
6463cp ~ /codex-settings/litellm_config.yaml ~ /.codex/litellm_config.yaml
6564```
6665
@@ -112,12 +111,6 @@ LiteLLM 使用 [litellm_config.yaml](litellm_config.yaml),默认监听 `http:/
112111python3 -m pip install -U ' litellm[proxy]'
113112```
114113
115- 将 Codex 切换到对应配置:
116-
117- ``` bash
118- cp ~ /.codex/configs/github-copilot.toml ~ /.codex/config.toml
119- ```
120-
121114在一个终端中启动 LiteLLM:
122115
123116``` bash
@@ -129,7 +122,7 @@ litellm --config ~/.codex/litellm_config.yaml
129122``` bash
130123codex doctor --summary
131124codex mcp list
132- codex
125+ codex --profile github-copilot
133126```
134127
135128这种方式由 LiteLLM 和它所连接的 GitHub Copilot 提供商处理上游认证,不需要运行 ` codex login ` 。
@@ -139,19 +132,13 @@ codex
139132<details >
140133<summary ><strong >使用 ChatGPT</strong ></summary >
141134
142- 将 Codex 切换到 ChatGPT 配置:
143-
144- ``` bash
145- cp ~ /.codex/configs/chatgpt.toml ~ /.codex/config.toml
146- ```
147-
148135登录 ChatGPT 账号并启动 Codex:
149136
150137``` bash
151138codex login
152139codex doctor --summary
153140codex mcp list
154- codex
141+ codex --profile chatgpt
155142```
156143
157144这种方式直接使用 Codex 的 ChatGPT 登录状态,不需要启动本地代理或网关。
@@ -163,7 +150,7 @@ codex
163150``` text
164151.
165152├── config.toml # 默认配置:本地 copilot-gateway
166- ├── configs/ # 其他模型提供商配置
153+ ├── *.config.toml # 可叠加到主配置的模型提供商 Profiles
167154├── litellm_config.yaml # GitHub Copilot/LiteLLM 示例
168155├── skills/ # Codex Skills 及其脚本和参考资料
169156├── prompts/ # 历史 Custom Prompts
@@ -177,7 +164,7 @@ codex
177164
178165根目录的 [ config.toml] ( config.toml ) 当前使用:
179166
180- - 模型:` gpt-5.5 `
167+ - 模型:` gpt-5.6-sol `
181168- 模型提供商:` github `
182169- 本地网关:` http://localhost:4141 `
183170- Web Search:` live `
@@ -199,10 +186,10 @@ network_access = false
199186
200187| 文件 | 适用场景 | 使用前需要做什么 |
201188| --- | --- | --- |
202- | [ configs/ chatgpt.toml] ( configs/ chatgpt.toml) | 使用 OpenAI/ChatGPT 账号 | 运行 ` codex login ` ,并确认配置中的模型仍对当前账号开放 |
203- | [ configs/ azure.toml] ( configs/ azure.toml) | Azure OpenAI | 填写实例地址和 API Key,确认部署名称与接口兼容性 |
204- | [ configs/ github-copilot.toml] ( configs/ github-copilot.toml) | 通过 LiteLLM 使用 GitHub Copilot | 先启动 ` litellm_config.yaml ` ,再检查账号可用模型 |
205- | [ configs/ openrouter.toml] ( configs/ openrouter.toml) | OpenRouter | 填写 API Key,并确认目标模型支持当前调用方式 |
189+ | [ chatgpt.config. toml] ( chatgpt.config. toml ) | 使用 OpenAI/ChatGPT 账号 | 运行 ` codex login ` ,再使用 ` codex --profile chatgpt ` |
190+ | [ azure.config. toml] ( azure.config. toml ) | Azure OpenAI | 填写项目地址,设置 ` AZURE_OPENAI_API_KEY ` ,再使用 ` codex --profile azure ` |
191+ | [ github-copilot.config. toml] ( github-copilot.config. toml ) | 通过 LiteLLM 使用 GitHub Copilot | 先启动 ` litellm_config.yaml ` ,再使用 ` codex --profile github-copilot ` |
192+ | [ openrouter.config. toml] ( openrouter.config. toml ) | OpenRouter | 设置 ` OPENROUTER_API_KEY ` ,再使用 ` codex --profile openrouter ` |
206193
207194模型名称和功能开关会随 Codex 与上游服务更新。遇到无法识别的配置项时,可以运行:
208195
@@ -219,11 +206,13 @@ codex doctor --summary
219206~/.codex/<name>.config.toml
220207```
221208
222- 例如,` codex --profile work ` 会在基础配置之上叠加 ` ~/.codex/work .config.toml ` 。Profile 不会自动清除基础配置中的模型提供商、权限或 MCP 设置,使用前要检查继承结果 。
209+ 例如,` codex --profile chatgpt ` 会在基础配置之上叠加 ` ~/.codex/chatgpt .config.toml ` 。本仓库的 Profile 文件只覆盖模型、模型提供商和认证信息;权限、Features、 MCP、TUI 等共享设置继续由 ` config.toml ` 提供 。
223210
224211### LiteLLM
225212
226- [ litellm_config.yaml] ( litellm_config.yaml ) 与 [ configs/github-copilot.toml] ( configs/github-copilot.toml ) 配套,默认监听 ` http://localhost:4000 ` 。它和根目录配置使用的 ` localhost:4141 ` 不是同一个网关。
213+ 当前 Codex 自定义模型提供商只接受 ` wire_api = "responses" ` 。LiteLLM 可以作为兼容层,将 GitHub Copilot 等第三方模型提供商的 Chat Completions 等接口封装为 Responses API,从而供 Codex 使用。
214+
215+ [ litellm_config.yaml] ( litellm_config.yaml ) 与 [ github-copilot.config.toml] ( github-copilot.config.toml ) 配套,默认监听 ` http://localhost:4000 ` 。它和根目录配置使用的 ` localhost:4141 ` 不是同一个网关。
227216
228217``` bash
229218python3 -m pip install -U ' litellm[proxy]'
@@ -329,6 +318,7 @@ codex mcp list
329318
330319- [ Codex CLI 官方文档] ( https://developers.openai.com/codex/cli/ )
331320- [ Codex 配置说明] ( https://developers.openai.com/codex/config-basic )
321+ - [ Codex 配置参考] ( https://developers.openai.com/codex/config-reference )
332322- [ Codex Skills] ( https://developers.openai.com/codex/skills )
333323- [ Codex Rules] ( https://developers.openai.com/codex/rules )
334324- [ Codex GitHub 仓库] ( https://github.com/openai/codex )
0 commit comments