Install Codex on Windows
On Windows you have two common options:
- Option A: install and run natively in PowerShell
- Option B: install and run inside WSL2
Both are covered below. Pick the one that fits your setup.
0. Prerequisite: install Node.js
Install Node.js first (22+ recommended): Node.js on Windows
Verify:
powershell
node -v
npm -vOption A: native PowerShell install
1) Install Codex
Step 1: install Codex globally
powershell
npm install -g @openai/codexStep 2: check the install
powershell
codex --version2) Configure Codex for Flash API
2.1 Where the config lives
Config directory: %USERPROFILE%\.codex
What that means:
- The full path is
C:\Users\<your-username>\.codex\
2.2 Create the config directory
powershell
New-Item -ItemType Directory -Force -Path "$env:USERPROFILE\.codex"2.3 Write config.toml
powershell
@'
# Base config
model_provider = "flashapi"
model = "gpt-6.1-sol"
review_model = "gpt-6.1-sol"
model_reasoning_effort = "high"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 272000
model_auto_compact_token_limit = 272000
effective_context_window_percent = 95
[model_providers.flashapi]
name = "flashapi"
base_url = "https://ai.flashapi.top/v1"
wire_api = "responses"
requires_openai_auth = true
http_headers = { "x-openai-actor-authorization" = "flashapi.top" }
'@ | Set-Content -Path "$env:USERPROFILE\.codex\config.toml" -Encoding UTF8What the settings do:
model_provider: the provider to use (here, flashapi)model: the default modelreview_model: code review also usesgpt-6.1-solmodel_context_window: sized for GPT-6.1 Sol's 272K tierbase_url: the Flash API endpointwire_api: the OpenAI-compatible wire formatrequires_openai_auth: must staytrue, or Codex won't read the API key fromauth.json
2.4 Write auth.json (replace the API key)
powershell
@'
{
"OPENAI_API_KEY": "YOUR_FLASH_API_KEY"
}
'@ | Set-Content -Path "$env:USERPROFILE\.codex\auth.json" -Encoding UTF8You must replace YOUR_FLASH_API_KEY with the real key you copied from the Flash API console.
3) Launch and verify
powershell
cd C:\path\to\your\project
codexOption B: WSL2
- Install WSL2 and open your Linux distro
- Inside WSL2, follow the Linux guide: