Sign up or log in
Click “Get my installer”. If you are not logged in you will be taken to sign-up first, then brought back here; the source tag in your link is kept.
Download an installer with your API key already embedded and double-click it: it installs Codex CLI, writes the config, and backs up before overwriting. Then just run codex. Pay as you go, balance never expires.
Sign up or log in first — you will be brought back to the install step automatically. Already have an account? Log in
The installer is generated for your account and contains one API key. Do not share it.
Click “Get my installer”. If you are not logged in you will be taken to sign-up first, then brought back here; the source tag in your link is kept.
You get PrimeRouter-Codex-Installer.zip. Unzip it and double-click PrimeRouter-Codex-Installer.command. If macOS blocks the first launch, right-click the file → Open.
You get PrimeRouter-Codex-Installer.bat. Double-click it and follow the prompts in the window.
You get PrimeRouter-Codex-Installer.sh. In a terminal run: bash ~/Downloads/PrimeRouter-Codex-Installer.sh.
Open a new terminal and run codex. The default model is already in the config; if anything fails, check the FAQ below or the troubleshooting page.
No web login needed: the script asks for your API key interactively and never writes it into the command or your shell history.
curl -fsSL https://primerouter.ai/install/codex.sh | bash
irm https://primerouter.ai/install/codex.ps1 | iex
curl -fsSL https://primerouter.ai/install/codex.sh | bash
What it does: checks Node v22+ → installs @openai/codex globally with npm if missing (asks first) → asks for your API key → backs up and writes ~/.codex/config.toml and auth.json, keeping the existing model_provider id.
Script source: codex.sh · codex.ps1
No key yet? Create one on the API keys page.
Top up what you need — no subscription, no monthly reset.
Local payment methods, or USDT / USDC on multiple chains.
Requests bill against the service's procurement quota, fully isolated from any account you hold with OpenAI.
The same key also works with Claude Code, Gemini CLI, Cursor and any OpenAI- or Anthropic-protocol client.
~/.codex/auth.json), so the PrimeRouter key replaces the ChatGPT login. The original is backed up as auth.json.bak.<timestamp>; run codex login to switch back any time. Troubleshooting page →codex resume keeps listing your old sessions; no file is touched. Troubleshooting page →codex login (which replaced the key), or the key was deleted or disabled in the console. Re-run the installer to restore it, or write it back by hand: printf '%s' "sk-your-key" | codex login --with-api-key. Troubleshooting page →config.toml is not enabled for your group. The installer picks an available default model for your group, so re-running it is enough; or check the console models page and edit model = "…" yourself (keep it above [model_providers]). Troubleshooting page →irm … | iex runs straight from the network and needs no policy change; if you already downloaded codex.ps1, use powershell -ExecutionPolicy Bypass -File .\codex.ps1 to allow just this run. Avoid a machine-wide Set-ExecutionPolicy Unrestricted. Troubleshooting page →~/.codex/config.toml with the CLI, so one setup serves both. On macOS / Windows use the Codex Desktop install page; there is no official Linux desktop build yet, use the CLI. Codex Desktop install page →One API key that also works with Claude Code, Gemini CLI and every OpenAI- or Anthropic-protocol client.