Point Cursor at a custom Anthropic base URL

Cursor lets you override the API endpoint it talks to. Once you do, every request is billed against your own key at your own rate instead of Cursor's pooled quota.

In short: Cursor accepts a custom Anthropic base URL and your own API key, both set under Settings → Models. A full restart is required before they take effect, and the way to confirm it worked is that the request appears in your gateway usage log.
Don't have an account yet? You need an API key from the gateway before the steps below will work. Create one free → (no prepay, $1 minimum top-up)
Check current rates → Free to sign up · $1 minimum top-up · No prepayment
Quick self-check. Before wiring anything into your app, confirm the key works. This lists every model your account can call — it costs nothing and works from any machine:
curl https://aicomp.ai/v1/models \
  -H "Authorization: Bearer sk-your-gateway-key"

You should get back a JSON list of model IDs. If you see Invalid token, the key is wrong or was not copied in full.

Step 1 — create a key

Sign up, generate an API key in the dashboard, and copy your base URL (https://aicomp.ai/v1).

Step 2 — open the override field

In Cursor: Settings → Models. Look for the base URL override (in some versions it sits under "Override OpenAI Base URL" or the Anthropic section). Enter:

https://aicomp.ai/v1

Then paste your key into the API key field and save.

Step 3 — confirm it took effect

Open a new chat and send a short message. If routing works you get a normal reply. To be certain, check the usage log in your gateway dashboard — the request should appear there within a minute.

If it does not work

SymptomFix
Invalid API keyCursor may cache the old key. Restart Cursor fully after saving.
404 errorsRemove or add the /v1 suffix so it is not doubled.
Falls back to Cursor quotaSome versions ignore the override unless "use my own key" is explicitly enabled.

What it costs

Claude models available in Cursor — gateway rate vs official list
ModelGateway rate
in / out per 1M tokens
Official list
in / out per 1M tokens
Diff
claude-haiku-4-5$0.5 / $2.5$1 / $550%
claude-sonnet-5$1 / $5$2 / $1050%
claude-opus-5$2.5 / $12.5$5 / $2550%

Rates checked 2026-09-16. Gateway rates move with upstream promotions — verify the current number in your dashboard before committing to a budget.

With your own key your bill is pure token spend, with no per-request markup on top. Estimate it with the Cursor cost calculator, or compare Sonnet 5 against Haiku 4.5 for your workload — for autocomplete and small edits the difference is most of the bill.

FAQ

Can I use my own Claude API key in Cursor?

Yes. Cursor accepts an Anthropic API key and, in current versions, lets you override the base URL. With both set, requests bill to your key instead of consuming Cursor's pooled quota.

Where exactly is the base URL setting?

Under Cursor Settings → Models. Depending on version it appears as an Anthropic base URL field or alongside the 'Override OpenAI Base URL' option. If it is not exposed in the UI, it can be set in settings.json and Cursor restarted.

How do I know Cursor is actually using my key?

A successful reply is not proof. Check your gateway usage log — if the request does not appear there within a minute, Cursor is still routing through its own quota.

Do I still pay Cursor if I use my own key?

You pay for token spend on your own account rather than drawing down Cursor's included usage. Your subscription covers the editor; the API consumption is billed wherever your key lives.

Does it work in agent mode?

Yes, provided the model you selected is reachable through the configured endpoint. Agent mode sends more context per turn, so the per-token rate matters more there than in ordinary chat.

Next

Get API access