Codex 手动配置
通过编辑 config.toml 与 auth.json 把 Codex 接到天枢。
前置:已完成 环境检查与安装,
codex能正常运行。
打开配置目录
text
按 Win + R,输入路径后回车:
%userprofile%\.codextext
在访达按 Command + Shift + G,输入路径后回车:
~/.codex我们只需要两个文件:config.toml(核心配置)和 auth.json(密钥)。首次安装可能没有这两个文件,需要手动创建。
配置 config.toml
把以下内容写入 config.toml(model 请填 模型广场 中你的 Codex 分组下的模型名):
toml
model_provider = "tianshu"
model = "gpt-5.2"
model_reasoning_effort = "high"
model_verbosity = "high"
network_access = "enabled"
disable_response_storage = true
windows_wsl_setup_acknowledged = true
[features]
web_search_request = true
[model_providers.tianshu]
name = "tianshu"
base_url = "https://tian-shu.org/v1"
wire_api = "responses"
requires_openai_auth = true配置 auth.json
把以下内容写入 auth.json,将 xxx 替换成你的天枢 Codex 分组令牌:
json
{
"OPENAI_API_KEY": "xxx"
}测试
在终端运行:
bash
codex出现对话界面并能正常回复,即配置成功。
小贴士
- 全局提示词:在配置目录创建
AGENTS.md,写入你的全局工作规则(如「回答使用中文」),重启 Codex 生效。 - 常用命令、Windows 乱码、VSCode 插件等更多技巧见 常见问题 · Codex。
