# Codex extension (VS Code / Cursor / Trae)

> Connect to the LMU AI API in editors like VS Code, Cursor, and Trae via the Codex extension, using Claude / Codex over an OpenAI-compatible interface.

URL: https://docs.lmuai.ai/docs/tools/vscode-plugin



<Callout type="info" title="If you use the Trae editor">
  If you want to use &#x2A;*Claude or Chinese models (GLM / Qwen, etc.)**, Trae has a simpler native method (no extension, just a few clicks in the GUI) — see [Trae native model configuration](/docs/tools/trae).

  The Codex extension method on this page suits users who want to use the **GPT / Codex** series.
</Callout>

***

## Common errors [#common-errors]

**Error: after configuring, you get a 401 saying the key is incorrect**

Cause: the request is still going to the official OpenAI backend rather than our API relay, or you haven't restarted the tool to reload the config file.

Fix: follow the guide again to **create or replace** the two files `config.toml` and `auth.json`, then restart the IDE tool.

<Callout type="info" title="When you hit an error">
  Screenshot the error message and translate it — you'll be able to tell what caused the error yourself!
</Callout>

***

## Configuration [#configuration]

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

Config file location:

* **Mac/Linux**: the `~/.codex/` directory
* **Windows**: the `C:\users\YourUsername\.codex\` directory

<Callout type="warn" title="Windows note">
  If you previously signed in with the official account or another platform, sign out first, then configure!
</Callout>

If you don't have a `.codex` folder, create it with a terminal command:

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

```powershell
# Windows (run in the terminal)
rm -rf C:\users\YourUsername\.codex
mkdir C:\users\YourUsername\.codex
```

### Step 2 — Write config.toml [#step-2--write-configtoml]

In the `.codex` directory, create or overwrite `config.toml`:

```toml
model_provider = "OpenAI"
model = "gpt-5.4"
review_model = "gpt-5.4"
model_reasoning_effort = "xhigh"
disable_response_storage = true
network_access = "enabled"
windows_wsl_setup_acknowledged = true
model_context_window = 1000000
model_auto_compact_token_limit = 900000

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

### Step 3 — Write auth.json [#step-3--write-authjson]

In the `.codex` directory, create or overwrite `auth.json`:

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

Once configured, open VS Code, Cursor, or Trae, and the Codex extension inside will sign in automatically.

***

## Installing the Visual Studio Code extension [#installing-the-visual-studio-code-extension]

### Install the extension [#install-the-extension]

1. Open VS Code and first open any project folder as your workspace (&#x2A;*otherwise a popup will prompt you to open a project folder!**)
2. Click the extensions panel on the left (the Extensions icon)
3. Search for **Codex**, find OpenAI's official extension "Codex – OpenAI's coding agent", and click Install
4. After installing, a Codex entry appears in the left sidebar (if not, look in the top-right of the interface)

### Sign out of the old account [#sign-out-of-the-old-account]

<Callout type="warn" title="Important">
  If you previously signed in with the official account or another platform, sign out first, then configure!
</Callout>

1. Click the settings icon in the top-right of the Codex panel
2. Click **Log out** to sign out

### Finish the configuration [#finish-the-configuration]

After setting up `config.toml` and `auth.json`, reopen the Codex extension and click **Continue** to complete the sign-in flow.

<Callout type="info" title="About model display">
  The GPT-5.3 model doesn't appear in the dropdown; hover over "Custom" to see the model currently in use.

  You can also check the actual requested model in the console under "Usage records".
</Callout>

***

## Want to use Claude or Chinese models? [#want-to-use-claude-or-chinese-models]

If you only use Trae and your goal is models like **Claude / GLM / Qwen**, you don't need the Codex extension — the [Trae native model configuration](/docs/tools/trae) (Anthropic protocol, just fill in a few fields in the GUI) is simpler.
