June 26, 20263 min readSetupWindsurf

How to use Windsurf through one API

Windsurf is a fast, agentic AI editor — but juggling separate accounts, billing, and rate limits for each model behind it gets old quickly. The fix is to point Windsurf at a single OpenAI-compatible gateway. With AnyModel, one base URL and one API key reach GPT, Claude, Gemini, DeepSeek, GLM, Kimi, Qwen, and Grok. Switching models becomes a one-field change, not a re-onboarding project.

Why route Windsurf through one API

Windsurf speaks the OpenAI Chat Completions format, so any OpenAI-compatible provider can slot in as a custom endpoint. Routing through one gateway gives you:

  • One key, every model. No per-provider signups or scattered invoices.
  • Instant model swaps. Change the model id; everything else stays the same.
  • One bill, pay-per-token. No subscription, no minimums, no surprise tiers.

You can compare options on the model comparison page before you decide which to wire into your editor.

What you need first

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. 2. Windsurf installed and updated. 3. The two values every OpenAI-compatible client wants:

  • Base URL: https://anymodel.org/v1
  • API key: your AnyModel key

Note: Windsurf is not part of the one-line installer. That auto-setup only covers codex, claude, opencode, and hermes. Windsurf uses the manual OpenAI-compatible path below — which takes about a minute.

Step-by-step setup in Windsurf

  1. Open Windsurf → Settings and find the AI / model configuration (look for "Custom" or "OpenAI-compatible" provider).
  2. Set the Base URL to https://anymodel.org/v1.
  3. Paste your AnyModel API key.
  4. Enter a model id exactly as listed on the models page — for example gpt-5, claude-sonnet-4.5, gemini-2.5-pro, or deepseek-v3.
  5. Save, then start a chat or an agent task to confirm responses come back.

That's the whole integration. The same base URL and key work across every supported model, so adding a second model later is just another id.

Verify the connection from your terminal

Before trusting the editor, it's worth a quick sanity check that your key and base URL talk to the gateway. This curl call hits the same endpoint Windsurf uses:

curl https://anymodel.org/v1/chat/completions \
  -H "Authorization: Bearer $ANYMODEL_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gpt-5",
    "messages": [{"role": "user", "content": "Say hi from Windsurf"}]
  }'

If you get a JSON completion back, Windsurf will too. To try a different model, change only the model value — the request shape never changes.

Choosing models for editor work

Different tasks reward different models, and one key lets you mix freely:

Task A solid pick
Large-context refactors Claude or Gemini
Fast inline edits A lighter GPT or Qwen model
Budget-friendly bulk work DeepSeek or GLM
Reasoning-heavy debugging A frontier GPT or Claude model

Because billing is per-token with no plan lock-in, you can keep a cheap model as your default and reach for a stronger one only when a task needs it.

A note on privacy

If your prompts include proprietary code, enable Ghost Mode. It's opt-in, zero-retention: we don't store your prompts or responses — only a token counter for billing. Be honest with yourself about the limits, though: the underlying model provider still receives the prompt to generate a response. Ghost Mode removes our side of retention, not theirs.

Wrapping up

Pointing Windsurf at one OpenAI-compatible endpoint turns model choice into a single editable field and collapses your AI billing into one pay-per-token account. Set the base URL, paste your key, pick a model id, and you're done. For more setup walkthroughs across tools, browse the blog.

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.

Read next