# ChatGPT: install, configure and troubleshoot LYRouter access

Source: https://platform.lyrouter.com/ai_gateway/docs/chatgpt/en
Last updated: 2026-10-14

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](https://learn.chatgpt.com/docs/enterprise/connect-to-a-gateway). 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](#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.

**Choose your operating system**

Windows:
Use the official Windows desktop app, and have PowerShell and installation permission ready. Open the download link from the [official Windows guide](https://learn.chatgpt.com/docs/windows/windows-app). To install from the command line, first make sure `winget` is available:

```powershell
winget --version
```

This page configures native Windows. The CLI in WSL uses a separate Linux user directory and does not automatically share this configuration.

Linux:
The official Linux desktop app is currently a preview. Follow the [official Linux guide](https://learn.chatgpt.com/docs/linux/linux-app) to make sure your distribution and processor are supported, and prepare a graphical desktop, a terminal and permission to install packages:

```bash
cat /etc/os-release
uname -m
```

Choose the `.deb`, `.rpm` or official Arch installation path for your distribution, and the package for x64 / ARM64.

macOS:
Choose the installer for your device from the [official desktop app page](https://learn.chatgpt.com/docs/app); the page currently offers an Apple Silicon download. Prepare Terminal and write permission to the applications directory, then check your system and architecture:

```bash
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](https://platform.lyrouter.com/ai_gateway/docs/api-keys/en), plus a model and service source that support [Responses](https://platform.lyrouter.com/ai_gateway/docs/responses-api/en) in the workspace the key belongs to. Permissions for the app account and the LYRouter account are managed separately.

## Install the app

**Install for your operating system**

Windows:
Open the Microsoft Store download from the [official Windows guide](https://learn.chatgpt.com/docs/windows/windows-app) and install the app, or run the official command in PowerShell:

```powershell
winget install --id 9PLM9XGG6VKS -s msstore
```

After installation, open ChatGPT from the Start menu.

Linux:
Download the package for your architecture from the [official Linux guide](https://learn.chatgpt.com/docs/linux/linux-app). x64 example for Ubuntu / Debian:

```bash
cd ~/Downloads
sudo apt install ./chatgpt_amd64.deb
chatgpt
```

For ARM64, use `chatgpt_arm64.deb`. x64 example for Fedora:

```bash
cd ~/Downloads
sudo dnf install ./chatgpt.x86_64.rpm
chatgpt
```

For ARM64, use `chatgpt.aarch64.rpm`. For Arch, follow the official guide.

macOS:
1. Download the macOS installer from the [official desktop app page](https://learn.chatgpt.com/docs/app).
2. Open the installer and move the app into the "Applications" folder.
3. 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` |

```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_ID` with a system model identifier that is available in the current workspace and supports [Responses](https://platform.lyrouter.com/ai_gateway/docs/responses-api/en); see [Model identifiers and discovery](https://platform.lyrouter.com/ai_gateway/docs/model-names/en).
- Put `model`, `model_provider` and `web_search` before the first TOML table header.
- `base_url` includes `/v1`. Do not enter the console address or the full `/v1/responses` endpoint.
- 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](https://platform.lyrouter.com/ai_gateway/docs/api-keys/en) 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.

**Set the API key**

macOS:
Run the following command in Terminal, then quit the desktop app completely and reopen it:

```bash
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.

Windows:
Set a user environment variable in PowerShell:

```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.

Linux:
Run the following in the terminal you start the desktop app from:

```bash
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](https://platform.lyrouter.com/ai_gateway/docs/logs/en) 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](https://platform.lyrouter.com/ai_gateway/docs/model-names/en) and [Responses](https://platform.lyrouter.com/ai_gateway/docs/responses-api/en).

### 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](https://platform.lyrouter.com/ai_gateway/docs/auth-errors/en).

### 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](https://platform.lyrouter.com/ai_gateway/docs/rate-errors/en).

### 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](https://platform.lyrouter.com/ai_gateway/docs/logs/en) 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.

- [ChatGPT desktop app and macOS download](https://learn.chatgpt.com/docs/app)
- [Windows installation guide](https://learn.chatgpt.com/docs/windows/windows-app)
- [Linux installation guide](https://learn.chatgpt.com/docs/linux/linux-app)
- [Model gateway configuration](https://learn.chatgpt.com/docs/enterprise/connect-to-a-gateway)
- [Configuration reference](https://learn.chatgpt.com/docs/config-file/config-reference)
