Codex Setup
Codex is OpenAI's coding assistant.
Complete the Environment Setup chapter first and make sure Node.js and npm are installed.
After basic setup, use the Codex config.toml guide to choose reasoning effort, credential storage, Provider Base URLs, and profiles safely.
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.6-sol"
cli_auth_credentials_store = "file"
suppress_unstable_features_warning = true
personality = "pragmatic"
[model_providers.icodeeasy]
name = "icodeeasy"
base_url = "https://api.icodeeasy.cc"
wire_api = "responses"
requires_openai_auth = true
If api.icodeeasy.cc is slow from your network, change base_url to https://jp.icodeeasy.cc or https://sg.icodeeasy.cc.
Step 4: Sign in and create auth.json
Copy the API key from API Keys, then run the commands below. Paste the key and press Enter. The input is hidden and the key is not persisted in your shell startup files:
read -s OPENAI_API_KEY
printf '\n'
printf '%s' "$OPENAI_API_KEY" | codex login --with-api-key
unset OPENAI_API_KEY
codex login status
Codex writes the credential to ~/.codex/auth.json. Do not create or edit that file manually:
config.toml controls the model and Provider, while auth.json stores only login credentials.
Restrict both files to your user:
chmod 600 ~/.codex/config.toml ~/.codex/auth.json
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.6-sol"
cli_auth_credentials_store = "file"
suppress_unstable_features_warning = true
personality = "pragmatic"
[model_providers.icodeeasy]
name = "icodeeasy"
base_url = "https://api.icodeeasy.cc"
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 or https://sg.icodeeasy.cc.
Step 4: Sign in and create auth.json
Copy the API key from API Keys, then run:
$secureKey = Read-Host "API Key" -AsSecureString
$plainKey = [System.Net.NetworkCredential]::new("", $secureKey).Password
$plainKey | codex login --with-api-key
$plainKey = $null
codex login status
Codex writes the credential to $env:USERPROFILE\.codex\auth.json. Do not create or edit the file
manually, and do not set a permanent user-level OPENAI_API_KEY variable.
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 login status succeeds. The VSCode extension reuses the same config.toml and Codex login cache.
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
You normally do not need to enter the key again. If the extension still asks you to sign in, run
codex login status in VSCode's integrated terminal and then run Developer: Reload Window.
Related guides
Codex config.toml Setup, Settings & Fixes
Set up Codex CLI config.toml with models, reasoning effort, API key login, a custom Base URL, profiles, and fixes for 401, 429, and connection errors.
VS Code Setup
Install and configure Codex or Claude extensions in VS Code, use secure credentials and custom API addresses, and resolve login prompts.
FAQ
Troubleshoot API keys, 401 and 429 responses, Windows environment variables, client connectivity, quotas, and support reporting.