Skip to main content

Aliyun Image Generation

Create images using the Alibaba Cloud Model Studio / DashScope image format. Use the official model, input.messages, and parameters request structure; the platform only provides a unified endpoint, authentication, model routing, and billing.

Supported Models

This endpoint is only for Alibaba Cloud Model Studio / DashScope image generation or editing models, and it only routes to Aliyun channels configured on the platform. The examples follow these official model families:

Model / FamilyUse caseNotes
qwen-image-2.0-pro, qwen-image-2.0Qwen text-to-imagePass prompts in messages[].content[].text
qwen-image-max, qwen-image-plus, qwen-imageQwen text-to-imagePass prompts in messages[].content[].text
wan2.6-imageWanxiang image generation and editingUse text and optional image items in messages[].content[]

For non-Aliyun image models, such as OpenAI, Volcengine Seedream, or Gemini models, use the matching image endpoint instead of this one.

Try It

POST/aliyun/v1/images/generationshttps://api-platform.ope.ai

Authentication

Uses Bearer Token authentication.

  • Header: Authorization: Bearer <token>
  • Example: Authorization: Bearer sk-xxxxxx

Request body (application/json)

FieldTypeRequiredDescriptionDefault / Range
modelstringYesAlibaba Cloud Model Studio / DashScope image model ID. The platform may map it through channel configurationExamples: qwen-image-2.0-pro, qwen-image, wan2.6-image
inputobjectYesImage generation input-
parametersobjectNoGeneration parameters-

input

FieldTypeRequiredDescription
messagesarray<object>YesRequest content array. The official Aliyun docs currently describe single-turn input

messages

FieldTypeRequiredDescription
rolestringYesFixed to user
contentarray<object>YesMessage content array

content

FieldTypeRequiredDescription
textstringYesPositive prompt. Qwen-Image text-to-image and Wan2.6 Image both use one text item in content in the official docs
imagestringNoWan2.6 Image reference image. Supports public image URLs or Base64 image strings

parameters

FieldTypeRequiredDescriptionDefault / Range
sizestringNoOutput size. Use Aliyun's official width*height format, such as 2048*2048 or 1280*1280; Wan2.6 Image also supports 1K and 2KOfficial model default
nintegerNoNumber of output imagesOfficial model limit
negative_promptstringNoNegative prompt-
prompt_extendbooleanNoWhether to enable prompt rewritingOfficial model default
watermarkbooleanNoWhether to add a watermarkOfficial model default
seedintegerNoQwen-Image random seed0 to 2147483647
enable_interleavebooleanNoWan2.6 Image interleaved text-image output modefalse
max_imagesintegerNoMaximum generated images in Wan2.6 Image interleaved modeOfficial model limit
streambooleanNoRequired with streaming output for Wan2.6 Image interleaved synchronous callsFollow the official model docs

Request examples

The domain below is an example: https://api-platform.ope.ai.

curl -X POST "https://api-platform.ope.ai/aliyun/v1/images/generations" \
-H "Authorization: Bearer $OPEAI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen-image-2.0-pro",
"input": {
"messages": [
{
"role": "user",
"content": [
{
"text": "A white mechanical cat sitting beside a minimal desk, cinematic lighting, high detail."
}
]
}
]
},
"parameters": {
"size": "2048*2048",
"n": 1,
"prompt_extend": true,
"watermark": false
}
}'

Response examples

The platform passes through the Aliyun upstream response body. Successful responses typically include output.choices[]; the platform uses the generated image count from the upstream response for billing.

{
"output": {
"choices": [
{
"finish_reason": "stop",
"message": {
"role": "assistant",
"content": [
{
"image": "https://dashscope-result.example.com/generated-image.png"
}
]
}
}
]
},
"usage": {
"image_count": 1,
"width": 2048,
"height": 2048
},
"request_id": "8f0b9c7a-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}

Notes

  • This endpoint only supports Alibaba Cloud Model Studio / DashScope image models and only routes to Aliyun channels. If the model cannot match an Aliyun channel, the platform returns an error.
  • Request fields, value ranges, image input limits, and response shape should follow the official Aliyun documentation for the selected model.