Install Codex on Windows: CLI and Desktop App
Install Codex CLI or the desktop app on Windows with prerequisites, verification, and troubleshooting.
Choose Codex CLI for the terminal or the desktop app for a graphical interface. You only need to install the one you plan to use.
Install Codex CLI
Use Windows 11 or a recent, fully updated Windows 10. OpenAI provides best-effort support for Windows 10; see its Windows guide. Install Node.js with npm from the official Node.js download page, then open PowerShell and check:
node --version
npm --versionWhen both commands show a version, install and check the CLI:
npm install -g @openai/codex
codex --versionA version number confirms installation. Open a project folder, run codex, and follow the sign-in prompts. To use GetToken, follow the Codex CLI configuration guide. Send a simple prompt after setup; a response confirms that authentication or service configuration is working.
Install Codex App
For a graphical interface, the existing third-party download page offers a Windows x64 .exe installer. Check the download source, open the installer, complete setup, and start the app. Prepare a GetToken API Key only if you want to use GetToken.
Configure GetToken
Codex App reads the local .codex configuration. On Windows, the directory is:
%USERPROFILE%\.codexThe recommended setup is the PowerShell auto-configuration command:
$env:GETTOKEN_API_KEY='<your GetToken API Key>'; $env:GETTOKEN_BASE_URL='https://api.clawto.link'; irm 'https://yinziai-public-1257376750.youidian.com/scripts/codex-install-config.ps1' | iexThe script creates the configuration directory and writes config.toml and auth.json. Existing files are backed up before being replaced.
Verify
Open Codex App, create or open a project, then send a simple test prompt:
Please introduce yourself in one sentence.If Codex responds normally, the app installation and API configuration are working.
Troubleshooting
Node, npm, or codex is not recognized
Confirm that Node.js and npm are installed and reopen PowerShell. If codex is still missing after a successful install, check that the global command directory shown by npm prefix -g is on PATH. If PowerShell blocks a script, inspect the error and your organization’s policy; try Command Prompt or contact your administrator.
The installer will not open
Check whether the download completed successfully. If the browser or Windows blocks the file, download it again and verify that it came from the link above.
Codex App does not read the configuration
Check whether these files exist:
%USERPROFILE%\.codex\config.toml
%USERPROFILE%\.codex\auth.jsonIf they are missing, run the PowerShell auto-configuration command again.
Requests fail or the model is unavailable
First check that the API Key is complete and that base_url is:
https://api.clawto.linkIf the problem continues, see the Codex App configuration guide and the troubleshooting guide.
See also Codex App configuration and connection troubleshooting.