Skip to content

Image Generation

Overview

    • Method: POST
    • Path: /v1/images/generations
    • Content-Type:application/json

Authentication

  • Authorization: Bearer sk-xxx (required)

Request Example

HeaderExampleRequired
Content-Typeapplication/jsonYes
AuthorizationBearer sk-xxxxYes

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

ParameterTypeRequiredDefaultDescription
promptstringYes-Text description of the desired image, max 800 characters
modelstringYes-Model name: qwen-image/wan2.2-t2i-flash/wan2.2-t2i-plus
nnumberNo1Number of outputs, qwen-image supports 1 only
sizestringNo1328x1328Image size, supports sizes listed in document header
response_formatstringNourlReturn format, url or b64_json
negative_promptstringNo-Negative prompt to avoid unwanted content
prompt_upsamplingbooleanNotrueEnable smart prompt rewriting
seedstringNo-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
    }
  }
}