How to use Cursor through one API
Cursor is one of the best AI coding editors around, but it gets expensive and fiddly fast: separate billing, per-provider keys, and rate limits that hit right when you are in flow. The fix is simple. Point Cursor at a single OpenAI-compatible endpoint and reach every major model from one account.
This guide shows how to wire Cursor to AnyModel so you can switch between GPT, Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok by changing one field — the model id.
Why route Cursor through one API
Cursor talks to any backend that speaks the OpenAI Chat Completions format. AnyModel exposes exactly that: one base URL, one API key, every model behind it.
- One key, all models. No juggling OpenAI, Anthropic, and Google accounts.
- Switch models instantly. Change the
modelid, nothing else. - No subscription. Pay per token, no monthly minimums, no credit card to start.
- Free headroom. 1,000,000 tokens on signup, up to 6,000,000 total if you link Telegram.
If you want to see the full catalog of model ids first, check the models list. To weigh price and capability side by side, the compare page helps you pick before you commit.
Step 1: Get your API key
Create an account and copy your key from the dashboard. Signup is free and gives you a million tokens to test with — enough to run Cursor for real work before spending anything.
Grab a key here: /app/register.
Step 2: Configure Cursor
Cursor is not one of our one-line install tools (those are codex, claude, opencode, and hermes). For Cursor you use the standard manual OpenAI-compatible setup, which takes about a minute.
- Open Cursor Settings (
Cmd/Ctrl + Shift + J). - Go to Models (or AI depending on version).
- Find OpenAI API Key and enable Override OpenAI Base URL.
- Set the base URL to:
https://anymodel.org/v1
- Paste your AnyModel key into the API key field.
- Add the model ids you want under custom models — for example
gpt-5,claude-opus-4-8,gemini-2.5-pro, ordeepseek-v3. - Click Verify, then save.
That is it. Cursor now sends every chat, edit, and Composer request through AnyModel.
Step 3: Switch models on the fly
Once your models are added, use the model picker in the Cursor chat or Composer panel. Pick a fast, cheap model for autocomplete-style edits and a stronger reasoning model for refactors or architecture questions. Because billing is unified, there is no penalty for mixing — you pay per token regardless of which model answered.
A practical setup many developers use:
| Task | Suggested model type |
|---|---|
| Quick edits, renames | A small, cheap model |
| Whole-file refactors | A mid-tier general model |
| Hard bugs, architecture | A top reasoning model |
| Long-context reviews | A large-context model |
Verify it works from the terminal
Before debugging Cursor's UI, confirm the endpoint and key are good with a plain request:
curl https://anymodel.org/v1/chat/completions \
-H "Authorization: Bearer $ANYMODEL_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"gpt-5","messages":[{"role":"user","content":"hello"}]}'
If you get a normal completion back, any failure inside Cursor is a settings issue — usually a typo in the base URL or a model id Cursor has not been told about.
A note on privacy
Routing through a gateway means your prompts pass through it. If that matters for proprietary code, enable Ghost Mode — opt-in, zero-retention keys where we keep only a token counter, not your prompts or responses. To be clear, this is not "100% private": the underlying model provider still receives the prompt to answer it. Ghost Mode controls what we store, not what the provider sees.
Get started
Wiring Cursor to one API removes the busywork so you can focus on shipping. Add the base URL, paste one key, and pick whichever model fits the task.
Want more setup walkthroughs for tools like Windsurf, Zed, and Cline? Browse the blog.
Ready to try it? Create a free account and connect Cursor in under five minutes.
AnyModel