May 24, 20263 min readSetupGPT-5.2Windsurf

How to use GPT-5.2 in Windsurf

Windsurf is one of the fastest AI-native editors around, and its Cascade agent shines when it's backed by a strong reasoning model. GPT-5.2 is a great fit for that role. This guide shows how to wire GPT-5.2 into Windsurf using a single OpenAI-compatible endpoint, so you can keep your existing workflow and swap models whenever you want.

Why route GPT-5.2 through AnyModel

Windsurf can talk to any OpenAI-compatible API. AnyModel gives you exactly that: one base_url, one API key, and access to GPT-5.2 alongside Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. Switching models means changing one string — the model id — and nothing else in your config.

A few practical reasons this matters for Windsurf users:

  • No per-provider accounts. One key reaches every model on the models list.
  • Free to start. You get 1,000,000 tokens on signup, and a total of 6,000,000 if you link Telegram — no credit card required.
  • Pay-per-token after that. No subscription, no minimums. You pay for what Cascade actually consumes.

If you're weighing GPT-5.2 against other options for agentic coding, the model comparison page is a quick way to sanity-check latency and pricing before you commit.

Step 1: Get your API key

Create an account, then copy your key from the dashboard. The signup tokens are enough to run real Cascade sessions before you spend anything.

Step 2: Add AnyModel as a custom provider in Windsurf

Windsurf isn't one of the four tools covered by our one-line installer (that's codex, claude, opencode, and hermes), so you'll use the standard OpenAI-compatible setup instead. It takes about a minute.

  1. Open Windsurf settings and go to the Cascade / model settings.
  2. Find the option to add a custom OpenAI-compatible provider (sometimes labeled "OpenAI API key" with a configurable base URL).
  3. Set these two values:
Field Value
Base URL https://anymodel.org/v1
API Key your AnyModel key
  1. Add gpt-5.2 as the model id.

That's the whole connection. Because the endpoint is OpenAI-compatible, Windsurf treats it like a native provider.

Step 3: Verify the connection

Before relying on it inside the editor, confirm the endpoint responds. Run this from your terminal:

curl https://anymodel.org/v1/chat/completions \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5.2",
    "messages": [{"role": "user", "content": "Reply with: Windsurf connected"}]
  }'

If you get a JSON response with the model's reply, Windsurf will work too. If you see a 401, the key is wrong; a 404 usually means the base URL is missing the /v1.

Step 4: Use it in Cascade

Select GPT-5.2 in the Cascade model picker and start prompting. GPT-5.2 is well-suited to multi-file refactors, planning before editing, and reasoning through test failures — the kinds of tasks where Windsurf's agent loop earns its keep.

Switching models on the fly

Want to compare GPT-5.2 against Claude or Gemini on the same task? Add another model id (for example a Claude or Gemini model) pointing at the same base URL and key. No new account, no new credentials. This is the fastest way to A/B test which model handles your codebase best.

A note on privacy

If your repository is sensitive, enable Ghost Mode — opt-in, zero-retention API keys where prompts and responses aren't stored on our side (only a token counter runs). Be clear-eyed about the limit, though: the underlying model provider still receives your prompt, so this isn't "100% privacy." It removes our copy, not theirs.

Troubleshooting tips

  • Model not found: double-check the exact id gpt-5.2 and that there's no trailing space.
  • Streaming issues: make sure Windsurf's provider entry uses the chat completions path, not a legacy completions endpoint.
  • Rate or balance errors: check your remaining token balance in the dashboard.

For more setup walkthroughs across editors and CLIs, browse the blog.

Start free

You can have GPT-5.2 running in Windsurf in the time it takes to paste a base URL and a key. Create your free AnyModel account, grab your key, and start with up to 6,000,000 tokens — no credit card needed.

Read next