Skip to content

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 -v

Option A: native PowerShell install ​

1) Install Codex ​

Step 1: install Codex globally

powershell
npm install -g @openai/codex

Step 2: check the install

powershell
codex --version

2) 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 UTF8

What the settings do:

  • model_provider: the provider to use (here, flashapi)
  • model: the default model
  • review_model: code review also uses gpt-6.1-sol
  • model_context_window: sized for GPT-6.1 Sol's 272K tier
  • base_url: the Flash API endpoint
  • wire_api: the OpenAI-compatible wire format
  • requires_openai_auth: must stay true, or Codex won't read the API key from auth.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 UTF8

You 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
codex

Option B: WSL2 ​

  1. Install WSL2 and open your Linux distro
  2. Inside WSL2, follow the Linux guide:

Codex on Linux

One base URL for GPT, Claude and Gemini