ChatGPT: install, configure and troubleshoot LYRouter access
This page shows how to configure a LYRouter model service for local work (Codex) in the official ChatGPT desktop app; see also the official gateway configuration guide. ChatGPT on the web does not read your local config.toml; the configuration below applies to local work in the desktop app.
Already installed? Go straight to Configure LYRouter.
Prerequisites
This page uses local work (Codex) in the official desktop app. Prepare network access, a writable user configuration directory and the official installer that matches your operating system and processor. You do not need to install Codex CLI before installing the desktop app.
Use the official Windows desktop app, and have PowerShell and installation permission ready. Open the download link from the official Windows guide. To install from the command line, first make sure winget is available:
winget --version
This page configures native Windows. The CLI in WSL uses a separate Linux user directory and does not automatically share this configuration.
The official Linux desktop app is currently a preview. Follow the official Linux guide to make sure your distribution and processor are supported, and prepare a graphical desktop, a terminal and permission to install packages:
cat /etc/os-release
uname -m
Choose the .deb, .rpm or official Arch installation path for your distribution, and the package for x64 / ARM64.
Choose the installer for your device from the official desktop app page; the page currently offers an Apple Silicon download. Prepare Terminal and write permission to the applications directory, then check your system and architecture:
sw_vers -productVersion
uname -m
Before downloading, check the system and processor requirements listed on the official page.
On the LYRouter side you need an enabled API key, plus a model and service source that support Responses in the workspace the key belongs to. Permissions for the app account and the LYRouter account are managed separately.
Install the app
Open the Microsoft Store download from the official Windows guide and install the app, or run the official command in PowerShell:
winget install --id 9PLM9XGG6VKS -s msstore
After installation, open ChatGPT from the Start menu.
Download the package for your architecture from the official Linux guide. x64 example for Ubuntu / Debian:
cd ~/Downloads
sudo apt install ./chatgpt_amd64.deb
chatgpt
For ARM64, use chatgpt_arm64.deb. x64 example for Fedora:
cd ~/Downloads
sudo dnf install ./chatgpt.x86_64.rpm
chatgpt
For ARM64, use chatgpt.aarch64.rpm. For Arch, follow the official guide.
- Download the macOS installer from the official desktop app page.
- Open the installer and move the app into the "Applications" folder.
- Open ChatGPT from "Applications" and complete the first-launch prompts.
Make sure the app opens normally, go to local work (Codex) in the app and prepare a local project or folder. Then configure LYRouter as described in the next section.
Configure LYRouter
1. Configure the model service
Open the user-level configuration file and merge in the following. If a setting already exists, change its value instead of adding it again.
| System | Configuration file |
|---|---|
| macOS / Linux | ~/.codex/config.toml |
| Windows | %USERPROFILE%\.codex\config.toml |
model = "MODEL_ID"
model_provider = "lyrouter"
web_search = "disabled"
[model_providers.lyrouter]
name = "LYRouter"
base_url = "https://api.lyrouter.com/v1"
wire_api = "responses"
env_key = "LYROUTER_API_KEY"
- Replace
MODEL_IDwith a system model identifier that is available in the current workspace and supports Responses; see Model identifiers and discovery. - Put
model,model_providerandweb_searchbefore the first TOML table header. base_urlincludes/v1. Do not enter the console address or the full/v1/responsesendpoint.- Keep web search off for the first configuration. Before turning it on, make sure the model and its source support that capability.
2. Set the API key
Set an enabled LYRouter API key as LYROUTER_API_KEY. The key comes from the environment variables of the app process; do not write it into project configuration or a repository.
Run the following command in Terminal, then quit the desktop app completely and reopen it:
launchctl setenv LYROUTER_API_KEY "YOUR_LYROUTER_API_KEY"
This setting applies to the current login session; set it again after you log in again.
Set a user environment variable in PowerShell:
[Environment]::SetEnvironmentVariable("LYROUTER_API_KEY", "YOUR_LYROUTER_API_KEY", "User")
Sign out of Windows and sign back in before you open the desktop app, so that the process that launches it reads the new user environment variable.
Run the following in the terminal you start the desktop app from:
export LYROUTER_API_KEY="YOUR_LYROUTER_API_KEY"
chatgpt
When you start the app from a desktop icon, set the variable in the app's launch environment. Running export in another terminal does not reach an app that is already running.
Verify your first call
Quit the ChatGPT desktop app completely and reopen it. Create a new task in local work and confirm that the active model service is LYRouter and the model is the MODEL_ID you configured. Send "Reply with OK only", then confirm the actual call in the LYRouter request logs by time and API key.
Everyday use and troubleshooting
The app does not open after installation. What should I do?
Answer: Make sure you used the official installer, and check your operating system and processor architecture. On Linux, also make sure your distribution is supported, the right package is installed and a graphical desktop is available. Check the installation against the guide for your system under "Official resources" on this page.
Why is LYRouter not used after I changed the configuration?
Answer: Make sure you are in local work (Codex) in the desktop app and the configuration is in the user-level config.toml. Check whether another profile is selected, and whether the top-level model and model_provider come before the first table header. Quit and restart the app completely, then verify again. ChatGPT on the web does not read local configuration.
How do I fill in the Base URL and model?
Answer: Use https://api.lyrouter.com/v1 for base_url and responses for wire_api. For the model, enter a system identifier available in the workspace, and make sure it has at least one valid source that supports Responses. Do not enter a display name, and do not append /v1 again. See Model identifiers and discovery and Responses.
A request returns 401 / 403. What should I check first?
Answer: Make sure the key is enabled and LYROUTER_API_KEY has reached the desktop app process. On macOS, set the session environment variable from this page again after you log in again; on Windows, sign out and back in after setting the user variable, then open the app. Then check the model permissions of the key's workspace; see 401 / 403: authentication and access.
A request returns 429. What should I do?
Answer: First find out whether it is rate limiting, a budget limit or an upstream quota problem, then adjust call frequency, concurrency or resource configuration. Avoid rapid repeated retries; see 429: rate limits and quotas.
The app replies, but I cannot find the request in the LYRouter logs. What should I do?
Answer: Check the model service, model identifier and gateway address in effect for the current task, then search the request logs in the correct workspace by call time and key. Verify the actual generation request with a minimal text task; a reply in the app alone does not prove the connection works.
Official resources
Installation methods, supported environments and configuration options follow the latest official OpenAI documentation.