Skip to main content
Qwen

Qwen — async image generation (3.0 and 2.1 series)

Asynchronous image generation for the qwen-image-3.0 and qwen-image-2.1 series

POST
https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/image-generation/generation
cURL (Submit task)
# Singapore (ap-southeast-1). For another region, replace ap-southeast-1 in the URL.
# API keys are region-specific. See https://docs.qwencloud.com/developer-guides/getting-started/regions
curl --location 'https://ap-southeast-1.maas.qwencloudapi.com/api/v1/services/aigc/image-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'X-DashScope-Async: enable' \
--data '{
  "model": "qwen-image-3.0-pro",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "A healing-style hand-drawn poster featuring three puppies playing with a ball on lush green grass."
          }
        ]
      }
    ]
  },
  "parameters": {
    "prompt_extend": true
  }
}'
{
  "output": {
    "task_status": "PENDING",
    "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
  },
  "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Workflow

  1. Submit a task via POST /services/aigc/image-generation/generation with the X-DashScope-Async: enable header.
  2. Poll for results via GET /tasks/{task_id} until task_status reaches SUCCEEDED or FAILED. Poll every 10 seconds.

Authorizations

string
header
required

DashScope API Key. Create one in the QwenCloud console.

Header Parameters

enum<string>
required

Must be set to enable for asynchronous task submission. Missing this header returns the error: "current user api does not support synchronous calls".

enable

Body

application/json
enum<string>
required

Model name.

qwen-image-3.0-pro,qwen-image-3.0,qwen-image-2.1-pro,qwen-image-2.1-turbo
qwen-image-3.0-pro
object
required

Input data containing the messages array.

object

Image generation parameters.

Response

200-application/json
string
default"4909100c-7b5a-9f92-bfe5-xxxxxx"

Unique request identifier.

object