Codex App Download (Mac, Windows, Linux): Official Links
Download Codex in the ChatGPT desktop app for macOS, Windows, and Linux from official OpenAI channels, compare desktop vs CLI, and sign in or use an API key.
Codex desktop · pay-as-you-go API
Use the UniRoute Responses API in the Codex mode of the ChatGPT desktop app. Configure the provider, model, and file-based API credentials together.
Best for: Developers who prefer a desktop workspace and repository reviews.
Quick setup
Sign in to create a key and fill it in automatically Sign in
UNIROUTE_API_KEY=YOUR_UNIROUTE_API_KEY npx -y uniroute-setup@latest configure codex --model gpt-6.1-sol$env:UNIROUTE_API_KEY="YOUR_UNIROUTE_API_KEY"; npx -y uniroute-setup@latest configure codex --model gpt-6.1-solRequires Node.js 22+ for the setup tool. Add --dry-run to preview the file changes without writing; --home /path/to/test-home uses an isolated home. Existing changed files are backed up and unrelated settings are preserved.
Manual configuration
1. Locate and back up the files
macOS / Linux: ~/.codex/config.toml and ~/.codex/auth.json. Windows: $HOME\.codex\config.toml and $HOME\.codex\auth.json. Quit Codex and the ChatGPT desktop app before editing.
2. Merge the provider settings
model = "gpt-6.1-sol"
model_provider = "uniroute"
cli_auth_credentials_store = "file"
[model_providers.uniroute]
name = "UniRoute"
base_url = "https://api.uniroute.app/v1"
wire_api = "responses"
requires_openai_auth = true3. Set file-based credentials
{
"OPENAI_API_KEY": "YOUR_UNIROUTE_API_KEY",
"auth_mode": "apikey"
}Merge the first block into config.toml, keeping top-level fields before table headers. Back up auth.json, then replace active tokens and last_refresh fields with the API-key authentication shown above. Remove env_key, experimental_bearer_token, or nested auth fields from this provider.
4. Restart with the matching configuration
The setup tool writes the operating system home plus .codex; --home selects a different home root. For a custom CODEX_HOME, edit $CODEX_HOME/config.toml and $CODEX_HOME/auth.json manually. An alternative is env_key = "UNIROUTE_API_KEY" with requires_openai_auth = false; set the secret in the launching environment and leave auth.json unchanged. Choose one authentication method.
Apps launched from the Dock or Start menu may not inherit terminal variables; file-based credentials work with those launch methods. Reopen ChatGPT, select Codex from the top dropdown, and start a new chat.
What these fields do
| Field | Purpose |
|---|---|
| base_url | Responses API base URL, including one /v1 suffix. |
| wire_api | Use responses for the Codex protocol. |
| model_provider / model | Select the UniRoute provider and exact model ID. |
| OPENAI_API_KEY / auth_mode | File-based key and API-key authentication mode. |
Choose a model
Confirm the connection
Check status with /status to inspect the active model and service.
Send a short test: codex exec "Reply only: hello"
Open usage logs to review the model, request status and charge. The test is a real, billed API request.
Match its time, model, and actual charge in the usage log. Keep the key in private configuration and out of repositories.
Switch back / restore a backup
Quit Codex and the desktop app. Restore the matching config.toml and auth.json private backups printed by the setup tool. This restores the prior ChatGPT or API credentials. For environment authentication, remove only variables added for this setup. Preserve later unrelated changes, then reopen the client.
If a file was new and has no backup, remove only the fields added by this setup and preserve settings added later.
Not installed yet?
Download the official ChatGPT desktop app for desktop Codex. Windows also offers winget install --id 9PLM9XGG6VKS -s msstore; Linux packages and updates are in the official Linux guide. For terminal use, install Node.js 22+ and run:
npm install -g @openai/codex
codex --version
Official Linux packages
Use uname -m to check architecture: x86_64 is x64; aarch64 / arm64 is ARM64. Install the downloaded package with sudo apt install ./chatgpt_amd64.deb (substitute your filename) or sudo dnf install ./chatgpt.x86_64.rpm.
Arch users can use the official installer script; it performs a full system upgrade and asks for confirmation. The deb / rpm installation configures a signed OpenAI repository for later package-manager updates.
FAQ
Does this use my ChatGPT subscription?
This provider uses UniRoute API credentials and UniRoute pay-as-you-go billing. Restore your previous configuration to return to ChatGPT authentication.
Which protocol should I choose?
Choose Responses and the base URL ending in /v1. The client adds /responses. See the official configuration reference.
Troubleshooting
401 / authentication failed
The active credential is incomplete, revoked, or still points to another provider.
Paste a valid UniRoute key and check the active authentication method.
404 / wrong endpoint
The base URL and adapter path do not match.
Use the address shown above and remove duplicated /v1 or /v1beta segments.
Model missing / 403
The selected model, key permissions, or wallet funds need attention.
Check the model ID, key restrictions, and wallet in the console, then restart the client.
Changes did not take effect
A running process or a different config directory is still in use.
Quit the client completely, check its effective configuration path, then reopen.
Related links
Codex API-key walkthrough · GPT API pricing
Manage API keys
Model prices
