Skip to main content
Qwen

Qwen synchronous

Real-time image generation

POST
/services/aigc/multimodal-generation/generation
cURL
curl --location 'https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/multimodal-generation/generation' \
--header 'Content-Type: application/json' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--data '{
  "model": "qwen-image-2.0-pro",
  "input": {
    "messages": [
      {
        "role": "user",
        "content": [
          {
            "text": "Healing-style hand-drawn poster featuring three puppies playing with a ball on lush green grass. The main title Come Play Ball! is prominently displayed at the top in bold, blue cartoon font."
          }
        ]
      }
    ]
  },
  "parameters": {
    "negative_prompt": "",
    "prompt_extend": true,
    "watermark": false,
    "size": "2048*2048"
  }
}'
{
  "output": {
    "choices": [
      {
        "finish_reason": "stop",
        "message": {
          "content": [
            {
              "image": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.png?Expires=xxx"
            }
          ],
          "role": "assistant"
        }
      }
    ]
  },
  "usage": {
    "height": 928,
    "image_count": 1,
    "width": 1664
  },
  "request_id": "d0250a3d-b07f-49e1-bdc8-6793f4929xxx"
}

Authorizations

string
header
required

DashScope API Key. Create one in the Qwen Cloud console.

Body

application/json
enum<string>
required

Model name.

qwen-image-2.0-pro,qwen-image-2.0,qwen-image-max,qwen-image-plus,qwen-image
qwen-image-2.0-pro
object
required

Input data containing the messages array.

object

Image generation parameters.

Response

200-application/json
object
object

Usage statistics (successful results only).

string
default"d0250a3d-b07f-49e1-bdc8-6793f4929xxx"

Unique request identifier for tracing and troubleshooting.

abf1645b-b630-433a-92f6-xxxxxx