Codex CLI setup
Install Codex in your terminal, connect Supakook, and verify your first request. Operating-system tabs stay synchronized across this page.
Prepare your connection
Get an API key, Base URL, and supported model ID from the Supakook API console. The key needs access to the chosen model, and the endpoint must support Responses. A web subscription is not API credit.
1. Install Codex CLI
- Windows
- Linux
- macOS
Choose one method to install Codex CLI in PowerShell.
- curl
- npm
Use curl to download and run the official Windows installer. Node.js is not required.
$codexInstaller = curl.exe -fsSL https://chatgpt.com/codex/install.ps1
if ($LASTEXITCODE -eq 0) {
Invoke-Expression ($codexInstaller -join [Environment]::NewLine)
}
Don’t have curl? Install curl
Recent Windows 10 versions and Windows 11 normally include curl. Check first:
curl.exe --version
If the command is not found, download the archive for your system architecture from the official site. Extract it, add its bin directory to your user Path environment variable, then reopen PowerShell.
Download curl for Windows ↗If Node.js and npm are already installed, run:
npm.cmd install -g @openai/codex
Don’t have npm? Install Node.js and npm
Choose the LTS version on the Node.js website, download the Windows installer (.msi), and complete installation with the default options. npm is included.
Install Node.js ↗Reopen PowerShell and check the installation:
node --version
npm.cmd --version
After installation, reopen PowerShell and check the Codex version:
cmd /c codex --version
For WSL, select Linux and install, configure, and run Codex inside WSL.
A version number confirms installation. Use the same installation method when updating to avoid conflicting versions.
Install Node.js LTS for your distribution, then install Codex in a terminal.
node --version
npm --version
npm install -g @openai/codex
codex --version
A version number confirms installation. Use the same installation method when updating to avoid conflicting versions.
Install with Homebrew in Terminal. If you do not have Homebrew, you can use the npm option below.
brew install --cask codex
codex --version
Already have Node.js? Install with npm
Don’t have Node.js? Install Node.js ↗
npm install -g @openai/codex
codex --version
A version number confirms installation. Use the same installation method when updating to avoid conflicting versions.
2. Configure Supakook
Back up your configuration, then merge these fields. Keep existing MCP, project, and permission settings; do not duplicate keys.
- Windows
- Linux
- macOS
User configuration file: %USERPROFILE%\.codex\config.toml
New-Item -ItemType Directory -Force "$env:USERPROFILE\.codex" | Out-Null
notepad "$env:USERPROFILE\.codex\config.toml"
User configuration file: ~/.codex/config.toml
mkdir -p ~/.codex
touch ~/.codex/config.toml
nano ~/.codex/config.toml
User configuration file: ~/.codex/config.toml
mkdir -p ~/.codex
touch ~/.codex/config.toml
open -e ~/.codex/config.toml
This is a configuration template. Replace MODEL_ID_FROM_CONSOLE with an available model ID and the entire example URL with your delivered Base URL. Do not append duplicate /v1 or /responses paths.
model_provider = "supakook"
model = "MODEL_ID_FROM_CONSOLE"
[model_providers.supakook]
name = "Supakook"
base_url = "https://api.example.com/v1"
wire_api = "responses"
env_key = "SUPAKOOK_API_KEY"
Set your key in the current terminal, then enter your project and start Codex. The key below is a placeholder. This variable applies only to this terminal and its child processes.
- Windows
- Linux
- macOS
$env:SUPAKOOK_API_KEY = "YOUR_API_KEY"
cd "C:\path\to\project"
cmd /c codex
export SUPAKOOK_API_KEY="YOUR_API_KEY"
cd /path/to/project
codex
export SUPAKOOK_API_KEY="YOUR_API_KEY"
cd /path/to/project
codex
If you set CODEX_HOME, use that configuration directory. WSL has a separate Linux home directory from native Windows.
3. Verify the connection
Check the active provider and model, then try a small task in your project:
Read the README and summarize this project. Do not modify files yet.
After receiving a reply, check the matching usage record in the console. This confirms which service handled the request; a reply alone does not prove that the intended provider was used.
Troubleshooting
- Command not found: Reopen your terminal and check PATH. With npm on Windows, try
codex.cmd. - Missing environment variable: Set
SUPAKOOK_API_KEYin the same terminal that starts the CLI. - 401 / 403: Check key validity and model permissions.
- 404 / Responses unsupported: Verify Base URL, protocol, and model ID.
- Old configuration remains: Check project overrides, launch arguments,
CODEX_HOME, and the actual local or remote environment. Restart the desktop app after changes.
Custom API access covers supported local Codex workflows. Cloud, plugins, and web search depend on client, authentication, and provider support. Initial setup does not require disabling sandboxing or approval prompts.
Sources
Official CLI guide · Desktop guide · Windows · Linux · Provider configuration · Authentication. Layout and setup flow also draw on New API and Sub2API.