配置node环境
1、首先需要安装node环境,这里推荐使用nvm,方便管理和切换node的版本
brew install nvm
2、配置nvm到环境变量
3、nvm安装node
nvm install <version>
(本文主要记录安装codex的过程,nvm的命令不多赘述
配置codex
1、安装codex
npm i -g @openai/codex
执行以下命令进入codex
codex
如果出现如下页面说明codex安装成功
Welcome to Codex, OpenAI's command-line coding agent
Sign in with ChatGPT to use Codex as part of your paid plan
or connect an API key for usage-based billing
> 1. Sign in with ChatGPT
Usage included with Plus, Pro, Business, and Enterprise plans
2. Sign in with Device Code
Sign in from another device with a one-time code
3. Provide your own API key
Pay for what you use
Press enter to continue
2、配置codex
codex的配置路径是
mkdir -p ~/.codex
在这个路径下创建配置文件
vim config.toml
model_provider = "api111"
model = "gpt-5-codex"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"
[model_providers.api111]
name = "api111"
base_url = "https://api.88api.chat/v1"
wire_api = "responses"
配置key
vim ~/.codex/auth.json
{
"OPENAI_API_KEY": "sk-你的实际Key"
}