Image Generation
Overview
- Method:
POST
- Method:
- Path:
/v1/images/generations
- Path:
- Content-Type:
application/json
- Content-Type:
Authentication
Authorization: Bearer sk-xxx(required)
Request Example
Header
| Header | Example | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Authorization | Bearer sk-xxxx | Yes |
Request Body (JSON)
json
{
"model": "qwen-image",
"prompt": "A C4D-style e-commerce promotion poster in blue tones, presenting a fresh and lively vibe. The top features bold 3D text 'V-API Double 11 pre-sale is here' with strong visual impact. Center has a blue AI character with a smaller AI figure beside it. Surroundings include small robot models and blue mechanical equipment, creating a bustling promotional scene. Bottom shows yellow text '399 off 99' highlighting the promotional message.",
"n": 1,
"size": "1328x1328",
"response_format": "url",
"negative_prompt": "low resolution, errors, worst quality, low quality, missing parts, extra fingers, poor proportions",
"prompt_upsampling": true,
"seed": "123456"
}Parameter Description
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| prompt | string | Yes | - | Text description of the desired image, max 800 characters |
| model | string | Yes | - | Model name: qwen-image/wan2.2-t2i-flash/wan2.2-t2i-plus |
| n | number | No | 1 | Number of outputs, qwen-image supports 1 only |
| size | string | No | 1328x1328 | Image size, supports sizes listed in document header |
| response_format | string | No | url | Return format, url or b64_json |
| negative_prompt | string | No | - | Negative prompt to avoid unwanted content |
| prompt_upsampling | boolean | No | true | Enable smart prompt rewriting |
| seed | string | No | - | Random seed [0,2147483647] |
Response Example (200)
json
{
"created": 1757255628,
"data": [
{
"url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/7d/ef/20250907/0eea5e95/36e551bc-216a-4e88-bfa6-72dc738722a6-1.png?Expires=1757861427&OSSAccessKeyId=LTAI5tKPD3TMqf2Lna1fASuh&Signature=mCw%2FUlMTfV1xXrloIg63uXO4Q70%3D"
}
],
"usage": {
"total_tokens": 0,
"input_tokens": 0,
"output_tokens": 0,
"input_tokens_details": {
"text_tokens": 0,
"image_tokens": 0
}
}
}