Use your key in Cursor
Override the OpenAI Base URL, add custom models, and know which Cursor features still use its own backend.
Cursor supports bring-your-own-key (BYOK): set an OpenAI-compatible base URL plus your OLETOKEN key, and requests from Chat run against your OLETOKEN balance.
Before you start
- You have created an API key and saved the full key.
- You have a model ID from the model marketplace.
- Your Cursor build supports custom models (Settings → Models shows an “Add Model” button).
Configure
-
Open settings:
⌘⇧J(macOS) /Ctrl⇧J(Windows, Linux), or⌘⇧P→Cursor Settings. -
Go to Models → Model Names → + Add Model, type the model ID you want and press Enter.
-
On the same page under API Keys → OpenAI API Key, click + and paste your OLETOKEN key.
-
Turn on Override OpenAI Base URL and enter the OpenAI-compatible address including
/v1:https://<your-base-url>/v1Cursor appends
/chat/completionsto it, so/v1is not optional. -
Click Verify. For model names that are not OpenAI's own, verification may fail — that is a false alarm; send a message in Chat to test instead.
-
Back in the editor press
⌘L/Ctrl+Lto open Chat and pick your model in the model dropdown.
Good to know
- Only Chat and Plan are covered. Composer, Tab completion and Inline Edit still run on Cursor's own backend and do not spend your OLETOKEN balance.
- Your built-in Anthropic models may be affected. With Override OpenAI Base URL on, Cursor's bundled Claude models can be routed to this site too. If you still want the official ones, add the Claude model IDs as custom models with + Add Model and select those in the dropdown.
- To revert: turn Override OpenAI Base URL off. The key and model entries can stay.
- You can also install the Claude Code extension in Cursor (Cursor accepts the VS Code marketplace) — see using VS Code. That route speaks the Anthropic Messages protocol and is not limited to Chat / Plan.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| Verify fails | A false alarm for non-OpenAI model names — test in Chat |
| 401 | The key was pasted incomplete or is disabled; copy it again |
| 404 | Override OpenAI Base URL is missing /v1 |
| New model missing in Chat | The model ID is misspelled, or you did not switch to it in the Chat model dropdown |
| Insufficient balance | Top up first |

