Codex Setup Guide

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.

Complete 0011 Configuration

After the two steps below, Codex will switch to 0011. All three clients share this configuration, so you do not need to repeat it.

1

Set Environment Variables

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.

2

Configure Codex

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 Your Codex Client

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.

1

Install Node.js LTS

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.

This guide only provides an x64 installer link.
If you are sure you use a Windows ARM device, go to the Node.js website and choose ARM64.

After installation, verify the version:

node --version
After installation, you must close and reopen PowerShell, then run the command above again.
2

Install Codex CLI Globally

Open PowerShell and run the following command to install Codex CLI globally:

npm install -g @openai/codex@latest

To 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 -Force

After installation, enter codex --version to verify it works.

3

Start Using Codex

Go to your project folder, then start Codex CLI:

cd your-project-folder codex

Getting a 401 Error?

Codex 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