API reference

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.

  1. 01

    Create a Bearer key

  2. 02

    POST a generation

  3. 03

    Poll the task ID

Base URL

All public API requests use the qwenapi.org origin.

https://qwenapi.org

Authentication

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.

POST/api/v1/images/generations
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.

GET/api/v1/tasks/:task_id
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.

ModelCostInputOutput
qwen-image-310 credits / imageText, up to 3 imagesPNG or JPEG
qwen2-image10 credits / imageText or imagePNG or JPEG
qwen-image-25125 credits / imageText or imagesPNG, JPEG, WebP
qwen-multi-angles5 credits / image1-3 imagesPNG or JPEG
qwen-layered10 credits / layerImage and instructionLayer 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.