{"id":49096901,"url":"https://github.com/guanxiaol/windsurfpoolapi","last_synced_at":"2026-04-27T03:01:07.865Z","repository":{"id":352657036,"uuid":"1215625662","full_name":"guanxiaol/WindsurfPoolAPI","owner":"guanxiaol","description":"Multi-account pool proxy for Windsurf — 113+ models (Claude/GPT/Gemini/Grok/Kimi) via OpenAI \u0026 Anthropic APIs, image upload, Cursor \u0026 Claude Code native / 企业级 Windsurf 多账号池化 API 代理","archived":false,"fork":false,"pushed_at":"2026-04-25T15:09:43.000Z","size":656,"stargazers_count":132,"open_issues_count":0,"forks_count":28,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-04-26T02:03:18.756Z","etag":null,"topics":["ai-proxy","anthropic","anthropic-api","api","claude","claude-code","codeium","cursor","gemini","gpt","language-server","llm-proxy","multi-account","multimodal","nodejs","openai","openai-api","pool","proxy","windsurf"],"latest_commit_sha":null,"homepage":"https://guanxiaol.github.io/WindsurfPoolAPI/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/guanxiaol.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T05:17:34.000Z","updated_at":"2026-04-25T17:28:26.000Z","dependencies_parsed_at":"2026-04-27T03:00:40.995Z","dependency_job_id":null,"html_url":"https://github.com/guanxiaol/WindsurfPoolAPI","commit_stats":null,"previous_names":["guanxiaol/windsurfapi"],"tags_count":21,"template":false,"template_full_name":null,"purl":"pkg:github/guanxiaol/WindsurfPoolAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanxiaol%2FWindsurfPoolAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanxiaol%2FWindsurfPoolAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanxiaol%2FWindsurfPoolAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanxiaol%2FWindsurfPoolAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guanxiaol","download_url":"https://codeload.github.com/guanxiaol/WindsurfPoolAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guanxiaol%2FWindsurfPoolAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32320683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai-proxy","anthropic","anthropic-api","api","claude","claude-code","codeium","cursor","gemini","gpt","language-server","llm-proxy","multi-account","multimodal","nodejs","openai","openai-api","pool","proxy","windsurf"],"created_at":"2026-04-20T21:01:58.260Z","updated_at":"2026-04-27T03:01:07.817Z","avatar_url":"https://github.com/guanxiaol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Node.js-%3E%3D20-339933?style=flat-square\u0026logo=node.js\u0026logoColor=white\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/License-MIT-blue?style=flat-square\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Models-113%2B-blueviolet?style=flat-square\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Zero_Dependencies-yes-success?style=flat-square\" /\u003e\n  \u003cimg src=\"https://img.shields.io/badge/v2.0.3-Latest-orange?style=flat-square\" /\u003e\n  \u003cimg src=\"https://img.shields.io/github/stars/guanxiaol/WindsurfPoolAPI?style=flat-square\u0026color=yellow\" /\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003eWindsurfPoolAPI\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eEnterprise-grade multi-account pool proxy for Windsurf AI platform.\u003c/b\u003e\u003cbr/\u003e\n  Expose 113+ models (Claude / GPT / Gemini / DeepSeek / Grok / Qwen / Kimi / GLM) via standard OpenAI \u0026 Anthropic APIs.\u003cbr/\u003e\n  \u003csub\u003e企业级 Windsurf 多账号池化 API 代理 —— 113+ 模型，OpenAI / Anthropic 双协议兼容，Cursor / Claude Code 原生支持\u003c/sub\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#-quick-start--快速开始\"\u003eQuick Start\u003c/a\u003e ·\n  \u003ca href=\"#-features--核心特性\"\u003eFeatures\u003c/a\u003e ·\n  \u003ca href=\"#-dashboard--管理后台\"\u003eDashboard\u003c/a\u003e ·\n  \u003ca href=\"#-api-reference--接口文档\"\u003eAPI Reference\u003c/a\u003e ·\n  \u003ca href=\"#-deployment--部署指南\"\u003eDeployment\u003c/a\u003e ·\n  \u003ca href=\"#-faq--常见问题\"\u003eFAQ\u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n## ⚠️ Disclaimer / 声明\n\nThis project is for **personal learning, research, and self-hosting only**. Commercial use, resale, paid deployment, or repackaging as a service without written authorization is **strictly prohibited**.\n\n本项目仅供**个人学习、研究、自用**。未经作者书面授权，禁止任何商业用途、付费代部署、中转转售或包装成服务对外销售。\n\n---\n\n## ✨ Features / 核心特性\n\n| Feature | Description |\n| :--- | :--- |\n| **Dual Protocol** | `/v1/chat/completions` (OpenAI) + `/v1/messages` (Anthropic native) |\n| **113+ Models** | Claude Opus 4.7 · GPT-5.4 · Gemini 3.1 · DeepSeek R1 · Grok 3 · Qwen 3 · Kimi K2.5 · GLM-5.1 and more |\n| **Multi-Account Pool** | Capacity-based load balancing, automatic failover, per-model rate-limit isolation |\n| **Token \u0026 Credit Analytics** | Per-API × per-model aggregation down to individual request level |\n| **Admin Dashboard** | Full-featured SPA: account management, proxy config, real-time logs, usage charts |\n| **Batch Operations** | Select multiple accounts, enable/disable in one click |\n| **OAuth Login** | Google / GitHub Firebase OAuth + manual token refresh |\n| **Dynamic Stall Detection** | Input-length-aware timeout (30s–90s) prevents false positives on large contexts |\n| **Persistent State** | All settings, account status, tokens survive restarts |\n| **Image Upload** | Multimodal support — send images via `image_url` blocks (base64 or URL) |\n| **Tool Calling** | `\u003ctool_call\u003e` protocol compatible — works with Cursor, Aider, and other AI coding tools |\n| **Cursor Compatible** | 80+ model name aliases including Cursor-friendly names without \"claude\" keyword |\n| **Streaming SSE** | OpenAI format with `stream_options.include_usage` support |\n| **Zero Dependencies** | Pure Node.js built-in modules, nothing to install |\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003e中文特性列表\u003c/b\u003e\u003c/summary\u003e\n\n- **双协议兼容** — OpenAI + Anthropic 原生端点，无需任何中间件\n- **113+ 模型** — 启动时自动拉取 Windsurf 最新 catalog，实时更新\n- **多账号池** — 按剩余容量均衡分配，自动故障转移，per-model 限速隔离\n- **Token + Credit 精细统计** — 按 API × 模型分层聚合，精确到单次请求\n- **Dashboard 管理后台** — 账号管理、代理配置、实时日志、使用图表、封禁侦测\n- **批量操作** — 一键多选账号批量启用/停用\n- **OAuth 登录** — 支持 Google/GitHub Firebase OAuth 登录\n- **动态超时检测** — 根据输入长度自适应超时阈值（30s~90s），大上下文不误判\n- **全持久化** — 所有设置、账号状态、Token 均持久化存储，重启不丢失\n- **零依赖** — 纯 Node.js 内置模块，开箱即用\n\n\u003c/details\u003e\n\n---\n\n## 🚀 Quick Start / 快速开始\n\n### Prerequisites / 前置条件\n\n- **Node.js ≥ 20**\n- **Windsurf Language Server** binary (`language_server_linux_x64` or `language_server_darwin_arm64`)\n- At least one Windsurf account (Free tier supports limited models)\n\n### Install \u0026 Run / 安装启动\n\n```bash\ngit clone https://github.com/guanxiaol/WindsurfPoolAPI.git\ncd WindsurfPoolAPI\n\n# Place Language Server binary / 放置 Language Server 二进制\nsudo mkdir -p /opt/windsurf\nsudo cp /path/to/language_server_linux_x64 /opt/windsurf/\nsudo chmod +x /opt/windsurf/language_server_linux_x64\n\n# Optional: configure / 可选配置\ncp .env.example .env    # Edit API_KEY, DASHBOARD_PASSWORD, etc.\n\n# Start / 启动\nnode src/index.js\n```\n\n\u003e **macOS** — Run `bash scripts/install-macos.sh` for auto-start on login.\n\u003e\n\u003e **Windows** — Run `scripts\\install-windows.bat` for guided installation.\n\nDashboard: `http://localhost:3003/dashboard`\n\n### Docker\n\n```bash\ndocker compose up -d --build\n```\n\nMount the LS binary at `/opt/windsurf/` on the host before starting.\n\n---\n\n## 🔑 Account Management / 账号管理\n\n\u003e ⚠️ **Always use Token login!** / **必须使用 Token 方式登录！**\n\u003e\n\u003e Windsurf has a known bug where email/password login may route requests to the wrong account.\n\u003e\n\u003e Windsurf 官方存在 bug：邮箱/密码登录可能导致请求路由到错误账号。\n\u003e\n\u003e **Get your token** / **获取 Token**：[https://windsurf.com/editor/show-auth-token?workflow=](https://windsurf.com/editor/show-auth-token?workflow=)\n\n```bash\n# ✅ Add account via Token (recommended / 推荐)\ncurl -X POST http://localhost:3003/auth/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"token\": \"your-windsurf-token\"}'\n\n# Batch add / 批量添加\ncurl -X POST http://localhost:3003/auth/login \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"accounts\": [{\"token\": \"t1\"}, {\"token\": \"t2\"}]}'\n\n# List accounts / 列出账号\ncurl http://localhost:3003/auth/accounts\n\n# Remove / 删除\ncurl -X DELETE http://localhost:3003/auth/accounts/{id}\n```\n\n---\n\n## 📡 API Reference / 接口文档\n\n### OpenAI Compatible / OpenAI 兼容\n\n```bash\ncurl http://localhost:3003/v1/chat/completions \\\n  -H \"Content-Type: application/json\" \\\n  -H \"Authorization: Bearer sk-your-api-key\" \\\n  -d '{\n    \"model\": \"gpt-4o-mini\",\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}],\n    \"stream\": false\n  }'\n```\n\n### Anthropic Compatible / Anthropic 兼容\n\n```bash\ncurl http://localhost:3003/v1/messages \\\n  -H \"Content-Type: application/json\" \\\n  -H \"anthropic-version: 2023-06-01\" \\\n  -H \"x-api-key: sk-your-api-key\" \\\n  -d '{\n    \"model\": \"claude-sonnet-4.6\",\n    \"max_tokens\": 1024,\n    \"messages\": [{\"role\": \"user\", \"content\": \"Hello!\"}]\n  }'\n```\n\n### Environment Variables / 环境变量\n\n| Variable | Default | Description |\n| :--- | :--- | :--- |\n| `PORT` | `3003` | HTTP server port |\n| `API_KEY` | _(empty)_ | Auth key for `/v1/*` endpoints. Empty = open access |\n| `DASHBOARD_PASSWORD` | _(empty)_ | Dashboard admin password |\n| `DEFAULT_MODEL` | `claude-4.5-sonnet-thinking` | Default model when none specified |\n| `MAX_TOKENS` | `8192` | Default max output tokens |\n| `LOG_LEVEL` | `info` | `debug` / `info` / `warn` / `error` |\n| `LS_BINARY_PATH` | `/opt/windsurf/language_server_linux_x64` | Language Server path |\n| `LS_PORT` | `42100` | Language Server gRPC port |\n\n### Dashboard API\n\nAll endpoints require `X-Dashboard-Password` header.\n\n| Method | Path | Description |\n| :--- | :--- | :--- |\n| `GET` | `/dashboard/api/overview` | System overview |\n| `GET` | `/dashboard/api/accounts` | List all accounts |\n| `POST` | `/dashboard/api/accounts/batch-status` | Batch enable/disable accounts |\n| `POST` | `/dashboard/api/oauth-login` | OAuth login (Google/GitHub) |\n| `POST` | `/dashboard/api/accounts/:id/refresh-token` | Refresh Firebase token |\n| `POST` | `/dashboard/api/accounts/:id/rate-limit` | Check account capacity |\n| `GET` | `/dashboard/api/usage` | Full usage statistics |\n| `GET` | `/dashboard/api/usage/export` | Export stats as JSON |\n| `POST` | `/dashboard/api/usage/import` | Import stats (auto-dedup) |\n| `GET` | `/dashboard/api/logs/stream` | Real-time SSE log stream |\n\n---\n\n## 🖥 Dashboard / 管理后台\n\nAccess at `http://localhost:3003/dashboard`\n\n| Panel | Description |\n| :--- | :--- |\n| **Overview** | Runtime stats, account pool health, success rate |\n| **Login** | Windsurf token/email login, OAuth |\n| **Accounts** | Add/remove, batch enable/disable, per-account proxy, quota display |\n| **Models** | Global allow/blocklist, per-account model restrictions |\n| **Proxy** | Global + per-account HTTP/SOCKS5 proxy |\n| **Logs** | Real-time SSE log stream with level filtering |\n| **Analytics** | Token/Credit charts, 14-day trends, 24h distribution, request details |\n| **Detection** | Error pattern monitoring, account health |\n| **Experimental** | Cascade session reuse, model identity masking, preflight rate-limit |\n\n### Screenshots / 界面预览\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eAccount Pool — Multi-account quota monitoring / 多账号额度监控\u003c/b\u003e\u003cbr/\u003e\n  \u003cimg src=\"docs/screenshots/accounts.png\" width=\"900\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eAnalytics — Token \u0026 Credit usage charts / 统计分析面板\u003c/b\u003e\u003cbr/\u003e\n  \u003cimg src=\"docs/screenshots/analytics.png\" width=\"900\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cb\u003eModel Stats — Per-model request breakdown / 模型使用统计\u003c/b\u003e\u003cbr/\u003e\n  \u003cimg src=\"docs/screenshots/models.png\" width=\"900\" /\u003e\n\u003c/p\u003e\n\n---\n\n## 🤖 Supported Models / 支持的模型\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eClaude (Anthropic)\u003c/b\u003e\u003c/summary\u003e\n\n`claude-3.5-sonnet` · `claude-3.7-sonnet[-thinking]` · `claude-4-sonnet[-thinking]` · `claude-4-opus[-thinking]` ·\n`claude-4.1-opus[-thinking]` · `claude-4.5-sonnet[-thinking]` · `claude-4.5-haiku` · `claude-4.5-opus[-thinking]` ·\n`claude-sonnet-4.6[-thinking][-1m]` · `claude-opus-4.6[-thinking]` · `claude-opus-4.7-{low,medium,high,xhigh,max}`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eGPT (OpenAI)\u003c/b\u003e\u003c/summary\u003e\n\n`gpt-4o` · `gpt-4o-mini` · `gpt-4.1[-mini/nano]` · `gpt-5[-mini]` · `gpt-5.2[-low/medium/high]` ·\n`gpt-5.4[-low/medium/high/xhigh]` · `gpt-5.3-codex` · `o3[-mini/high/pro]` · `o4-mini`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eGemini (Google)\u003c/b\u003e\u003c/summary\u003e\n\n`gemini-2.5-pro` · `gemini-2.5-flash` · `gemini-3.0-pro` · `gemini-3.0-flash` · `gemini-3.1-pro[-low/high]`\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eOthers / 其他\u003c/b\u003e\u003c/summary\u003e\n\n`deepseek-v3` · `deepseek-r1` · `grok-3[-mini]` · `grok-code-fast-1` · `qwen-3` · `qwen-3-coder` ·\n`kimi-k2` · `kimi-k2.5` · `swe-1.5[-thinking]` · `swe-1.6-fast` · `arena-fast` · `arena-smart`\n\n\u003c/details\u003e\n\n\u003e Model catalog is auto-synced from Windsurf cloud on startup. Free accounts: `gpt-4o-mini` and `gemini-2.5-flash` only.\n\u003e\n\u003e 启动时自动从 Windsurf 云端拉取最新模型列表。免费账号仅可用 `gpt-4o-mini` 和 `gemini-2.5-flash`。\n\n---\n\n## 🚢 Deployment / 部署指南\n\n### PM2 (Recommended / 推荐)\n\n```bash\nnpm install -g pm2\npm2 start src/index.js --name windsurfpool --cwd /path/to/WindsurfPoolAPI\npm2 save \u0026\u0026 pm2 startup\n```\n\n### systemd (Linux)\n\n```ini\n# /etc/systemd/system/windsurfpool.service\n[Unit]\nDescription=WindsurfPoolAPI\nAfter=network.target\n\n[Service]\nType=simple\nUser=windsurf\nWorkingDirectory=/opt/WindsurfPoolAPI\nExecStart=/usr/bin/node src/index.js\nRestart=on-failure\nRestartSec=5\nEnvironment=PORT=3003\n\n[Install]\nWantedBy=multi-user.target\n```\n\n```bash\nsudo systemctl enable --now windsurfpool\n```\n\n### macOS (launchd)\n\n```bash\nbash scripts/install-macos.sh\n```\n\n### Firewall / 防火墙\n\n```bash\n# Ubuntu\nsudo ufw allow 3003/tcp\n\n# CentOS\nsudo firewall-cmd --add-port=3003/tcp --permanent \u0026\u0026 sudo firewall-cmd --reload\n```\n\n\u003e Cloud servers: remember to open port 3003 in your security group.\n\u003e\n\u003e 云服务器记得在安全组中开放 3003 端口。\n\n---\n\n## 🏗 Architecture / 架构\n\n```text\nClient (OpenAI SDK / Anthropic SDK / curl / Cursor / Aider)\n   │\n   ▼\nWindsurfPoolAPI  (Node.js HTTP, :3003)\n   ├── /v1/chat/completions    (OpenAI format)\n   ├── /v1/messages            (Anthropic format)\n   ├── /dashboard/api/*        (Admin API)\n   └── /dashboard              (Admin SPA)\n   │\n   ▼\nLanguage Server Pool  (gRPC-over-HTTP/2, :42100+)\n   │\n   ▼\nWindsurf Cloud  (server.self-serve.windsurf.com)\n```\n\nSee `ARCHITECTURE.md` for module-level details.\n\n---\n\n## ❓ FAQ / 常见问题\n\n**Q: `LS binary not found` on startup?**\nA: Ensure the binary exists at `/opt/windsurf/language_server_linux_x64` (or set `LS_BINARY_PATH`).\n\n**Q: `No accounts available`?**\nA: Add at least one account via Dashboard or `POST /auth/login`.\n\n**Q: `permission_denied` for all accounts?**\nA: Free accounts only support `gpt-4o-mini` and `gemini-2.5-flash`. Other models require Windsurf Pro.\n\n**Q: How to migrate stats between servers?**\nA: Export: `GET /dashboard/api/usage/export` → Import: `POST /dashboard/api/usage/import` (auto-dedup).\n\n**Q: How to update models?**\nA: Models auto-sync on startup. Restart the service to refresh.\n\n---\n\n## 🤝 Contributing\n\nSee `CONTRIBUTING.md`. Issues and PRs are welcome.\n\n---\n\n## 🙏 Acknowledgements / 致谢\n\nThis project is built upon [dwgx/WindsurfAPI](https://github.com/dwgx/WindsurfAPI). Special thanks to [@dwgx](https://github.com/dwgx) for the foundational work and open-source contribution.\n\n本项目基于 [dwgx/WindsurfAPI](https://github.com/dwgx/WindsurfAPI) 的初始版本开发，感谢原作者 [@dwgx](https://github.com/dwgx) 的开创性工作和开源贡献。\n\n---\n\n## 📄 License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguanxiaol%2Fwindsurfpoolapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguanxiaol%2Fwindsurfpoolapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguanxiaol%2Fwindsurfpoolapi/lists"}