June 27, 20264 min readSetupCursor

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.

Note: Cursor keeps Agent, Composer and autocomplete on its own models even on a Pro account — a custom endpoint is available from Chat/Ask (⌘/Ctrl+L) with the custom model selected. Cursor documents the limit as "Custom API keys only work with chat models". For a full agent on this same key, use Claude Code, Codex CLI or OpenCode.

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 model id, nothing else.
  • No subscription. Pay per token, no monthly minimums, no credit card to start. AnyModel uses pay-per-token billing with no subscription or minimums. Link Telegram to receive 5,000,000 free tokens; registration itself does not include a token grant.

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.

  1. Open Cursor Settings (Cmd/Ctrl + Shift + J).
  2. Go to Models (or AI depending on version).
  3. Find OpenAI API Key and enable Override OpenAI Base URL.
  4. Set the base URL to:
https://anymodel.org/v1
  1. Paste your AnyModel key into the API key field.
  2. Add the model ids you want under custom models — for example gpt-5, claude-opus-4-8, gemini-2.5-pro, or deepseek-v3.
  3. Click Verify, then save.

That is it. Cursor now sends its Chat/Ask requests through AnyModel; Agent, Composer and autocomplete keep using Cursor's own models.

Step 3: Switch models on the fly

Once your models are added, use the model picker in the Cursor Chat/Ask panel. Pick a fast, cheap model for short questions and a stronger reasoning model for refactoring plans 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.

Read next