# Codex App (Desktop)

> Configure the LMU AI API base URL and key in the Codex App desktop client — works on both Windows and Mac.

URL: https://docs.lmuai.ai/docs/tools/codex-app



If you don't want to install the Codex CLI and just want to use the **Codex App desktop client**, follow this method.

<Callout type="warn" title="Note">
  * If you've previously signed in with your own account, first **sign out of the current account** in the Codex App, then reconfigure.
  * After you switch the API, your chat history will be gone (account-type chat history is stored in your GPT account's space, not locally).
  * **After you switch to the API login, all chat history from then on is saved locally and won't be lost!**
</Callout>

***

## Step 1 — Create the config files [#step-1--create-the-config-files]

Config file location:

* **Mac/Linux**: the `.codex` folder in your home directory (`~`)
* **Windows**: `C:\users\your-username\.codex\`

If the folder already exists, it's best to delete the `auth.json` and `config.toml` inside it and recreate them, to avoid interference from old config.

**Create the folder with a terminal command:**

```bash
# Mac/Linux
rm -rf ~/.codex && mkdir ~/.codex
```

Create two files in the `.codex` folder:

### auth.json [#authjson]

Holds your API key:

```json
{
  "OPENAI_API_KEY": "your sk- key generated in the console"
}
```

### config.toml [#configtoml]

Configure the service provider:

```toml
model = "gpt-5.4"
model_reasoning_effort = "xhigh"
disable_response_storage = true
sandbox_mode = "danger-full-access"
windows_wsl_setup_acknowledged = true
approval_policy = "never"
file_opener = "vscode"
model_provider = "codex"
web_search = "cached"
suppress_unstable_features_warning = true

[history]
persistence = "save-all"

[tui]
notifications = true

[shell_environment_policy]
inherit = "all"
ignore_default_excludes = false

[sandbox_workspace_write]
network_access = true

[features]
plan_tool = true
apply_patch_freeform = true
view_image_tool = true
unified_exec = false
streamable_shell = false
rmcp_client = true
elevated_windows_sandbox = true

[profiles.auto-max]
approval_policy = "never"
sandbox_mode = "workspace-write"

[profiles.review]
approval_policy = "on-request"
sandbox_mode = "workspace-write"

[notice]
hide_gpt5_1_migration_prompt = true

[model_providers.codex]
name = "codex"
base_url = "https://api.lmuai.ai"
wire_api = "responses"
requires_openai_auth = true
```

<Callout type="info">
  It's usually inside the `.codex` folder in your home directory. If you can't find the `.codex` folder there, you can create the folder manually, along with `config.toml` and `auth.json`.

  The config file contents are identical to the [Codex CLI Mac/Linux setup guide](/docs/tools/codex-cli-mac) — you can follow that guide to create them in the terminal, and they take effect after restarting the Codex App just the same.
</Callout>

***

## Step 2 — Reopen the Codex App [#step-2--reopen-the-codex-app]

After saving the config files, reopen the Codex App and it will sign in and be ready to use automatically.

***

## Enabling the 1M context (optional) [#enabling-the-1m-context-optional]

`gpt-5.4` supports a 1M-token long context, but it's off by default. Add two lines at the **top level** of the `config.toml` above (before any `[section]`), then restart the Codex App:

```toml
model_context_window = 1000000
model_auto_compact_token_limit = 900000
```

For field meanings, how to verify, and caveats, see [Enabling the 1M context in Codex](/docs/tools/codex-cli-mac#enabling-the-1m-context-in-codex-optional).

***

## Common errors [#common-errors]

**Error 401, incorrect key:**

Cause: the request is still going to OpenAI's official endpoint rather than our API relay, or you didn't restart the tool to reload the config file.

Fix: follow the guide again to create or replace the `config.toml` and `auth.json` files, then reopen the app.
