Use Windsurf/Cognition models in Pi — Claude, GPT, Gemini, Kimi, DeepSeek, SWE, and more. All via your existing Windsurf subscription. No separate API keys.
Runs a local proxy at 127.0.0.1:42100 that speaks standard OpenAI Chat Completions API. Translates requests to Windsurf's proprietary Connect-RPC wire format. Pi talks to the proxy via api: "openai-completions" — no custom streaming code needed.
No Windsurf IDE needed. Cloud-direct mode talks straight to Cognition's servers over HTTPS. No Windsurf installation, no background processes. The local proxy adds negligible overhead — ~15MB memory, sub-millisecond latency.
Pi → proxy (localhost:42100) → Cognition Cloud
Option A — Git (recommended):
pi install git:github.com/drvova/pi-windsurfOption B — npm:
pi install npm:pi-windsurfOption C — Local dev:
git clone https://github.com/drvova/pi-windsurf.git ~/developer/pi-windsurf
pi -e ~/developer/pi-windsurf/index.ts/login windsurf
Browser opens to windsurf.com. Sign in with your Windsurf account. Token captured automatically.
/model windsurf/<model-id>
Models shown are whatever your Windsurf plan enables. The extension fetches the live catalog from Cognition at startup — new models appear automatically.
Use Pi as normal. Your Windsurf subscription covers API costs.
| Command | Does |
|---|---|
/login windsurf |
Sign in (browser-based OAuth) |
/windsurf-status |
Show auth state |
/windsurf-logout |
Sign out |
/windsurf-refresh |
Refresh model list from Cognition |
On startup (and after /login), the extension fetches from three Cognition endpoints in parallel:
GetCliModelConfigs— same endpoint the Devin CLI uses. Returns model labels, UIDs, pricing, promos, context windows, and capabilities.GetCliTeamSettings— returns the 96 model UIDs your plan allows. Models not in this list are filtered out.GetCascadeModelConfigs— full metadata fallback with context windows, promo statuses, and descriptions.
Model names include tags derived from live API data:
[Free]— no pricing info (field 32 absent) = free on your plan[Promo]— active promotional pricing (frompromo_statusfield)[New]— recently added model
Example: GLM-5.2 High [Free Promo] (200K), Kimi K2.6 [Free Promo] (262K)
- No hardcoded model lists — catalog is fetched live from Cognition
- No hardcoded context windows — from API field 18 only
- No hardcoded model fallbacks — empty array when catalog unavailable
- New models appear automatically on next restart
Depends on your Windsurf plan. Typically includes:
- Claude — Opus 4.8/4.7/4.6, Sonnet 4.6/4.5, Haiku 4.5
- GPT — 5.5, 5.4, 5.3, 5.2, Codex variants
- Gemini — 3.5 Flash, 3.1 Pro
- GLM — 5.2 (High/Max/No Thinking), 5.1, 4.7-Flash
- Kimi — K2.6, K2.7
- SWE — 1.6, 1.5
- DeepSeek — V4
- And more — BYOK models, enterprise deployments, experimental releases
All traffic goes to server.self-serve.windsurf.com:
| Endpoint | Purpose |
|---|---|
GetUserJwt |
Mint JWT from API key |
GetChatMessage |
Streaming chat completions |
GetCliModelConfigs |
Live model catalog (same as Devin CLI) |
GetCliTeamSettings |
Allowed model UIDs per plan |
GetCascadeModelConfigs |
Full model metadata with promos |
index.ts Pi extension entry (provider registration + model building)
proxy.ts HTTP server (OpenAI API → gRPC translation)
chat.ts Connect-RPC streaming (proto encode/decode)
catalog.ts Live model catalog from three Cognition endpoints
models.ts Minimal pass-through (catalog is single source of truth)
auth.ts JWT minting via GetUserJwt
metadata.ts Proto metadata builder
wire.ts Proto wire format helpers
oauth.ts Login loopback + RegisterUser
- Pi (any recent version)
- Node.js >= 18 or Bun
- Windsurf account (free or paid)
No npm dependencies. Uses only Node built-ins and Pi's own types.
MIT