OpenAI Codex is an advanced code generation AI based on GPT models, specifically optimized for programming tasks. It can:
Through i7Relay relay service, you can stably use OpenAI services in domestic network environments.
# Ubuntu / Debian users
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo bash -
sudo apt-get install -y nodejs
node --version
# macOS users
sudo xcode-select --install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install node
node --version
Ensure Node.js version ≥ 18.0
Tip: If you have previously installed other local relay/proxy tools that occupy the same port, it may cause conflicts. It is recommended to disable or uninstall them before continuing.
npm i -g @openai/codex
codex -V
codex -m gpt-5.2
Add the following configuration in ~/.codex/config.toml file:
model_provider = "i7relay"
model = "gpt-5.2"
model_reasoning_effort = "high"
disable_response_storage = true
preferred_auth_method = "apikey"
[model_providers.i7relay]
name = "i7relay"
base_url = "https://i7dc.com/api"
wire_api = "responses"
requires_openai_auth = true
# This refers to the name of the environment variable, do not replace it with your personal center key. This only specifies using an environment variable named I7RELAY_KEY below
env_key = "I7RELAY_KEY"
Add the following configuration in ~/.codex/auth.json file:
{
"OPENAI_API_KEY": null
}
Then configure environment variables
export I7RELAY_KEY="your-personal-center-key"
set I7RELAY_KEY=your-personal-center-key
$env:I7RELAY_KEY="your-personal-center-key"
Start using OpenAI Codex and let AI become your programming assistant! 🚀