Model or dataset
YuJunZhiXue/qwen2API avatar
YuJunZhiXue/qwen2API

qwen2API drives a browser, and its rate limits say so out loud

A project converting the Qwen web page to an API.

975 stars291 forksGoLicense varies

At a glance

What is it?
A Go gateway that exposes the Qwen web page through OpenAI, Anthropic and Gemini shaped endpoints, with a React panel for accounts and keys, a browser stack baked into the runtime image, and cooldown defaults measured in minutes.
Who is it for?
Start by reading Qwen's own terms before you deploy anything, because this gateway wraps the consumer web page rather than a documented developer endpoint, and what you are taking is a web session turned into an API surface. If your use is a personal tool or a lab prototype, the operational picture is reasonable: one compose file, two mounted directories, a health check that already exists, exact Go and Node toolchain requirements, and per-account cooldowns you can tune.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 163 days ago.
What is it written in?
Mainly Go, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 23, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • YuJunZhiXue/qwen2API975 ★ · +29
Star history
Repository2026-09-152026-11-23
YuJunZhiXue/qwen2API946975

29 Stars in the last 69 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The runtime image carries a browser, not just a binary

The clearest thing the project says about its own mechanism is in the Dockerfile rather than in the prose. The runtime stage is debian:bookworm-slim, and it installs ca-certificates, curl, wget and unzip, then a long list of graphics and input libraries: libgtk-3-0, libnss3, libatk-bridge2.0-0, libcups2, libasound2, libpango and libx11 among roughly twenty packages, plus fonts-liberation and fonts-noto-cjk. It also sets PLAYWRIGHT_BROWSERS_PATH=/ms-playwright.

That is the dependency list of a browser being driven, not of a client making an HTTP request to a documented endpoint, and it matches the project description, which calls itself a converter from the Qwen web page to an API. The CJK font package is a small tell of its own: it matters for a page rendered in Chinese.

Two details are worth noticing. Every apt package in that list is a library, and no browser binary is among them, so the browser itself arrives by some route other than the visible package list. And the image is a full Debian userland with a browser stack rather than a distroless or empty base, which is what the shared-memory setting in the compose file exists to support.

One upstream, three protocol vocabularies

The feature map gives you the surface directly. The OpenAI-compatible side exposes chat completions, responses, models, files, image generations and video generations. The Anthropic-compatible side exposes messages at two paths, plus a token counting endpoint. The Gemini-compatible side exposes generateContent and streamGenerateContent under a v1beta path with the model in the route.

Two of those are worth a second look. The models endpoint and the files endpoint are not part of a bare chat proxy, and the presence of image and video generation alongside chat means the account pool is tracking three different kinds of upstream work, each with its own cooldown, rather than one queue. The README's own summary puts it as multi-account rotation with per-account concurrency and separate chat, image and video cooldown tracking.

For the operations side there are three endpoints rather than one: a health check, a readiness probe, and a keepalive probe. The compose file wires the health check into the container itself, polling every thirty seconds with a ten second timeout and a hundred and twenty second start period.

Env-injected keys cannot be deleted from the WebUI

Keys and accounts come from two stores, and the file is explicit about how they differ. A key injected through the environment is accepted at runtime, is not written to data/api_keys.json, and cannot be deleted from the WebUI. An upstream account injected through the environment, in the format token;optional-email;optional-password, is likewise not written to data/accounts.json.

So the WebUI is not the single source of truth for either. Keys you create in the panel live in the data volume; keys you set as environment variables live in your compose file, and no button in the panel will remove them. That is a deliberate split for container deployments, where the same image runs in several environments with different keys, but it means an operator rotating a compromised key has to know which store it is in. Turning the same dial for keepalive has the same shape: environment values lock the corresponding WebUI settings rather than adding to them.

The file also says plainly that real secrets are not to be committed, and that .env.example holds empty values and commented examples only.

Seven documented variables against roughly forty in the template

The environment variable section of the file has a table with seven rows: the admin key, the downstream key variables, the upstream account variable, the keepalive pair, the tool recovery attempts, the host directory pair, and the local directory pair. The example template lists close to forty. Everything else is discoverable only by opening .env.example, including the pool and pacing settings:

env
BROWSER_POOL_SIZE=1
BROWSER_STREAM_TIMEOUT_SECONDS=1800
MAX_INFLIGHT_PER_ACCOUNT=2
ACCOUNT_MIN_INTERVAL_MS=0
REQUEST_JITTER_MIN_MS=0
REQUEST_JITTER_MAX_MS=0
RATE_LIMIT_BASE_COOLDOWN=600
RATE_LIMIT_MAX_COOLDOWN=3600

There are also knobs for upstream stream header, first event and idle timeouts, a retry count, chat identifier prewarming with its own target, TTL and concurrency, chat deletion retries, a ready set threshold, and response tracing with a tail length. The template's final line is a context attachment variable whose name stops after CONTEXT_ATTACHMENT_, so the last documented setting in the file is one you can only partly read.

The defaults pace nothing, and the cooldowns are measured in hours

Read the two halves of that list together. Minimum interval between requests is zero milliseconds, and the jitter bounds are zero, so out of the box the gateway sends as fast as it is asked to. At the other end, the base cooldown is six hundred seconds and the maximum is three thousand six hundred, an hour. Add per-account concurrency of two by default and a browser pool of one, and the picture is a service that will accept whatever you throw at it and then sit out long penalties when the upstream says so.

Those penalty numbers are the most honest statement in the project about what it is wrapping. A service with a published quota does not need a base cooldown measured in minutes. The fact that the README describes separate cooldown tracking for chat, image and video says the same thing again: the upstream treats those as different resources with different limits, which is what a consumer web page does.

