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.
If you use the Trae editor
If you want to use 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.
The Codex extension method on this page suits users who want to use the GPT / Codex series.
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.
When you hit an error
Screenshot the error message and translate it — you'll be able to tell what caused the error yourself!
Configuration
Step 1 — Create / overwrite the config files
Config file location:
- Mac/Linux: the
~/.codex/directory - Windows: the
C:\users\YourUsername\.codex\directory
Windows note
If you previously signed in with the official account or another platform, sign out first, then configure!
If you don't have a .codex folder, create it with a terminal command:
# Mac/Linux
rm -rf ~/.codex && mkdir ~/.codex# Windows (run in the terminal)
rm -rf C:\users\YourUsername\.codex
mkdir C:\users\YourUsername\.codexStep 2 — Write config.toml
In the .codex directory, create or overwrite config.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.com"
wire_api = "responses"
requires_openai_auth = trueStep 3 — Write auth.json
In the .codex directory, create or overwrite auth.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
Install the extension
- Open VS Code and first open any project folder as your workspace (otherwise a popup will prompt you to open a project folder!)
- Click the extensions panel on the left (the Extensions icon)
- Search for Codex, find OpenAI's official extension "Codex – OpenAI's coding agent", and click Install
- 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
Important
If you previously signed in with the official account or another platform, sign out first, then configure!
- Click the settings icon in the top-right of the Codex panel
- Click Log out to sign out
Finish the configuration
After setting up config.toml and auth.json, reopen the Codex extension and click Continue to complete the sign-in flow.
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".
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 (Anthropic protocol, just fill in a few fields in the GUI) is simpler.
Last updated:
Get an LMU AI key and start using Claude, Codex and more
Free sign-up, flexible plans, one key across Claude Code, Codex CLI, Cursor, VS Code, OpenCode, Cherry Studio and other AI tools.
Sign upHermes Agent
Connect Hermes Agent to LMU AI — edit ~/.hermes/config.yaml with a base_url that includes /v1 and your sk- key to switch to any available model.
Configure Cursor with a third-party API
Configure a third-party API in Cursor — turn on Override OpenAI Base URL, enter your sk- key, and use Claude, GPT, and more in the Chat panel.