Skip to content

1. 安装

powershell
npm install -g @openai/codex
codex --version

2. 配置

配置目录:C:\Users\<你的用户名>\.codex\

config.toml

文件路径:C:\Users\<你的用户名>\.codex\config.toml

没有该文件就新建一个。

toml
model_provider = "acc"
model = "gpt-5.5"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"

[model_providers.acc]
name = "acc"
base_url = "https://aicode.cat/v1"
wire_api = "responses"
requires_openai_auth = true

auth.json

文件路径:C:\Users\<你的用户名>\.codex\auth.json

没有该文件就新建一个。请将 "你的API密钥" 替换为用户仪表盘密钥页中创建的实际密钥。

json
{
  "OPENAI_API_KEY": "你的API密钥"
}

3. 启动

配置完成后需要重启终端才能生效。如果在 VS Code / Cursor 等 IDE 的集成终端中使用,需要彻底重启整个 IDE(不只是重启终端),否则配置可能不会生效。

powershell
codex