Install Codex CLI
Install Codex CLI on macOS, Windows, and Linux, then verify the install before configuring HopsAPI.
Codex CLI ships a standalone installer that bundles its own runtime, so Node.js is optional.
System requirements
| Item | Requirement | Notes |
|---|---|---|
| macOS | 12 (Monterey) or later | Apple Silicon and Intel both supported |
| Windows | 10 / 11 | Native support is experimental; WSL2 is the more tested path |
| Linux | glibc-based distros (Ubuntu 22.04+, Debian 11+, Fedora 34+) | — |
| Node.js | 22 or later, recommended | Only relevant to the npm install |
macOS
Run this in the terminal:
curl -fsSL https://chatgpt.com/codex/install.sh | shHomebrew works too:
brew install --cask codexWindows
Run this in PowerShell:
powershell -ExecutionPolicy ByPass -c "irm https://chatgpt.com/codex/install.ps1 | iex"If your execution policy blocks the script, use the npm route below instead.
Codex reads and writes Git repositories, so install Git for Windows — it also provides Git Bash, which avoids most path quirks of the native shell. Native Windows support is still experimental; if problems persist, install inside WSL2 and follow the Linux steps.
Linux
Run this in the terminal:
curl -fsSL https://chatgpt.com/codex/install.sh | shInstall with npm
If you already have a stable Node.js setup, or the standalone installer is blocked on your machine, npm is the officially supported alternative:
npm install -g @openai/codexIt needs Node.js 22 or later. Install it through nvm to avoid sudo and permission errors:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
nvm install 22
npm install -g @openai/codexOn Windows, install Node.js from nodejs.org instead. Don't use sudo npm install -g — it leads to permission and security problems.
Verify the install
Run this in the terminal:
codex --versionA version number means the install succeeded. If the shell reports command not found, open a new terminal — the installer updates PATH, but sessions started earlier keep the old value.
Codex still talks to OpenAI at this point. Continue with Configure a model provider to route it through HopsAPI.
Troubleshooting
| Symptom | Fix |
|---|---|
codex: command not found right after installing | Open a new terminal. The installer updates PATH, but earlier sessions keep the old value. |
EACCES or another permission error during npm install -g | Fix your npm global prefix, or install Node.js through nvm. Avoid sudo npm install -g. |
node --version reports below 22 | Run nvm install 22 && nvm use 22, or switch to the standalone installer, which bundles its own runtime. |
| PowerShell refuses to run the install script | Include -ExecutionPolicy ByPass exactly as shown, or install through npm. |
| Download fails or stalls | Force the GitHub Releases mirror: curl -fsSL https://chatgpt.com/codex/install.sh | CODEX_INSTALLER_USE_RELEASES_OPENAI_COM=false sh |
Integrations
Connect Claude Code, Codex CLI, and other OpenAI-, Anthropic-, or Google-compatible tools to HopsAPI with a single API key.
Configure a model provider
Point Codex CLI at HopsAPI's OpenAI Responses endpoint. Import it into CC Switch from the console in one click, add it in CC Switch by hand, or edit config.toml yourself.