Qwen Gate

Expose Qwen web sessions through a self-hosted OpenAI-compatible API for existing developer tools.

Stars
★ 203
Last updated
1mo ago
License
MIT
Primary language
TypeScript

At a glance

How it runs
CLISelf-hosted serviceWeb app
Works with
Platform-specificOpenAI APIClaude Code (Partial support)
Cost
Free, no paid service needed
Setup effort
Medium · a few setup steps
You'll need
Bun 1.3+PlaywrightQwen accountShell / CLINetwork accessLocal filesystem
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

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.

  1. A Claude Code, Cursor, or OpenCode user wants to point an existing OpenAI-compatible client at a self-hosted endpoint for Qwen models.
  2. A developer managing several Qwen accounts wants round-robin distribution, automatic failover, and cooldown tracking.
  3. A developer whose client expects SSE wants to route streaming requests through Qwen web sessions.
  4. An operator wants a local dashboard for request logs, account status, and outbound network inspection.
  5. 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
qg

For 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:

qg
curl -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?

Pros
  • Implements /v1/chat/completions and /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.
Limitations
  • 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?

FollowAgents source review · FARS-2.1
Insufficient evidence
Risks and how to mitigate them
  • 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.
Evidence confidence: Low Reviewed Oct 10, 2026 Reviewed revision 5220f7d3c50c
See the full review method →

FAQ

Do Qwen model requests incur a per-token charge?
The README describes the Qwen web models it exposes as free to use, but does not specify quotas, reliability, or service guarantees. Users must follow chat.qwen.ai's terms.
What account and runtime do I need?
You need Bun to run the gateway and a Qwen email/password account to add in the dashboard. Browser automation handles sign-in. The README recommends at least three dedicated accounts for rotation and advises against using a personal Qwen account.
Can I use it with an OpenAI SDK or Claude Code?
The README explicitly lists OpenAI-compatible clients and Claude Code. Point the client to http://localhost:26405/v1; requests go through the local gateway to Qwen.
Are tool calls equivalent to native OpenAI tool calling?
No. The README says Qwen emits tool calls as response text and the gateway parses that text into OpenAI-style objects; it notes that this is imperfect.
What happens when an account is rate-limited or login fails?
The gateway supports account rotation, failover, cooldowns, and retries. The README does not guarantee these mechanisms prevent every rate limit or browser-login failure.
View on GitHub ↗ Install ↓

Compare agents like this one

The same FARS review applied across the shortlist this agent qualifies for.

Related agents