适配版本:Codex 0.158.0
api地址:`https://api.new.bi/v1
协议:OpenAI Responses API( wire_api="responses")
codex专属 或者 defaultwsl-codex)sk-xxxx 密钥,妥善保存。C:\Users\你的用户名\.codex~/.codexWindows 提示:需要开启【显示隐藏的项目】才能看到 .codex文件夹;不存在则手动新建。
文件清单: config.toml:主配置文件auth.json:密钥存储文件(仅【方案1】需要)
auth.json,不和业务配置混在一起,符合官方文档规范;搭配 preferred_auth_method = "apikey"。注意:此方案 requires_openai_auth = true,Codex 会读取同目录下auth.json。
# 全局基础配置
model_provider = "custom"
model = "gpt-6.1-sol"
review_model = "gpt-6.1-sol"
model_reasoning_effort = "high"
preferred_auth_method = "apikey"
# 自定义网关提供商配置
[model_providers.custom]
name = "newbi"
base_url = "[https://api.new.bi/v1](https://api.new.bi/v1)"
wire_api = "responses"
requires_openai_auth = true
supports_websockets = false
# 功能开关
[features]
goals = true
# TUI终端界面配置
[tui]
screen_reader_detection_done = true
# 模型自动迁移映射
[notice.model_migrations]
"gpt-6.1-sol" = "gpt-6.1-sol"
{"OPENAI_API_KEY": "sk-替换成你自己的密钥"}不推荐:直接 codex(默认拉起daemon,0.158.0 在WSL极易出现socket创建失败、鉴权缓存异常)
config.toml,不再读取 auth.json、不再读取环境变量,专门用来绕过环境变量读取失败、auth.json 读取异常、401 调试场景。⚠️ 风险警告:密钥明文写在配置文件,禁止上传到Git、代码仓库,仅本地调试使用。
注意:此方案requires_openai_auth = false,和方案1不能混用。
# 全局基础配置
model_provider = "custom"
model = "gpt-6.1-sol"
review_model = "gpt-6.1-sol"
model_reasoning_effort = "high"
preferred_auth_method = "apikey"
# 自定义网关提供商配置
[model_providers.custom]
name = "newbi"
base_url = "[https://api.new.bi/v1](https://api.new.bi/v1)"
wire_api = "responses"
requires_openai_auth = false
supports_websockets = false
experimental_bearer_token = "sk-替换成你自己的密钥"
# 功能开关
[features]
goals = true
# TUI终端界面配置
[tui]
screen_reader_detection_done = true
# 模型自动迁移映射
[notice.model_migrations]
"gpt-6.1-sol" = "gpt-6.1-sol"
Codex 并安装官方插件.codex/config.toml 配置,无需额外配置注意:WSL 内使用 VSCode Remote 模式时,插件读取的是 WSL 内部 ~/.codex的配置,不是 Windows 宿主目录。
| 参数 | 说明 |
|---|---|
model | 主模型,当前 gpt-6.1-sol |
review_model | 代码评审模型,和主模型保持一致 |
model_reasoning_effort | 推理强度:high / medium / low,复杂编码推荐 high |
preferred_auth_method = "apikey" | 使用 apikey 鉴权模式,适配 new.bi 网关 |
base_url | 中转网关地址 |
wire_api = "responses" | 使用 OpenAI 新版 Responses API,网关必须支持该接口 |
requires_openai_auth | true=使用auth.json;false=使用experimental_bearer_token |
supports_websockets = false | 关闭websocket,适配new.bi网关 |
goals = true | 开启Agent多步骤规划能力,Coding Agent必备 |
trust_level = "trusted" | 信任目录,允许Codex读写文件、执行命令 |
Missing environment variable: OPENAI_API_KEYcodex --no-daemon 前台启动;或者切换方案2app server did not become ready ... sock--no-daemon 启动requires_openai_auth 状态,不要混用两套鉴权/v1/responses 接口disable_response_storage / network_access / windows_wsl_setup_acknowledged 被忽略auth.json 和 experimental_bearer_token,如果方案一没办法调试成功,可以使用方案2--no-daemon,是该版本最稳定运行方式