Skip to navigation
DocsCursor setup: use your own key with an OpenAI base URL override

Coding tools

Cursor setup: use your own key with an OpenAI base URL override

In short: Cursor supports our gateway through its OpenAI API key and Override OpenAI Base URL settings, giving Chat and Agent access to Claude, GPT, Grok and GLM models.

Updated OpenAI formatIDEView .md
On this page
Base URLhttps://api.oneaiapikey.com/v1

Cursor lets you bring your own OpenAI-format key and point it at a different base URL. Because our gateway speaks the OpenAI Chat Completions format for every model in the catalogue, one key and one URL give Cursor access to Claude, GPT, Grok and GLM, all billed from the same prepaid balance.

What do I need to use Cursor with the gateway?

Using Cursor with the gateway needs three things:

  • The Cursor desktop app, signed in.
  • A funded account: any balance above $0, the sign-up credit included, pays for every model; when it runs out, add $1 or more (sign up here).
  • An API key from the console, starting with sk-.

What does Cursor’s bring-your-own-key cover?

Bring-your-own-key covers local Chat and Agent requests only, so be aware of how Cursor routes requests and nothing will surprise you later:

  • Your key and base URL are used for local Chat and Agent requests with the models you enable.
  • Cursor’s own features such as Tab autocomplete, Auto model selection, cloud or background agents and the Cursor CLI keep using Cursor’s infrastructure. They don’t go through your key.
  • Override OpenAI Base URL is a single global switch. While it’s on, OpenAI-family requests go to the overridden URL, including some of Cursor’s built-in models. Turn it off when you want to go back to models from your Cursor plan.

How do I open Cursor’s model settings?

Open Cursor Settings (the gear icon in the top-right corner, or Ctrl+Shift+J / Cmd+Shift+J). Make sure you’re in Cursor’s own settings, not the VS Code-style editor settings: only Cursor Settings has a Models section. Select Models and scroll to the API Keys area.

How do I add the key and override the base URL?

Add the key and override the base URL in the OpenAI section:

  1. Turn on OpenAI API Key and paste your sk- key.
  2. Turn on Override OpenAI Base URL and enter the URL below, including /v1:
Override OpenAI Base URL
https://api.oneaiapikey.com/v1
  1. Click Verify (or save). Cursor sends a small test request; a success message means the key and URL were accepted.

How do I add models to Cursor?

Back in the model list, click Add Custom Model (labelled + Add model in some versions) and type a model id exactly as it appears in our catalogue. Add as many as you like, then make sure each one is toggled on. Good choices for Cursor (USD per 1M tokens):

Model idGood forInputOutput
claude-sonnet-5-5Daily coding, Coding agents, Code review$1.40$7
claude-opus-5-5Agentic coding, Large refactors, Complex reasoning$2.80$14
gpt-6.1-solCodex CLI, Tool calling, Long context$0.70$3.50
grok-4.7Research, Tool calling, Long context$1.40$4.20
glm-5.3-flashQuick answers, Drafting, Sub-agents$0.07$0.21

claude-sonnet-5-5 is a great everyday Agent model; reach for claude-opus-5-5 on big refactors and glm-5.3-flash when you want to keep costs low. See the full catalogue on the models page.

If Cursor replies that a model already exists, the id matches one of Cursor’s built-in entries. Don’t add a duplicate: simply enable the built-in entry. With the override on, Cursor sends that lowercase id to our gateway unchanged.

How do I verify Cursor is using the gateway?

Verify the setup with an optional but quick check outside Cursor: list the models your key can use.

curl
curl -sS https://api.oneaiapikey.com/v1/models -H "Authorization: Bearer sk-your-key-here"
PowerShell
Invoke-RestMethod -Uri "https://api.oneaiapikey.com/v1/models" -Headers @{ Authorization = "Bearer sk-your-key-here" }

Then open a Chat or Agent panel, choose one of the models you added from the model picker, and send a short prompt. The reply should arrive normally, and the request will appear in the usage log in your console within a few seconds. If you see the request there, routing works.

How do I fix common Cursor errors?

The common Cursor errors and their fixes are listed below.

Verify fails or chat shows 401 / invalid API key. Re-copy the key from the console and paste it without spaces. Confirm the key isn’t disabled and your balance is above zero. If you recently rotated the key, update it in Cursor too.

404 or a generic network error. Check the override URL. It must be https://api.oneaiapikey.com/v1, with /v1 and without a trailing slash or an endpoint path such as /chat/completions.

“Model not found” or “the requested model is not available”. The custom model name doesn’t match a catalogue id. Ids are case-sensitive and use the exact dots and dashes shown above. Also check that the model is toggled on.

Cursor’s built-in models stopped working. That’s the global override at work: OpenAI-family requests are going to our gateway. Turn off Override OpenAI Base URL while you use your Cursor plan models, and turn it back on when you switch back.

Tab completions don’t show up in my usage log. Expected. Tab always runs on Cursor’s own models, whatever key you configure.

Long answers stop partway. Cursor streams responses, which keeps long generations alive. If you call the API from your own code, set "stream": true for long outputs, since proxies cut idle non-streaming requests at about 100 seconds.

Next steps

Using a terminal agent too? See the Claude Code and Codex CLI guides, or browse all tool guides. Prices for every model are on the pricing page.

↑ ↓ moveEnter openEsc close
New accounts$10 credit on sign-up
Claim $10 credit →