Follow the steps below to install and configure Codex
After one 0011 setup, you can use 0011 service in Codex CLI, the VS Code extension, or Codex App.
After the two steps below, Codex will switch to 0011. All three clients share this configuration, so you do not need to repeat it.
To make Codex use 0011, set the environment variable. The commands below must run in PowerShell (the prompt looks like PS C:\Users\your-name>), not in cmd / Command Prompt:
Temporary setup (current session)
$env:OPENAI_API_KEY_0011AI = "YOUR_API_KEY"Persistent setup
[System.Environment]::SetEnvironmentVariable("OPENAI_API_KEY_0011AI", "YOUR_API_KEY", "User")Restart the terminal after persistent setup.
Run the following command in PowerShell to create a config file and skip the official login flow:
$codexDir = Join-Path $HOME ".codex"
New-Item -ItemType Directory -Force $codexDir | Out-Null
$configPath = Join-Path $codexDir "config.toml"
$config = @"
model_provider = "aicoding"
[model_providers.aicoding]
name = "aicoding"
base_url = "https://aicoding.0011.ai"
env_key = "OPENAI_API_KEY_0011AI"
wire_api = "responses"
requires_openai_auth = false
"@
[System.IO.File]::WriteAllText($configPath, $config, [System.Text.UTF8Encoding]::new($false))Choose the Codex client you use most. This only changes the following install, launch, and verification steps. The 0011 configuration above does not need to be repeated.
For users who prefer using Codex in the terminal.
Open the Node.js download page and confirm the version is LTS (for example v24.14.1 (LTS)). This Windows guide provides an x64 installer by default, which works for most devices.
After installation, verify the version:
node --versionOpen PowerShell and run the following command to install Codex CLI globally:
npm install -g @openai/codex@latestTo start Codex by typing codex in PowerShell later, run the user-level execution policy command below once. It only affects the current Windows user and does not require admin permissions:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -ForceAfter installation, enter codex --version to verify it works.
Go to your project folder, then start Codex CLI:
cd your-project-folder
codexCodex CLI works, but the VS Code extension or Codex App returns 401? Common causes: 1) environment variables were not set before the client started, so you need a full restart of that app; 2) %USERPROFILE%\.codex\auth.json still contains an official ChatGPT login session. Delete auth.json and fully restart:
Remove-Item -Path "$env:USERPROFILE\.codex\auth.json" -Force -ErrorAction SilentlyContinue