Qwen Gate
Expose Qwen web sessions through a self-hosted OpenAI-compatible API for existing developer tools.
- Source repo
- youssefvdel/qwengate
- Stars
- ★ 203
- Last updated
- 1mo ago
- License
- MIT
- Primary language
- TypeScript
- FA score
- Insufficient evidence
At a glance
- How it runs
- Works with
- Platform-specificOpenAI APIClaude Code (Partial support)
- Cost
- Free, no paid service needed
- Setup effort
- Medium · a few setup steps
- You'll need
- Typical use
- A Claude Code, Cursor, or OpenCode user wants to point an existing OpenAI-compatible client at a self-hosted endpoint for Qwen models.
- Not a fit if
- Teams that require the official Qwen API or service-level guarantees
- Users who cannot use browser automation to sign in to chat.qwen.ai
- Source review
- Insufficient evidence 8 safety controls not found
What does this agent do, and when should you use it?
Qwen Gate is a self-hosted gateway that signs in to chat.qwen.ai with browser automation and exposes Qwen models through OpenAI-compatible endpoints. It runs TypeScript directly with Bun and provides `/v1/chat/completions` and `/v1/models` for clients configured with the local service URL. Features include SSE streaming, account rotation, a reusable session pool, and parsing of tool calls. A web dashboard covers request activity, accounts, network debugging, and settings. Playwright is used for login and authentication, while API requests use the wreq-js Node.js fetch transport. It fits developers who can operate the service and manage Qwen accounts, and whose clients speak the OpenAI API format; the project says it is for educational and study purposes and is not affiliated with Qwen or Alibaba.
Run qg or bun start to launch the Hono API and dashboard on the configured port (26405 by default). An administrator adds Qwen email and password credentials at /dashboard/accounts; the gateway uses Playwright to sign in and persist sessions. A client then sends model, message, and optional tool definitions to /v1/chat/completions, or queries /v1/models. The gateway obtains responses from Qwen, can stream them over SSE, and manages account rotation, cooldowns after rate limits, and retries; text-form tool calls are parsed into OpenAI-style tool call objects. The dashboard includes overview, logs, accounts, network debugging, and settings pages, with configuration and request logging behavior controlled by settings.
- A Claude Code, Cursor, or OpenCode user wants to point an existing OpenAI-compatible client at a self-hosted endpoint for Qwen models.
- A developer managing several Qwen accounts wants round-robin distribution, automatic failover, and cooldown tracking.
- A developer whose client expects SSE wants to route streaming requests through Qwen web sessions.
- An operator wants a local dashboard for request logs, account status, and outbound network inspection.
- A developer wants to experiment with tool calls and accepts that the gateway parses them from generated text with documented limitations.
How do you install or deploy this agent?
On Linux or macOS, the install script clones the repository, installs dependencies, and creates CLI aliases; manual setup requires Git and Bun. On Windows, use the PowerShell installer or clone the repository and run bun install. You will need a Qwen account and must add it in the dashboard. The README specifies Bun 1.3+ and uses browser automation for authentication.
curl -sSL https://raw.githubusercontent.com/youssefvdel/qwen-gate/main/install.sh | bash
cd qwen-gate
qgFor Windows, the documented installer command is:
powershell -ExecutionPolicy Bypass -c "curl.exe -sSL https://raw.githubusercontent.com/youssefvdel/qwen-gate/main/install.ps1 | iex"How do you use this agent?
Start the service, then open the dashboard and add a Qwen account. Set API_KEY in config.json if you want API authentication; its default is empty, which disables auth. Configure a client with base URL http://localhost:26405/v1 and send a Bearer token if one is configured. The example below starts the server and makes a first chat completion request:
qgcurl -X POST http://localhost:26405/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your-api-key" \
-d '{
"model": "qwen3-max",
"messages": [{"role": "user", "content": "Hello!"}]
}'Replace your-api-key with the value configured in config.json; omit authorization when API auth is disabled. Set "stream": true to request SSE output.
What are this agent's strengths and limitations?
- Implements
/v1/chat/completionsand/v1/models, allowing OpenAI-compatible clients to reuse their existing API integration. - Rotates multiple accounts with failover and cooldown tracking for operators managing several Qwen web accounts.
- Uses browser automation for login while sending API requests through fetch; its session pool reuses sessions and autoscale under load.
- Combines SSE, file upload handling, output cleanup, tool-call parsing, and a dashboard for requests and account status.
- Core operation depends on chat.qwen.ai web sessions and browser automation, tying availability to one service and its terms; the project disclaims official affiliation and limits its stated purpose to education and study.
- Operators must run a Bun service and manage Qwen credentials and persisted sessions, adding operational and credential-handling work compared with a hosted API.
- The README says Qwen does not natively support tool calling; the gateway parses model output text, and the result is not perfect.
- The README makes no service-level, quota, or long-term availability guarantees; website login or rate-limit changes may disrupt requests.
How does this agent compare with similar options?
Compared with calling a hosted OpenAI-compatible API directly, Qwen Gate is a self-run local gateway backed by chat.qwen.ai web sessions. It wraps those sessions in an OpenAI-style endpoint, at the cost of operating browser authentication and Qwen accounts. The README does not directly compare it with other gateways.
Key facts side by side with the most closely related agents.
| Agent | Source review | Form / cost | Stars | Updated | Language | Full support on |
|---|---|---|---|---|---|---|
| Qwen Gate This agent | Insufficient evidence | CLIFree | ★ 203 | 1mo ago | TypeScript | OpenAI API |
| HarnessRouter Community Edition | 67 · Some gaps | Self-hosted serviceFree + model costs | ★ 3k | today | Python | Codex · Claude Code |
| My Free Code | 54 · Major gaps | Self-hosted serviceFree + model costs | ★ 624 | 1d ago | Python | Claude Code · OpenAI API · Claude API |
| OpenClacky | 48 · Major gaps | CLIFree + model costs | ★ 1.2k | today | Ruby | OpenAI API · Claude API |
How does FollowAgents rate this agent?
- Not found in source: least-privilege scopingGrant only what the task needs: a dedicated account or read-only token, scoped to specific directories and repos.
- Not found in source: confirmation before actingTurn on (or add) a confirmation step before it acts, and try it in a sandbox or test environment before real data.
- Not found in source: data-flow disclosureWatch which external services it contacts (proxy or firewall logs) and keep sensitive data out until you know where it goes.
- Not found in source: sensitive-data handlingUse dedicated, low-privilege, revocable API keys — never production credentials — and keep secrets out of logs.
- Not found in source: dependency securityPin versions and run a dependency audit (npm audit, pip-audit) before installing; prefer running it in a container.
- Not found in source: disclosed external effectsEstablish which external systems it writes to, sends to or changes, and verify with test accounts or repos before production.
- Not found in source: rollback or recovery pathBack up first, or work on a git branch or snapshot, so its changes can be undone.
- Not found in source: verifiable attributionInstall from the official repo or registry and check the publisher and URL to avoid look-alike packages.
- This outcome reflects incomplete supplied materials; it does not identify a red-line risk, and no execution or independent testing was performed.
- The README describes handling Qwen account credentials and sessions and advises dedicated accounts and compliance with service terms. The supplied materials do not allow verification of credential storage, network flows, or access controls.
FAQ
Do Qwen model requests incur a per-token charge?
What account and runtime do I need?
Can I use it with an OpenAI SDK or Claude Code?
http://localhost:26405/v1; requests go through the local gateway to Qwen.