None of this is hidden, and the development rules ask contributors to update the file whenever user-visible configuration changes. But the values that decide whether your deployment looks abusive to the upstream are the ones not in the table.

The admin key has no default, and the port has no host restriction

The deployment template asks you to write four lines into a .env file, and the fourth is the management key:

env
HOST_PORT=7860
HOST_DATA_DIR=./data
HOST_LOGS_DIR=./logs
ADMIN_KEY=replace-with-your-own-strong-random-key

That key guards the WebUI and every /api/admin/* path, and the file's own description says to set a strong private value. The example template leaves it empty on purpose, since the repository should not carry a secret, and the file does not say what the server does when it is unset. So the first question after your first start is whether the panel is reachable, not whether it is convenient.

The port mapping is the other half of that question:

yaml
    ports:
      - "${HOST_PORT:-7860}:${PORT:-7860}"

No host address is given, so Docker publishes on all interfaces by default rather than on loopback only. The file points you at http://127.0.0.1:7860 as the address to open, which is a claim about your browser and not a constraint on the container's binding. Nothing in the file documents key rotation for the admin key or for the injected downstream keys.

The verification build in the guide targets Windows

The development section lists Go 1.26, Node.js 20 or later and npm, with Docker needed only for container builds, and gives one command for the whole stack locally. The verification step for the backend is a test run followed by a build that writes its output to a Windows path:

powershell
cd backend
go test ./...
go build -trimpath -ldflags="-s -w" -o ..\bin\qwen2api-backend.exe .

Backslashes and an .exe suffix in a project whose deployment target is a Linux container is an odd pairing, and the surrounding command blocks are all tagged as PowerShell while the commands inside them are Go, npm and plain paths. It is a small thing, but it is the kind of detail that matters when you copy a line into a terminal on the platform the file did not have in mind.

The container build is the opposite: it cross-compiles deliberately, building the frontend on a Node bookworm slim stage, then the backend on a Go bookworm stage with the target OS and architecture passed in as build arguments and a static binary produced with CGO disabled. That is what makes the multi-architecture image publishing the operations section advertises work from one machine.

Three readme files, and no license to go with them

The root carries README.md, README_CN.md and README_EN.md. The language switcher at the top of the main file links one English file and one Simplified Chinese file, and the English one it links is README.md itself. README_EN.md is present in the repository and nothing in that switcher points at it, so a reader arriving through the switcher and a reader arriving through the file listing end up on two different English copies.

The licensing picture is thinner than that. The repository's license field carries no value, and no license file appears among the root entries, which hold a Dockerfile, two compose files, .env.example, .editorconfig, .dockerignore, .gitignore, a .github directory, backend, frontend and start-all.go. A self-hosted gateway that asks you to hold upstream accounts and downstream keys does not ship published terms for the code doing it.

The project's public channel is its only homepage, a Telegram link, and there are no GitHub releases. The last push on record is 2026-06-13, and the version line in the file marks the Go backend and React panel as current while the earlier Python and FastAPI implementation is kept only as historical context.

Editorial conclusion

Start by reading Qwen's own terms before you deploy anything, because this gateway wraps the consumer web page rather than a documented developer endpoint, and what you are taking is a web session turned into an API surface. If your use is a personal tool or a lab prototype, the operational picture is reasonable: one compose file, two mounted directories, a health check that already exists, exact Go and Node toolchain requirements, and per-account cooldowns you can tune. If your use is anything shared or commercial, weigh the defaults first. The account pool rotates upstream accounts, the runtime image carries a full browser stack, and the license field carries no assertion while no license file appears at the root, so you have no published terms for the code you are running. Whatever you decide, set ADMIN_KEY before the first start, keep the port off anything reachable from outside your host, and remember that keys injected through the environment cannot be deleted from the WebUI.

Frequently asked questions

Does qwen2API call an official Qwen API?

No. It converts Qwen web capabilities into common API protocols, and the runtime image installs a browser library stack while setting PLAYWRIGHT_BROWSERS_PATH. Upstream accounts are supplied as a token with an optional email and password, and the account pool tracks separate cooldowns for chat, image and video work.

How do I set the admin key for the qwen2API WebUI?

ADMIN_KEY guards the WebUI and the /api/admin/* management APIs, and the deployment guide tells you to replace it with a strong private value. The example template leaves it empty because the repository should not carry a secret, and the file does not state what the server does when it is unset. Downstream keys can also be injected from the environment, where they cannot be deleted from the WebUI.

Which ports and paths does qwen2API expose?

The compose file maps ${HOST_PORT:-7860}:${PORT:-7860}, and the guide points at http://127.0.0.1:7860 for the WebUI, http://127.0.0.1:7860/healthz for the health check and http://127.0.0.1:7860/keepalive for the keepalive probe. A readiness probe at /readyz is listed as well, and data and logs mount to /app/data and /app/logs.

Can I build qwen2API from source, and what does it need?

Go 1.26, Node.js 20 or later and npm, plus Docker only for container builds. The frontend uses npm ci with npm run dev or npm run build, the backend runs with go run . from the backend directory, and go test ./... covers verification. The local one-command startup is go run start-all.go.

Official sources

  1. Issues
  2. Project website
  3. README
  4. YuJunZhiXue/qwen2API on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/yujunzhixue-qwen2api.svg)](https://hysenlabs.com/projects/yujunzhixue-qwen2api)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/yujunzhixue-qwen2api.svg)](https://hysenlabs.com/projects/yujunzhixue-qwen2api)

Was this useful?