How to use Claude Opus 4.6 in Windsurf
Windsurf is one of the fastest AI-native editors around, but its built-in model menu doesn't always carry the exact Claude version you want — or it gates the strongest models behind its own pricing tiers. The good news: Windsurf speaks the OpenAI-compatible protocol, so you can point it at any gateway that does too. This guide shows how to run Claude Opus 4.6 inside Windsurf through AnyModel, a single endpoint that reaches Claude, GPT, Gemini, DeepSeek, and more.
Why route Claude Opus 4.6 through a gateway
Opus 4.6 is Anthropic's heavy-lifter — the model you reach for on multi-file refactors, gnarly debugging, and architecture reasoning. Running it through AnyModel gives you a few practical wins:
- One key, every model. The same API key reaches Claude, GPT, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. Switching models is just changing one string.
- No subscription. You pay per token with no minimums and no monthly fee.
- A real free tier. You get 1,000,000 tokens on signup — and 6,000,000 total if you link Telegram. No credit card required.
If you're weighing Opus against cheaper coding models, the compare page lets you see them side by side before you commit tokens.
Step 1: Get your API key
Create a free AnyModel account, then copy your API key from the dashboard. That key is all Windsurf needs.
The base URL you'll use everywhere is:
https://anymodel.org/v1
Step 2: Add AnyModel as a custom provider in Windsurf
Windsurf isn't one of the tools covered by AnyModel's one-line installer (that shortcut only supports codex, claude, opencode, and hermes), so you'll do a quick manual setup — it takes about a minute.
- Open Windsurf and go to Settings → Windsurf Settings → Cascade (or the model/provider section, depending on your version).
- Find the option to add a custom OpenAI-compatible provider or override the API base URL.
- Set the fields:
| Field | Value |
|---|---|
| Base URL | https://anymodel.org/v1 |
| API key | your AnyModel key |
| Model ID | claude-opus-4-6 |
- Save, then select the new model from Cascade's model dropdown.
That's it. Because AnyModel is OpenAI-compatible, Windsurf's chat and agentic Cascade features work against it without any extra adapters.
Step 3: Verify the connection
Before debugging inside the editor, confirm the endpoint works with a plain curl. If this returns a completion, Windsurf will too:
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": "Reply with: connection OK"}]
}'
If you get a 401, re-check the key. If you get a model-not-found error, confirm the exact model ID on the models page — IDs occasionally change between releases.
Switching models without re-configuring
The biggest payoff of this setup shows up later. Say Opus 4.6 is overkill for a quick docstring pass and you'd rather burn fewer tokens on a faster model. You don't touch the base URL or the key — you just change the model ID in Windsurf's dropdown:
claude-opus-4-6— deep reasoning, large refactors- a lighter Claude or GPT model for routine edits
- a long-context model when you're feeding in a whole codebase
Same endpoint, same key, different model string. That's the entire mental model.
A note on privacy
By default, AnyModel logs run like any normal API service. If you're working with sensitive code, turn on Ghost Mode — an opt-in setting where your prompts and responses aren't stored on our side; we only keep a token counter for billing. To be honest about the limits: the model provider (Anthropic, in this case) still receives your prompt to generate a response, so this isn't end-to-end secrecy — it's zero retention on the gateway.
Get started
Setting up Claude Opus 4.6 in Windsurf comes down to three values: a base URL, a key, and a model ID. Once it's wired up, every other model on the platform is one dropdown away.
Want more setup walkthroughs for tools like Cursor, Cline, and Zed? Browse the blog. Ready to code with Opus 4.6 right now? Create your free account and claim your starter tokens — no card needed.
AnyModel