Configuring Codex
This guide shows how to point the Codex desktop app (UI client) at models served by wylon — handy if you'd rather not use the terminal.
How it works
On startup the Codex desktop app reads two config files in the same hidden folder:
config.toml— where model requests go and which model to use. We point it at wylon.auth.json— used to bypass Codex's own login check. Codex only checks that the file exists, not whether the key is real, so a dummy key is enough to skip OpenAI sign-in.
Folder location:
- macOS:
~/.codex/ - Windows:
C:\Users\your-name\.codex\
Case A: Codex not yet installed
Step 1: Download & install (don't open it yet)
- macOS: download the Mac app from the OpenAI Codex page (
developers.openai.com/codex). - Windows: search for “Codex” in the Microsoft Store.
Step 2: Edit config.toml
Config file path:
# macOS
~/.codex/config.toml
# Windows
$env:USERPROFILE\.codex\config.toml
Back up config.toml first (copy it to config.toml.bak). Then paste the following in — ideally at the top of the file, with no duplicate keys:
model = "GLM5.2" # set to a real model name
model_provider = "wylon"
disable_response_storage = true # important: don't rely on server-side session storage
[model_providers.wylon]
name = "wylon"
base_url = "https://api.wylon.cn/v1"
requires_openai_auth = false
experimental_bearer_token = "your-API-Key" # paste an API key created in the wylon console
Step 3: Skip ChatGPT sign-in
Recommended: open Codex, click “Sign in another way”, and enter any value, e.g.:
sk-dummy
The app writes it to auth.json and lets you through. This dummy key is never used for any request.
Alternative: if your version's sign-in screen has no API-key option, create the file manually.
macOS terminal:
printf '{ "OPENAI_API_KEY": "sk-dummy" }' > ~/.codex/auth.json
Windows PowerShell:
Set-Content -Path $env:USERPROFILE\.codex\auth.json -Value '{ "OPENAI_API_KEY": "sk-dummy" }'
Then launch the app.
Step 4: Use it
That's it — you should be able to start using it right away.
Case B: Codex already installed and signed into ChatGPT
Step 1: Sign out
Sign out first — Codex doesn't support custom models while signed into an OpenAI account. After signing out you'll land on the welcome screen; click “Sign in another way”, enter sk-dummy as in Case A step 3, and sign in. Then quit Codex completely.
Step 2: Configure config.toml as in Case A
Configure config.toml exactly as in Case A, restart Codex, and you're ready.
Restoring the original setup
- Rename the current
config.tomltoconfig.toml.wylon, then renameconfig.toml.bakback toconfig.toml. - Delete
auth.json. - Restart Codex to return to the normal sign-in screen.