Codex Desktop App
Codex Desktop is OpenAI's desktop AI coding assistant that shares config with Codex CLI for AutoRouter integration
Codex Desktop App
Codex Desktop is OpenAI's desktop AI coding assistant with a graphical interface, supporting multi-project workspaces, code editing, and Agent mode. By configuring an OpenAI-compatible endpoint, you can point Codex Desktop at AutoRouter and use any model distributed through your gateway.
- Homepage: https://chatgpt.com/codex
- Repository: https://github.com/openai/codex
Codex Desktop and Codex CLI share the
~/.codex/config directory — configure once and both work.
📦 Prerequisites
What you'll need
- Codex Desktop App installed
- An AutoRouter endpoint (must end with
/v1) - An AutoRouter API key (generated in the console)
- A model ID exactly matching one exposed by your AutoRouter console (e.g.
gpt-5-codex,gpt-5.4)
🚀 Configuration Steps
Option A: One-click setup (recommended)
Codex Desktop does not read the OPENAI_BASE_URL environment variable — you must configure ~/.codex/config.toml. Run the setup script to write the config automatically:
macOS / Linux
curl -fsSL https://docs.autorouter.top/helper/codex-cli-setup.sh | bashWindows (PowerShell)
iex (irm 'https://docs.autorouter.top/helper/codex-cli-setup.ps1')Follow the prompts to enter your AutoRouter endpoint and API key.
Start using
- If Desktop was previously signed in to an OpenAI account, restart Codex Desktop for the config to take effect.
- Select the
autorouterprovider and model from the model picker. - Start a conversation — a normal response confirms the setup is working.
❓ Common Issues
Requests still go to api.openai.com
Codex Desktop ignores OPENAI_BASE_URL. You must set base_url explicitly in a [model_providers.xxx] block in config.toml.
404 Not Found
The base_url is missing the trailing /v1. Use the format https://autorouter.top/v1.
401 Unauthorized
Verify the API key is correct, or re-run the one-click setup script to update it.
Configured model not in the picker
Set the model field directly in config.toml to the target model ID, save, and restart Desktop.