wylon

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.

warning
Version compatibility OpenAI doesn't currently provide an official “add a custom model” entry point for the desktop app; its UI is built around ChatGPT accounts. This method comes from community exploration and may stop working in a future Codex release.

How it works

On startup the Codex desktop app reads two config files in the same hidden folder:

Folder location:

Case A: Codex not yet installed

Step 1: Download & install (don't open it yet)

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

  1. Rename the current config.toml to config.toml.wylon, then rename config.toml.bak back to config.toml.
  2. Delete auth.json.
  3. Restart Codex to return to the normal sign-in screen.

Notes

info
Codex organizes chat history by model provider. After switching providers, earlier conversations may become unavailable.
沪ICP备2026010432号-1 沪公网安备31010402336632号