PrimeRouter × Codex Desktop

Install Codex Desktop in one clickwired to PrimeRouter

Download an installer with your API key already embedded and double-click it: it installs the Codex desktop app, writes the ~/.codex/config.toml shared with the CLI, and backs up before overwriting. Then open the app. Pay as you go, balance never expires.

One-line install

Sign up or log in first — you will be brought back to the install step automatically. Already have an account? Log in

KEY
Your API key is embedded — nothing to paste
BACKUP
config.toml and auth.json are backed up before writing
HISTORY
Keeps your existing model_provider, so codex resume still lists old sessions
SHARED
One config shared with Codex CLI — set up once, use both
HOW IT WORKS

Three steps

01

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.

02

Download and run the installer

You get PrimeRouter-CodexDesktop-Installer.zip. Unzip it and double-click PrimeRouter-CodexDesktop-Installer.command. It downloads the DMG from the PrimeRouter mirror, installs it, then writes the config.

03

Open the Codex app

On macOS the current package may show up as ChatGPT.app (the bundle id is still Codex); the script prints the actual path when it finishes. Open it and go; if it asks you to sign in or the model list looks wrong, check the troubleshooting page first.

ONE-LINE INSTALL

Already have an API key? One line

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-desktop.sh | bash

What it does: on macOS, downloads the DMG from the PrimeRouter mirror (falling back to the official URL) and installs it into Applications → asks for your API key → backs up and writes ~/.codex/config.toml and auth.json. On Windows the script installs the desktop app from the Microsoft Store (winget) and writes the config.

Script source: codex-desktop.sh · codex-desktop.ps1

No key yet? Create one on the API keys page.

Why PrimeRouter

Why run Codex Desktop through PrimeRouter

Pay as you go, balance never expires

Top up what you need — no subscription, no monthly reset.

Fiat or crypto top-up

Local payment methods, or USDT / USDC on multiple chains.

Zero risk to your personal accounts

Requests bill against the service's procurement quota, fully isolated from any account you hold with OpenAI.

One key, every coding tool

The same key also works with Claude Code, Gemini CLI, Cursor and any OpenAI- or Anthropic-protocol client.

FAQ

FAQ

Yes. Codex keeps a single credential (~/.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 →
Yes. The installer reuses the model_provider id already on this machine, so codex resume keeps listing your old sessions; no file is touched. Troubleshooting page →
Usually you ran 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 →
The model in 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 →
The script tries the PrimeRouter mirror first and falls back to the official URL. If the download was interrupted, just re-run; “image is corrupt” means an incomplete file — delete it, re-download, and make sure more than 1 GB is free; if the first launch is blocked, right-click the app in Applications → Open. Troubleshooting page →
It is generated for you only and contains one key from your account — do not forward it. If it leaks, delete or recreate that key on the API keys page; your other keys are unaffected. API keys page →
The CLI and the desktop app share ~/.codex/config.toml, so one setup serves both. If you only want the command line, use the Codex CLI install page. Codex CLI install page →

Wire up Codex Desktop now

One API key that also works with Claude Code, Gemini CLI and every OpenAI- or Anthropic-protocol client.