How to use Claude Opus 4.6 in Cursor
Cursor is one of the most popular AI-native code editors, but its built-in model menu doesn't always expose every Claude release the moment it ships — and adding a separate Anthropic account means another dashboard, another invoice, and another rate limit to babysit. This guide shows how to wire Claude Opus 4.6 into Cursor through a single OpenAI-compatible endpoint, so you can reach Anthropic's strongest reasoning model (and dozens of others) with one key.
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 a gateway
Cursor lets you override its OpenAI base URL with any compatible API. That one feature is the trick: point it at AnyModel and you get GPT, Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok behind the same credential. Switching from Opus 4.6 to a cheaper model for boilerplate is just changing the model id — no re-auth, no new config.
A few practical reasons developers do this:
- One key, one bill. No per-provider accounts to reconcile.
- Pay-per-token, no subscription. No monthly minimum sitting idle.
- Easy fallback. If Opus 4.6 is busy, you flip to another model in seconds.
Step 1: Get your API key
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.
Step 2: Configure Cursor
Cursor doesn't have a one-line installer (that's reserved for codex, claude, opencode, and hermes), so you'll do a quick manual OpenAI-compatible setup. It takes about a minute.
- Open Cursor Settings → Models.
- Scroll to OpenAI API Key and expand the Override OpenAI Base URL option.
- Set the base URL to:
https://anymodel.org/v1
- Paste your AnyModel API key into the OpenAI key field.
- Click Verify / save. Cursor will validate the key against the endpoint.
Because the endpoint is OpenAI-compatible, Cursor treats it like a standard OpenAI provider — it just happens to serve Claude and everything else.
Step 3: Add the Opus 4.6 model id
In the same Models panel, add a custom model and enter the Claude Opus 4.6 model id exactly as listed on the models page. Save it, then select it from Cursor's model picker in Chat/Ask. To switch later, pick a different id from the list — nothing else changes.
You can sanity-check the endpoint outside Cursor with a quick curl:
curl https://anymodel.org/v1/chat/completions \
-H "Authorization: Bearer $YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"messages": [{"role": "user", "content": "Refactor this function for readability."}]
}'
If that returns a completion, Cursor will work too.
When to reach for Opus 4.6
Opus 4.6 shines on the hard stuff: planning multi-file refactors, tracing subtle bugs across a large codebase and architecture decisions, where reasoning depth matters more than raw speed. Running those plans as an autonomous agent needs a client that executes tools on your own key — Claude Code, Codex CLI or OpenCode — because Cursor reserves Agent and Composer for its own models. For quick autocomplete-style edits or simple renames, a lighter model is cheaper and just as good. Since switching is a one-id change, mix and match freely. If you're weighing options, the model comparison breaks down strengths and pricing side by side.
A note on privacy
By default, prompts pass through to the model provider — that's true of any gateway, since the provider still has to read your code to answer. If you want zero retention on our side, enable Ghost Mode: your prompts and responses aren't stored, only a token counter runs. We won't pretend it's "100% private" — Anthropic still receives the prompt — but nothing lingers on AnyModel.
Troubleshooting
- "Invalid API key": confirm you pasted the AnyModel key, not an Anthropic one, and that the base URL ends in
/v1. - Model not found: copy the id verbatim from the models page; typos are the usual culprit.
- Some Cursor features stay on Cursor's own models: that's expected — the override applies to API-key-driven calls.
Want more setup walkthroughs for other editors and CLIs? Browse the blog.
Ready to code with Opus 4.6 in Cursor? Create your free account and get a million tokens to start — no card needed.
AnyModel