Qwen API documentation
A concise reference for authentication, Qwen image generation, asynchronous task status, model IDs, and errors.
Quickstart
The API uses standard JSON over HTTPS. Create a key, submit a generation, and poll the returned task ID.
- 01
Create a Bearer key
- 02
POST a generation
- 03
Poll the task ID
Base URL
All public API requests use the qwenapi.org origin.
https://qwenapi.orgAuthentication
Send your Qwen API key in the Authorization header on every generation, status, and history request.
Authorization: Bearer $QWEN_API_KEY
Keep API keys on your server. Do not expose them in browser bundles, public repositories, or client logs.
Generate an image
Submit a supported live model ID and the model-specific input fields.
curl https://qwenapi.org/api/v1/images/generations \
-H "Authorization: Bearer $QWEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-3",
"prompt": "Editorial product photo in soft morning light",
"aspect_ratio": "16:9",
"resolution": "1K"
}'Accepted response
{
"code": 200,
"message": "success",
"data": {
"task_id": "n86...qw3",
"status": "IN_PROGRESS"
}
}Get task status
Use the returned task ID to retrieve progress, errors, and final output URLs.
curl "https://qwenapi.org/api/v1/tasks/$TASK_ID" \ -H "Authorization: Bearer $QWEN_API_KEY"
IN_PROGRESS
The backend accepted the task and is working.
SUCCESS
Output URLs are ready for retrieval.
FAILED
The task stopped with a structured error.
Live model IDs
Only these model IDs currently resolve to billing-backed production routes.
| Model | Cost | Input | Output |
|---|---|---|---|
| qwen-image-3 | 10 credits / image | Text, up to 3 images | PNG or JPEG |
| qwen2-image | 10 credits / image | Text or image | PNG or JPEG |
| qwen-image-2512 | 5 credits / image | Text or images | PNG, JPEG, WebP |
| qwen-multi-angles | 5 credits / image | 1-3 images | PNG or JPEG |
| qwen-layered | 10 credits / layer | Image and instruction | Layer images |
Errors
HTTP status codes are paired with structured JSON errors. Log the task ID and message when contacting support.
400invalid_requestValidate the model ID and request fields.401unauthorizedCheck that the Bearer key is present and active.402insufficient_creditsAdd credits in the billing dashboard.404not_foundVerify the task ID belongs to a Qwen route.429rate_limitedBack off and retry with jitter.500server_errorRetry later and retain the task ID for support.