OpenAI-compatible API endpoints for Qwen AI
Features β’ Quick Start β’ Supported Endpoints β’ OpenAPI Docs β’ Usage Examples β’ License
Qwen API Proxy acts as a bridge between Qwen AI's proprietary API and the widely-adopted OpenAI API format. This allows developers to seamlessly integrate Qwen's advanced AI capabilities into their applications using familiar OpenAI-compatible endpoints.
Note: This is an unofficial proxy and not affiliated with Alibaba Cloud or Qwen AI.
API documentation : https://qwen-api.readme.io/
- Spec file:
qwen.json(OpenAPI 3.1.0) - What it is: OpenAPI-ready API documentation covering all endpoints, OpenAI-compatible request/response shapes, security, and examples.
- How to use:
- Import
qwen.jsoninto Swagger UI, Redocly, Postman, Bruno, or Insomnia. - Generate typed clients with your preferred tool (e.g.,
openapi-generator,orval).
- Import
- Servers: Defaults to
https://qwen.aikit.club; you can change thehostvariable or edit the server URL after import.
| Feature | Description |
|---|---|
| π OpenAI Compatibility | Drop-in replacement for OpenAI API calls |
| π¬ Chat Completions | Text-based conversations with all Qwen models |
| π¨ Image Generation | Create stunning images from text prompts |
| βοΈ Image Editing | Modify existing images with text instructions |
| π¬ Video Generation | Transform text into video content |
| π¬ Deep Research | Comprehensive research with web search and citations |
| π¨π»βπ» Web Development | Generate interactive web components and UI elements |
| ποΈ Full-Stack Apps | Complete application development from frontend to backend |
| π Web Search | Enable web search capabilities in conversations |
| π§ Thinking Mode | Activate reasoning mode for complex problem solving |
| ποΈ Vision Support | Analyze images, PDFs, and visual content |
| π Multimodal Files | Support for image, audio, video, and document uploads |
| π CORS Support | Full cross-origin resource sharing support |
| β‘ Edge Performance | Lightning-fast global deployment via Cloudflare Workers |
| Endpoint | Method | Description |
|---|---|---|
/v1/validate |
GET/POST | Validate token |
/v1/refresh |
GET/POST | Refresh token |
/v1/models |
GET | List available models |
/v1/chat/completions |
POST | Chat completions |
/v1/images/generations |
POST | Generate images |
/v1/images/edits |
POST | Edit existing images |
/v1/videos/generations |
POST | Generate videos |
/v1/chats/delete |
DELETE/POST | Delete all chats |
| Model Name | ποΈ Vision | π‘ Reasoning | π Web Search | π§ Tool Calling |
|---|---|---|---|---|
| QVQ-Max | β | β | β | β |
| Qwen-Deep-Research | β | β | β | β |
| Qwen2.5-Max | β | β | β | β |
| Qwen3-Next-80B-A3B | β | β | β | β |
| Qwen2.5-Plus | β | β | β | β |
| Qwen2.5-Turbo | β | β | β | β |
| Qwen2.5-14B-Instruct-1M | β | β | β | β |
| Qwen2.5-72B-Instruct | β | β | β | β |
| Qwen2.5-Coder-32B-Instruct | β | β | β | β |
| Qwen2.5-Omni-7B | β | β | β | β |
| Qwen2.5-VL-32B-Instruct | β | β | β | β |
| Qwen3-235B-A22B-2507 | β | β | β | β |
| Qwen3-30B-A3B-2507 | β | β | β | β |
| Qwen3-Coder | β | β | β | β |
| Qwen3-Coder-Flash | β | β | β | β |
| Qwen-Web-Dev | β | β | β | β |
| Qwen-Full-Stack | β | β | β | β |
| Qwen3-Max | β | β | β | β |
| Qwen3-Omni-Flash | β | β | β | β |
| Qwen3-VL-235B-A22B | β | β | β | β |
| Qwen3-VL-32B | β | β | β | β |
| Qwen3-VL-30B-A3B | β | β | β | β |
| QWQ-32B | β | β | β | β |
The public instance is available at: https://qwen.aikit.club
The proxy requires a Bearer token containing Qwen credentials:
const headers = {
Authorization: "Bearer YOUR_QWEN_ACCESS_TOKEN",
"Content-Type": "application/json",
};For quick testing, you can use this temporary token until it expires.
- Token:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjI3ZGUyYzVlLTYzZDYtNDU2MC1iNmQ3LTI2MDk0NDhjZmJmNiIsImxhc3RfcGFzc3dvcmRfY2hhbmdlIjoxNzU5ODg4MzE5LCJleHAiOjE3NjIwNDUzMDB9.eoKNQjLB1PUrupXU0PvPxuiOSbnF9F7XJATu9gwucEQ
- Expires: 2025-11-02 01:01:40 UTC (2025-11-02 06:31:40 IST, UTC+05:30)
- Note: This token is for evaluation only and will stop working after the expiration time.
To obtain your Qwen API token, follow these steps:
- Visit Qwen Chat: Go to chat.qwen.ai and log in to your account
- Run the Token Extractor: Copy and paste the following JavaScript code into your browser's developer console (press F12 β Console tab):
javascript:(function(){if(window.location.hostname!=="chat.qwen.ai"){alert("π This code is for chat.qwen.ai");window.open("https://chat.qwen.ai","_blank");return;}
function getApiKeyData(){const token=localStorage.getItem("token");if(!token){alert("β qwen access_token not found !!!");return null;}
return token;}
async function copyToClipboard(text){try{await navigator.clipboard.writeText(text);return true;}catch(err){console.error("β Failed to copy to clipboard:",err);const textarea=document.createElement("textarea");textarea.value=text;textarea.style.position="fixed";textarea.style.opacity="0";document.body.appendChild(textarea);textarea.focus();textarea.select();const success=document.execCommand("copy");document.body.removeChild(textarea);return success;}}
const apiKeyData=getApiKeyData();if(!apiKeyData)return;copyToClipboard(apiKeyData).then((success)=>{if(success){alert("π Qwen access_token copied to clipboard !!! π");}else{prompt("π° Qwen access_token:",apiKeyData);}});})();-
Get Your Token: The script will automatically:
- Extract your access_token from localStorage
- Copy the access_token to your clipboard
-
Use the Token: The copied token is now ready to use as your
Bearertoken in API requests
Important Notes:
β οΈ This script only works on chat.qwen.ai - make sure you're logged in- π Keep your token secure - it provides access to your Qwen account
- π You may need to regenerate the token periodically if it expires
Validate the access token produced by the browser JS snippet above.
curl -X POST https://qwen.aikit.club/validate \
-H "Content-Type: application/json" \
-d '{"token": "YOUR_QWEN_ACCESS_TOKEN"}'Or via GET:
curl "https://qwen.aikit.club/validate?token=YOUR_QWEN_ACCESS_TOKEN"const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-max-latest",
messages: [{ role: "user", content: "Hello, how are you?" }],
stream: false,
}),
});const response = await fetch("https://qwen.aikit.club/v1/images/generations", {
method: "POST",
headers: headers,
body: JSON.stringify({
prompt: "A beautiful sunset over mountains",
size: "1024x1024",
}),
});// Using FormData for file upload
const formData = new FormData();
formData.append("image", imageFile); // File object
formData.append("prompt", "Change the sky to a starry night");
const response = await fetch("https://qwen.aikit.club/v1/images/edits", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_QWEN_ACCESS_TOKEN",
},
body: formData,
});
// Or using JSON with image URL/base64
const response = await fetch("https://qwen.aikit.club/v1/images/edits", {
method: "POST",
headers: headers,
body: JSON.stringify({
image: "https://example.com/image.jpg", // or base64 data URL
prompt: "Add a rainbow in the background",
}),
});const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-max-latest",
messages: [{ role: "user", content: "What are the latest AI developments?" }],
tools: [{ type: "web_search" }],
}),
});const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-max-latest",
messages: [{ role: "user", content: "Solve this complex math problem: ..." }],
enable_thinking: true,
thinking_budget: 30000,
}),
});Note: qwen3-coder-plus supports Qwen Code β a coding agent that operates in digital environments and can issue function/tool calls. This API supports handling the function calls produced by the agent.
const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen3-coder-plus",
tools: [{ type: "code" }],
messages: [
{ role: "user", content: "Write a JavaScript function to add two numbers" },
],
stream: true,
}),
});const response = await fetch("https://qwen.aikit.club/v1/videos/generations", {
method: "POST",
headers: headers,
body: JSON.stringify({
prompt: "A cat playing with a ball of yarn in slow motion",
size: "1280x720",
}),
});const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-deep-research",
messages: [
{
role: "user",
content: "Research the latest developments in quantum computing",
},
],
stream: false,
}),
});The qwen-web-dev model is specialized for frontend web development, creating interactive web components, HTML/CSS/JavaScript code, and providing live preview capabilities.
Features:
- HTML/CSS/JavaScript code generation
- Interactive UI components
- Responsive design support
- Real-time preview generation
- Framework support: React, Vue, Vanilla JS, HTML5
- Styling: Tailwind CSS, Bootstrap
const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-web-dev",
messages: [
{
role: "user",
content:
"Create a responsive navigation bar with a logo, menu items, and a mobile hamburger menu using HTML, CSS, and vanilla JavaScript",
},
],
stream: false,
}),
});Example Output: The model will generate complete, production-ready web components with:
- Clean, semantic HTML structure
- Modern CSS with responsive breakpoints
- Vanilla JavaScript for interactivity
- Mobile-first design approach
- Accessibility considerations
The qwen-full-stack model handles complete application development, from frontend to backend, database design, API development, and system architecture.
Features:
- Frontend and backend code generation
- Database schema design
- RESTful and GraphQL API development
- Authentication and authorization
- Microservices architecture
- Deployment-ready code
- Multi-language support: JavaScript, TypeScript, Python, Java, Go, PHP
- Frameworks: React, Vue, Angular, Node.js, Express, Django, Flask, Spring Boot
const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-full-stack",
messages: [
{
role: "user",
content:
"Create a complete REST API for a task management system with user authentication, CRUD operations for tasks, and a React frontend. Use Node.js/Express for the backend and MongoDB for the database.",
},
],
stream: false,
}),
});Example Full-Stack Application:
// Advanced example: Building a complete blog platform
const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-full-stack",
messages: [
{
role: "user",
content: `Build a complete blog platform with the following requirements:
Backend (Node.js/Express):
- User authentication with JWT
- CRUD operations for blog posts
- Comment system
- Like/bookmark functionality
- Image upload support
- RESTful API endpoints
Frontend (React):
- Home page with post listings
- Post detail page with comments
- Create/Edit post interface
- User profile page
- Responsive design with Tailwind CSS
Database (MongoDB):
- User schema with authentication
- Post schema with relationships
- Comment schema
- Proper indexing for performance`,
},
],
stream: false,
}),
});Key Differences:
| Feature | qwen-web-dev | qwen-full-stack |
|---|---|---|
| Focus | Frontend UI/UX | Complete application stack |
| Code Output | HTML, CSS, JavaScript | Frontend + Backend + Database |
| Use Cases | Web components, landing pages, UI elements | Complete apps, APIs, microservices |
| Complexity | Simple to moderate | Moderate to complex |
| Architecture | Client-side only | Full system architecture |
// Using DELETE method
const response = await fetch("https://qwen.aikit.club/v1/chats/delete", {
method: "DELETE", // GET and POST are also supported
headers: headers,
});The API supports various file formats for comprehensive multimodal interactions:
β οΈ Important Limitation: Multiple inputs of the same modality category are not supported. Image, Audio, and Video are considered the same category (media files), while Documents (PDF, TXT, etc.) are a separate category. You can combine different categories (e.g., image + PDF) but cannot combine files within the same category (e.g., image + video).
- Media Files (same category):
- Images: JPG, PNG, GIF, WebP (most common), BMP, TIFF, ICO, ICNS, JFIF, JP2
- Audio: MP3, WAV, M4A, AAC (most common), AMR
- Video: MP4, MOV, AVI, MKV (most common), WMV, FLV
- Documents (separate category): PDF, TXT, MD (most common), DOC, DOCX, CSV, XLS, XLSX
π‘ Tip: Bold formats are the most commonly used and recommended for best compatibility.
The following limits apply to multimodal file uploads:
| File Type | Max Size (MB) | Max Count | Max Duration (seconds) |
|---|---|---|---|
| Images | 10 | 5 | - |
| Audio | 100 | 1 | 180 |
| Video | 500 | 1 | 600 |
| Documents | 20 | 5 | - |
| Default | 20 | - | - |
π Summary: You can upload up to 5 images (10MB each), 1 audio file (100MB, 3 minutes), 1 video file (500MB, 10 minutes), or 5 documents (20MB each) per request.
- β Multiple images
- β Image + PDF
- β Audio + PDF
- β Video + PDF
- β Single image/audio/video only
- β Image + Audio
- β Image + Video
- β Audio + Video
- β Multiple videos
- β Multiple audio files
// Analyze any supported file type using standard chat completions
const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-max-latest",
messages: [
{
role: "user",
content: [
{ type: "text", text: "What do you see in this image?" },
{
type: "image_url",
image_url: {
url: "https://download.samplelib.com/png/sample-hut-400x300.png",
// or use base64: "data:image/jpeg;base64,..."
},
},
],
},
],
}),
});// β
VALID: Combine different categories (Media + Document)
const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-max-latest",
messages: [
{
role: "user",
content: [
{ type: "text", text: "Analyze this image and PDF document together" },
{
type: "image_url",
image_url: { url: "https://download.samplelib.com/png/sample-hut-400x300.png" },
},
{
type: "file_url",
file_url: { url: "https://pdfobject.com/pdf/sample.pdf" },
},
],
},
],
}),
});// β INVALID: Cannot combine image + video (same category)
const response = await fetch("https://qwen.aikit.club/v1/chat/completions", {
method: "POST",
headers: headers,
body: JSON.stringify({
model: "qwen-max-latest",
messages: [
{
role: "user",
content: [
{ type: "text", text: "This will not work properly" },
{
type: "image_url",
image_url: { url: "https://download.samplelib.com/png/sample-hut-400x300.png" },
},
{
type: "video_url",
video_url: { url: "https://download.samplelib.com/mp4/sample-10s.mp4" },
},
// β Cannot mix media files (image, audio, video)
],
},
],
}),
});This project is licensed under the MIT License - see the LICENSE file for details.
Built with β€οΈ by Tarun
If you find this project useful, please consider giving it a β on GitHub!