Quick Start
Get up and running in 4 steps.
1
Install
Run the one-liner installer to download and set up qwen-proxy.
curl -fsSL https://rlabs.arosyihuddin.com/install.sh | bash 2
Login
Authenticate with your Qwen account. Supports headless, headed, token, or bulk login.
qwen-proxy login 3
Start Server
Start the proxy server as a background daemon on port 8080.
qwen-proxy start 4
Use the API
Send requests using any OpenAI-compatible client or SDK.
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-max-latest",
"messages": [{"role": "user", "content": "Hello!"}],
"stream": true
}' CLI Commands
Complete reference for all available commands.
Usage
qwen-proxy login [options] Flags
--headed Open visible browser for manual/Google login--token <jwt> Directly provide a JWT token (skip browser)--file <path> Bulk login from text file (email:password per line)Examples
# Interactive headless login
qwen-proxy login
# Manual browser login (supports Google Sign-In)
qwen-proxy login --headed
# Direct JWT token
qwen-proxy login --token eyJhbGciOi...
# Bulk login from file
qwen-proxy login --file accounts.txt Usage
qwen-proxy logout [email] Examples
# Remove specific account
qwen-proxy logout user@example.com
# Remove ALL accounts
qwen-proxy logout Usage
qwen-proxy accounts Examples
qwen-proxy accounts Usage
qwen-proxy start Examples
qwen-proxy start Usage
qwen-proxy stop Examples
qwen-proxy stop Usage
qwen-proxy restart Examples
qwen-proxy restart Usage
qwen-proxy status Examples
qwen-proxy status Usage
qwen-proxy logs [options] Flags
--tail <n> Show last N lines--clear Clear log fileExamples
# Follow logs in real-time
qwen-proxy logs
# Show last 50 lines
qwen-proxy logs --tail 50
# Clear logs
qwen-proxy logs --clear Usage
qwen-proxy config [get|set] [key] [value] Examples
# Show all config
qwen-proxy config
# Get specific value
qwen-proxy config get port
# Set value
qwen-proxy config set port 3000
qwen-proxy config set api-keys key1,key2,key3 Usage
qwen-proxy update Examples
qwen-proxy update API Endpoints
OpenAI-compatible REST API reference.
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| GET | / | Server info (name, version, endpoints, account count) | - |
| GET | /healthz | Health check (status, account count, timestamp) | - |
| GET | /v1/models | List available Qwen models | Required |
| POST | /v1/chat/completions | Chat completions (streaming + non-streaming) | Required |
| POST | /v1/images/generations | Generate images | Required |
| POST | /v1/images/edits | Edit images | Required |
| POST | /v1/videos/generations | Generate videos | Required |
| GET | /v1/validate | Validate token status for all accounts | Required |
| GET | /v1/refresh | Force refresh tokens | Required |
| POST | /v1/chats/delete | Delete all chats | Required |
| GET | /dashboard | Web dashboard SPA | - |
| GET | /api/dashboard/stats | Dashboard overview stats | - |
| GET | /api/dashboard/logs | Request logs | - |
| GET | /api/dashboard/usage | Usage statistics | - |
| GET | /api/dashboard/accounts | List accounts with status | - |
| GET | /api/dashboard/models | List models | - |
| POST | /api/dashboard/chat | Chat playground | - |
| POST | /api/dashboard/image | Image generation playground | - |
Configuration
All configuration options stored in ~/.qwen-proxy/config.json.
| Key | Type | Default | Description |
|---|---|---|---|
port | number | 8080 | Server port |
api-keys | string[] | [] | API keys for proxy access (comma-separated) |
upstream | string | https://qwen.aikit.club | Upstream API URL |
debug | boolean | false | Enable debug logging |
refresh-interval | number | 60000 | Background token refresh interval (ms) |
dashboard-password | string | "" | Dashboard login password (empty = no auth) |
Authentication
API keys can be provided via any of these methods:
Authorization: Bearer <key> Standard Bearer token headerX-Api-Key: <key> Custom API key header?key=<key> Query parameterIf no API keys are configured, the proxy is open to all requests.
Architecture
How qwen-proxy works under the hood.
Architecture
Client (OpenAI SDK / curl / any HTTP client)
│
▼
┌─────────────────────────────────────────┐
│ qwen-proxy (localhost:8080) │
│ │
│ ┌─ CORS Middleware │
│ ├─ Request Logger │
│ ├─ API Key Auth │
│ │ │
│ ├─ Token Manager │
│ │ ├─ Round-robin account selection │
│ │ ├─ Background token refresh │
│ │ └─ Proactive renewal (20min lead) │
│ │ │
│ ├─ Routes │
│ │ ├─ /v1/chat/completions │
│ │ ├─ /v1/models │
│ │ ├─ /v1/images/* │
│ │ └─ /v1/videos/* │
│ │ │
│ └─ Dashboard (SPA) │
│ ├─ Stats & Monitoring │
│ ├─ Account Management │
│ └─ Chat/Image/Video Playground │
└─────────────────────────────────────────┘
│
▼
Upstream API (qwen.aikit.club)
│
▼
Qwen AI (chat.qwen.ai) Storage Layout
File Structure
~/.qwen-proxy/
├── config.json # Server configuration
├── server.pid # Background server PID
├── server.log # Server log file (rotated at 10MB)
└── accounts/
├── qwen-user1.json # JWT token for account 1
└── qwen-user2.json # JWT token for account 2