Codex Setup

Codex is OpenAI's coding assistant.

Complete the Environment Setup chapter first and make sure Node.js and npm are installed.


Linux / MacOS

Step 1: Install Codex

npm install -g @openai/codex@latest

Step 2: Create Config Folder

Create a .codex folder under your home directory.

mkdir -p ~/.codex

Step 3: Create config.toml

Create config.toml inside .codex and paste:

model_provider = "icodeeasy"
model = "gpt-5.3-codex"
disable_response_storage = true
suppress_unstable_features_warning = true
preferred_auth_method = "apikey"
personality = "pragmatic"

[model_providers.icodeeasy]
name = "icodeeasy"
base_url = "https://api.icodeeasy.cc"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
requires_openai_auth = true

If api.icodeeasy.cc is slow from your network, change base_url to https://jp.icodeeasy.cc.

Step 4: Configure Environment Variables

Add to ~/.bashrc or ~/.zshrc:

export OPENAI_API_KEY="your API Key"
export OPENAI_BASE_URL="https://api.icodeeasy.cc"

If api.icodeeasy.cc is slow from your network, change OPENAI_BASE_URL to https://jp.icodeeasy.cc.

Save the file and run source ~/.bashrc or source ~/.zshrc.

Step 5: Start Codex

cd your-project-folder
codex

Windows

Step 1: Install Codex

npm install -g @openai/codex@latest

Step 2: Create Config Folder

View your user directory:

echo $env:USERPROFILE

Create the .codex folder:

New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex"

Step 3: Create config.toml

Create config.toml inside .codex and paste:

model_provider = "icodeeasy"
model = "gpt-5.3-codex"
disable_response_storage = true
suppress_unstable_features_warning = true
preferred_auth_method = "apikey"
personality = "pragmatic"

[model_providers.icodeeasy]
name = "icodeeasy"
base_url = "https://api.icodeeasy.cc"
env_key = "OPENAI_API_KEY"
wire_api = "responses"
requires_openai_auth = true

[features]
elevated_windows_sandbox = true

If api.icodeeasy.cc is slow from your network, change base_url to https://jp.icodeeasy.cc.

Step 4: Configure API Key in PowerShell

[Environment]::SetEnvironmentVariable("OPENAI_API_KEY", "your API Key", "User")

Open a new PowerShell window after setting it.

Step 5: Start Codex

Open a new PowerShell window, enter your project directory, and start:

cd your-project-folder
codex

VSCode

Complete the Codex CLI setup first and confirm Codex starts from the command line. The VSCode extension uses the same .codex/config.toml file and system environment variables.

Step 1: Install Codex Extension

Search for and install Codex in the VSCode extension marketplace.

Step 2: Open Config File

The Codex VSCode extension reuses .codex/config.toml under your user directory. Create the .codex folder and config.toml by following the Linux / MacOS or Windows steps above.

Step 3: Configure API Key

If the VSCode extension asks for an API Key, copy it from the API Keys page and paste it.