Cursor

Cursor can send its chat requests to an OpenAI-compatible endpoint when you give it your own API key and base URL. The Model API answers them at POST /v1/chat/completions. Cursor keeps these settings in its own window, not in a file, so the setup is a few clicks. The model is auto, which picks a model of the catalogue for the conversation.

What the override covers

Cursor's Override OpenAI Base URL applies to every OpenAI-format request and speaks only Chat Completions.

Cursor modelGoes through the Model API?
Model names you add yourself, auto among themYes
Cursor's own OpenAI modelsYes, while the override is on
Cursor's own Claude, Gemini, Grok and Composer modelsNo, they stay on Cursor's backend
Tab autocomplete, Apply and inline editNo, they stay on Cursor's backend

Cursor sends a request with a custom base URL from its own servers: the Model API key and the prompts pass through Cursor's backend, as with any key of your own in Cursor.

1. Create a key

In the developer console, open API keys, keep Model API key in the Access field and create the key. Copy it: the secret is shown once.

2. Configure Cursor

  1. Open Cursor Settings (Cmd+Shift+J on macOS, Ctrl+Shift+J elsewhere), go to Models and expand API Keys.
  2. Paste the key into OpenAI API Key and turn on Use OpenAI API Key.
  3. Turn on Override OpenAI Base URL and set it to https://api.samreshuuu.ru/v1.
  4. With Add or search model, add auto, and any other id from the Models page typed exactly as GET /v1/models lists it.
  5. Pick the model in the chat's model picker.

You add the models yourself, so a new model of the catalogue does not appear in Cursor until you add it the same way.

3. Check the connection

Send a prompt in the chat on auto. The call shows up in the call log of the console with the model auto picked and its cost. Tools of the agent mode travel as OpenAI functions; a reasoning level Cursor sends goes on as reasoning_effort.

Undo the setup

On the same settings page, turn off Use OpenAI API Key and Override OpenAI Base URL, or put back the key and address you had before, and remove the models you added.

Troubleshooting

What you seeWhat to check
"Invalid API key"The key was pasted wrong or revoked. Check it under API keys in the console.
Cursor cannot find the resourceCursor got a 404 from the address. The address ends in /v1 with nothing after it.
Cursor says the model does not existThe id is misspelled or not in the catalogue: copy it from GET /v1/models.
A request on auto never reaches the call logCursor took the name for a model of its own: check that the override is on, then remove and add auto again.
Requests go to OpenAIOverride OpenAI Base URL is off, or the address has no /v1.
HTTPtypeCodemessageRetry
401authentication_errorinvalid_api_keyThe API key is unknown, disabled, revoked or expired. Switch a disabled key back on in the developer console; create a new one in place of a revoked or expired key.no
404not_found_errormodel_not_foundThe model does not exist. GET /v1/models lists the models this API sells.no
400invalid_request_errorno_auto_modelNo model meets the request for auto.no
402billing_errorinsufficient_balanceThe organization balance does not cover this request (max_tokens is held in full until the answer is settled). Top up the balance or lower max_tokens.no
402billing_errorkey_limit_exceededThis API key has reached its spending limit. Raise the limit or use another key.no

If an error persists, write to support with the x-request-id of the answer.

Frequently asked questions

Does Tab autocomplete go through the Model API?

No. Tab, Apply and inline edit stay on Cursor's backend, as do Cursor's own Claude, Gemini, Grok and Composer models. Only OpenAI-format chat requests follow the base URL override.

Do my prompts reach the Model API directly?

No. Cursor sends a request with a custom base URL from its own servers, so the key and the prompts pass through Cursor's backend, as with any key of your own in Cursor.

Was this page helpful?