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

  1. You have created an API key and saved the full key.
  2. You have a model ID from the model marketplace.
  3. Your Cursor build supports custom models (Settings → Models shows an “Add Model” button).

Configure

  1. Open settings: ⌘⇧J (macOS) / Ctrl⇧J (Windows, Linux), or ⌘⇧PCursor Settings.

  2. Go to ModelsModel Names+ Add Model, type the model ID you want and press Enter.

  3. On the same page under API KeysOpenAI API Key, click + and paste your OLETOKEN key.

  4. Turn on Override OpenAI Base URL and enter the OpenAI-compatible address including /v1:

    https://<your-base-url>/v1
    

    Cursor appends /chat/completions to it, so /v1 is not optional.

  5. 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.

  6. Back in the editor press ⌘L / Ctrl+L to 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

SymptomCause and fix
Verify failsA false alarm for non-OpenAI model names — test in Chat
401The key was pasted incomplete or is disabled; copy it again
404Override OpenAI Base URL is missing /v1
New model missing in ChatThe model ID is misspelled, or you did not switch to it in the Chat model dropdown
Insufficient balanceTop up first