Cursor Custom API Keys and Base URL: A Practical Guide
As of 2026-10-07, Cursor takes your own API keys under Cursor Settings → Models, with a slot each for OpenAI, Anthropic, Google, Azure and AWS Bedrock. In Cursor's official docs this page found a Base URL override (a switch with its own field) only for the OpenAI slot, and no text saying the Anthropic slot's address can be changed. Your own keys only work with chat models; Tab completion keeps using Cursor's built-in models. For QCode, put your cr_ key in the OpenAI slot and https://api.qcode.cc/openai/v1 as the Base URL for GPT and DeepSeek, GLM, Kimi or Qwen models; for Claude, run Claude Code in Cursor's integrated terminal.
Updated 2026-10-08
Four things to know first
Providers that take your own key
The official help center lists OpenAI, Anthropic, Google, Azure and AWS Bedrock. There are four steps: open Cursor Settings → Models, find the provider, paste the key into the text field, click Save.
Slot documented with a Base URL override
The Agents Window 3.20 release notes (2026-09-10) say each provider has its own API Key field and Use API Key switch, and OpenAI also gets a Base URL override switch with its own field. As of 2026-10-07, this page found no text in Cursor's official docs saying the Anthropic slot's Base URL can be changed.
Where your own key applies
The official wording: Custom API keys only work with chat models. Tab completion continues using Cursor's built-in models. In other words, Tab never runs on your key.
Teams / Enterprise, per million tokens
On these two plans, third-party model requests made with your own key still carry the Cursor Token Rate of $0.25 per million tokens (input, output and cached); on the Pro, Pro+ and Ultra individual plans these requests don't draw from included usage.
What bringing your own key means in Cursor
As of 2026-10-07, Cursor lets you enter your own API key under Cursor Settings → Models so that provider's models run on your key, and your provider bills you directly for the model cost; the OpenAI slot is the one Cursor's docs show with a Base URL that can point somewhere else. The official help center also says your key is not stored on Cursor's servers, but it is sent to Cursor's backend with every request, because all requests go through Cursor's servers for final prompt building — so bringing your own key does not mean the editor talks to your model service directly. And with your own key, Cursor's Zero Data Retention policy does not apply; data handling follows your chosen provider's privacy policy.
Two recent official changes
On Cursor's side, Agents Window 3.20 (dated 2026-09-10 in the official release-notes feed) tidied up the key settings for OpenAI, Anthropic and Google: each provider gets its own labeled API Key field, a Use API Key switch appears once a key is saved, and OpenAI also gets a Base URL override switch with its own field; keys save when you leave the field or press Enter, and clearing the field removes a saved key. On OpenAI's side, its 2026-08-28 statement reads "we intend to wind down our contract providing OpenAI models to Cursor, with a proposed shutoff date of November 12, 2026", and adds that OpenAI will not provide future models to Cursor. The statement says nothing about users' own API keys.
Timeline
OpenAI publishes a statement: it intends to wind down its contract providing OpenAI models to Cursor, with a proposed shutoff date of 2026-11-12, and will not provide future models to Cursor.
Cursor Agents Window 3.20 ships: in Settings → Models each provider gets its own API Key field and Use API Key switch, and the OpenAI slot gains a Base URL override switch with its own field.
The proposed shutoff date in OpenAI's statement. As of 2026-10-07 this page found no matching note in Cursor's official docs.
Confirmed vs not stated officially
Confirmed (verbatim in official pages)
All of the following can be checked word for word in Cursor's official help center, docs and release notes and in OpenAI's statement: your own keys go in Cursor Settings → Models; supported providers are OpenAI, Anthropic, Google, Azure and AWS Bedrock; the OpenAI slot is described as "Standard, non-reasoning chat models", and the Anthropic slot as all Claude models available through the Anthropic API; your own keys only work with chat models and Tab stays on built-in models; if a key is invalid or rejected by the provider, requests using that provider fail until you update or remove the key; the OpenAI slot has a Base URL override switch with its own field; requests pass through Cursor's servers for prompt building; Zero Data Retention does not apply; Enterprise can block members' own keys; the Teams and Enterprise Cursor Token Rate is $0.25 per million tokens.
Not stated officially, so no guesses here
Four things are not spelled out, so don't configure by guesswork: ① whether the Anthropic slot can change its Base URL — as of 2026-10-07 this page found no such text in Cursor's official docs or release notes, so this page does not present calling Claude through a custom address in Cursor's built-in chat as a working setup; ② whether Cursor applies its standard, non-reasoning chat models limit to other models reached through the override; ③ beyond Tab, whether inline edit, Cloud Agents and other surfaces use your own key — the Cloud Agents page only says it uses a curated selection of models; ④ whether OpenAI's wind-down affects your own keys and custom Base URLs — neither OpenAI nor Cursor says.
Two ways to use QCode inside Cursor
Cursor's built-in chat + OpenAI slot override
Put your cr_ key in the OpenAI slot and https://api.qcode.cc/openai/v1 as the Base URL to use GPT and DeepSeek, GLM, Kimi or Qwen models. Requests go through Cursor's servers for prompt building first; Tab doesn't use this; Teams and Enterprise plans still carry the Cursor Token Rate. Claude can't go this way: QCode's OpenAI-compatible endpoint rejects models starting with claude- with model_not_available_on_endpoint.
Claude Code in Cursor's integrated terminal
In Cursor's integrated terminal, set ANTHROPIC_BASE_URL=https://api.qcode.cc/api and ANTHROPIC_AUTH_TOKEN (your cr_ key), then run claude. This uses QCode's Anthropic endpoint, which is where Claude models go. QCode's docs note that the two authenticate separately but share quota when they use the same key.
Steps to set up QCode in Cursor
① Open Cursor Settings → Models and find the OpenAI slot. ② Paste the cr_ key you created in the console into the API Key field (complete, no leading or trailing spaces); the key saves when you leave the field or press Enter, and a Use API Key switch then appears — make sure it is on. ③ Turn on the Base URL override switch in the same slot and enter https://api.qcode.cc/openai/v1, with no trailing slash and without dropping the /v1. ④ Add and tick the model IDs you want in the Models list, for example gpt-6.1-sol, gpt-5.6-terra, deepseek-v4.1-flash or glm-5.3; IDs are case-sensitive, and restarting Cursor once refreshes the list. ⑤ Test from the command line: request https://api.qcode.cc/openai/v1/models with Authorization: Bearer and your key — a JSON list means the address and key are both right. ⑥ For Claude, don't add claude- IDs here; run Claude Code in the integrated terminal instead (see the section above).
On QCode
On QCode, one cr_ key works across protocols, and the request path decides which protocol is used. The https://api.qcode.cc/openai/v1 address in Cursor's OpenAI slot is the OpenAI-compatible endpoint, for GPT models (such as gpt-6.1-sol, gpt-6-sol and gpt-5.6-terra) and DeepSeek, GLM, Kimi and Qwen models (such as deepseek-v4.1-flash, glm-5.3, kimi-k3 and qwen3.8-max). Claude models only use the Anthropic endpoint https://api.qcode.cc/api; inside Cursor, use Claude Code in the integrated terminal, with claude-sonnet-5-5 or claude-opus-5-5 as the model. Billed per token; per-model prices are on /models.
Frequently asked questions
Can I set a custom Base URL in Cursor, and where?
Yes, in the OpenAI slot; as of 2026-10-07 that is the only slot for which this page found a Base URL override in Cursor's official docs. Open Cursor Settings → Models: the OpenAI slot has a Base URL override switch with its own field, as the Agents Window 3.20 release notes put it. For Anthropic, Google and the other slots, this page found no official text about changing the address; the docs only describe entering an API key. Cursor's privacy docs call this setup a custom model reached via an OpenAI-compatible base URL override.
Which features don't work with my own API key?
Tab completion won't use your key. The official wording is "Custom API keys only work with chat models. Tab completion continues using Cursor's built-in models." Other surfaces aren't listed one by one; the Cloud Agents page only says it uses a curated selection of models and doesn't say whether your own key applies. Enterprise admins can also block members from using their own keys in team settings.
Can Cursor use my own Claude API key? What about Claude through QCode?
Your own Anthropic key, yes: put it in the Anthropic slot, which the docs describe as all Claude models available through the Anthropic API. For Claude through QCode, don't use the OpenAI slot: QCode serves Claude only on its Anthropic endpoint, and its OpenAI-compatible endpoint returns model_not_available_on_endpoint (that error means the wrong protocol, not a bad key; a bad key returns Invalid API key). To use QCode's Claude inside Cursor, run Claude Code in the integrated terminal with ANTHROPIC_BASE_URL set to https://api.qcode.cc/api.
Does my own key still use Cursor usage or cost anything in Cursor?
Not on individual plans; on Teams and Enterprise, yes. On the Pro, Pro+ and Ultra individual plans, no: your provider bills the model cost and those requests don't draw from your included usage. On Teams and Enterprise, yes: every third-party model request carries the Cursor Token Rate of $0.25 per million tokens (input, output and cached), including requests made with your own key, shown under Other Models; Cursor's own models such as Grok and Composer are exempt.
With my own key, do requests go straight to my model service?
No. The official help center says your key is not stored on Cursor's servers, but it is sent to Cursor's backend with every request because all requests go through Cursor's servers for final prompt building, and the key is not persisted after the request completes. Zero Data Retention does not apply with your own keys; Enterprise US data residency does not cover BYOK either, and a custom model reached via an OpenAI-compatible base URL override carries the region of that gateway or model.
OpenAI plans to stop supplying models to Cursor. Does that affect my own key?
Neither company has said. OpenAI's 2026-08-28 statement only says it intends to wind down its contract providing OpenAI models to Cursor, with a proposed shutoff date of 2026-11-12, and that it will not provide future models to Cursor; it does not mention users' own keys or custom Base URLs. As of 2026-10-07 this page found no matching note in Cursor's official docs, so go by both companies' official announcements when the date comes.
Sources
Cursor: the official help center's Bring your own API key and Cursor Token Rate pages; the official docs on enterprise privacy and data governance, model and integration management, and Cloud Agents; the Agents Window release notes and the release-notes RSS feed (3.20, 2026-09-10); plus a search across every official docs page listed in cursor.com/llms.txt, all crawled 2026-10-07. OpenAI: the statement "Our decision on Cursor following its acquisition by SpaceX" (2026-08-28) on openai.com, read from Internet Archive copies dated 2026-08-29 and 2026-09-13 (identical text) because direct access was blocked, checked on 2026-10-07. QCode: the Cursor setup page and the endpoints and API paths page in the QCode docs (both updated 2026-09-25), crawled the same day.
One cr_ key for Cursor and Claude Code
GPT and DeepSeek, GLM, Kimi or Qwen models go in Cursor's OpenAI slot, and Claude goes through Claude Code on the Anthropic endpoint; billed per token, with per-model prices on /models.
Related reading
Cursor's Two Usage Pools Explained
The Cursor Models pool vs the Other Models pool, and the reset rules.
What to check on the Cursor Auto pricing change
A billing-definition checklist and a predictable-cost alternative.
Claude Code vs Cursor: in-depth comparison
Models, context window, execution mode, pricing and agent capabilities compared.
The steps and quotes on this page were checked on 2026-10-07 against Cursor's official docs and release notes and OpenAI's official statement; upstream changes may happen without notice. Cursor's settings screen changes between versions, so go by the labels in your version; model availability is whatever /models shows.