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.
Cursor can point the Chat / Plan panel's requests at a third-party relay API via Override OpenAI Base URL. This page explains how to use that native method to connect to LMU AI.
Key limitation: only the Chat / Plan panel is affected
Cursor's Override OpenAI Base URL only affects the Chat / Plan panel (the conversation opened with Cmd/Ctrl + L). Cursor's core agent features — Composer, Tab autocomplete, Apply, Inline Edit — are all locked to the Cursor official backend and cannot be taken over by a third-party relay.
If you need a "full-capability" agent experience in Cursor (including Composer-type features), install instead (Cursor is compatible with the VS Code extension marketplace):
- Official Codex extension — a Codex agent over the LMU AI OpenAI protocol
- Claude Code for VS Code extension — a Claude Code agent over the LMU AI Anthropic protocol
Configuration steps
Step 1 — Open Cursor Settings
Press Cmd + Shift + J (macOS) or Ctrl + Shift + J (Windows / Linux) to open Settings, and click Models in the left sidebar.
Step 2 — Turn off the default models (recommended)
Cursor ships with many default models (GPT-4 / Claude-3.5, etc.); leaving them enabled conflicts with custom routing. In the model list on the Models page, turn them all off (toggle grayed out on the left).
Step 3 — Add custom models
Click Add Model and enter the LMU AI model IDs you want, for example:
claude-opus-5claude-sonnet-5gpt-5.6-solglm-5.2qwen3.8-max-previewdeepseek-v4-prokimi-k3
Add each model once. For the full list of available models, see the Model Gallery.
Step 4 — Turn on Override OpenAI Base URL
Scroll to the OpenAI API Key area on the Models page:
- Turn on the OpenAI API Key toggle
- Paste the LMU AI console key (starts with
sk-) into the API Key box - Turn on the Override OpenAI Base URL toggle
- Set Base URL to:
https://api.lmuai.com/v1 - Click Verify to check the connection
A failed Verify doesn't mean it's misconfigured
Cursor's Verify checks using the model name you entered, and non-official OpenAI names (claude-opus-5, glm-5.2, etc.) won't pass. Workaround: add a gpt-4 first to pass Verify (confirming the Base URL + key connect), then add the custom model IDs you want separately; Verify warns but it runs fine in practice.
Step 5 — Switch model and use it
Press Cmd/Ctrl + L to open the Chat panel → pick the custom model you added in Step 3 from the model dropdown at the top → start chatting, and requests will go through LMU AI.
Common model IDs
| Model ID | Description |
|---|---|
claude-opus-5 | Claude Opus 5 (flagship, recommended) |
claude-sonnet-5 | Claude Sonnet 5 (balanced) |
claude-haiku-4-5 | Claude Haiku 4.5 (high-speed) |
gpt-5.6-sol | GPT-5.6 Sol |
glm-5.2 | Zhipu GLM-5.2 |
qwen3.8-max-preview | Qwen 3.8 Max Preview |
deepseek-v4-pro | DeepSeek V4 Pro |
kimi-k3 | Kimi K3 |
claude-opus-4-8 | Claude Opus 4.8 (previous generation) |
claude-sonnet-4-6 | Claude Sonnet 4.6 (previous generation) |
gpt-5.5 | GPT-5.5 (previous generation) |
glm-5.1 | Zhipu GLM-5.1 (previous generation) |
For the full list, see the Model Gallery.
Common issues
Want Composer / Tab autocomplete to use LMU AI too?
Native Override OpenAI Base URL can't do it — these Cursor core features are locked to the official backend. To route everything through LMU AI, use:
- Official Codex extension — an OpenAI-protocol agent
- Claude Code for VS Code extension — an Anthropic-protocol agent
Cursor is compatible with the VS Code extension marketplace, so both extensions install directly in Cursor.
Does the Base URL need /v1?
Yes. Enter https://api.lmuai.com/v1. Cursor appends /chat/completions for a final request to https://api.lmuai.com/v1/chat/completions. Omitting /v1 gives a 404.
Built-in Claude 3.5 errors out after turning on Override?
This is a known Cursor routing conflict — turning on the OpenAI Base URL override interrupts the Anthropic branch. To keep using Claude in the Chat panel, add the Claude model ID (e.g. claude-opus-5) as a custom model, and the LMU AI backend does the OpenAI ↔ Anthropic protocol translation.
401 / 403 errors?
Check in order:
- Is the API Key the
sk-key generated in the LMU AI console (not an official OpenAI key)? - Is the Base URL
https://api.lmuai.com/v1(must include/v1)? - Is the model ID one LMU AI supports (see the Model Gallery)?
- Does your current plan / billing group include the model you're calling?
Does BYOK affect my Cursor subscription?
- BYOK usage does not consume Cursor's monthly fast-request quota
- Core features like Composer / Tab autocomplete still consume the Cursor subscription quota (because they don't use BYOK)
- To drop the Cursor subscription entirely, see the Codex / Claude Code extension approach above
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 upCodex 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.
Configure Trae with a third-party API
Configure a third-party API in Trae (LMU AI relay) — no plugin; in Settings → Models → Add Model, choose Anthropic and enter the request URL and sk- key.