ChatGPT Codex Workspace

Use the Codex workspace in the ChatGPT desktop app with the same OneRouter provider configuration as Codex CLI.

Install the desktop app

Download the current desktop app from the official Codex page, install the build for your operating system, and update it before configuring a custom provider.

Set the API key

Keep API keys in environment variables or the client's protected credential store. Never commit keys to a project, paste them into chat, or include them in screenshots.

export ONEROUTER_API_KEY="YOUR_ONEROUTER_API_KEY"

Configure the Codex provider

Edit the user-level ~/.codex/config.toml. The desktop Codex workspace reads the same provider configuration as Codex CLI.

model = "<MODEL_SLUG>"
model_provider = "onerouter"

[model_providers.onerouter]
name = "OneRouter"
base_url = "https://onerouter.com/v1"
env_key = "ONEROUTER_API_KEY"
wire_api = "responses"

Restart and verify

Fully quit and reopen the app so the Codex workspace reloads the environment and configuration. Open a small repository, confirm the OneRouter provider and model, and start with a read-only prompt.

Summarize this repository structure. Do not modify files or run commands.

Troubleshooting

SymptomHow to fix it
Provider does not appearConfirm the file is in the user Codex directory and restart the entire desktop app.
401Launch the app from an environment that can read ONEROUTER_API_KEY, or persist the variable securely.
404Use /v1, keep wire_api = "responses", and do not append /responses.
Wrong modelUse the complete OneRouter model slug in the top-level model field.