Get an API key and set it as an environment variable. If using the SDK, install it.
Supported models
The Wan text-to-image family uses different endpoints and request formats by version:
| Model | Endpoint | Input format | Resolution | Max prompt length |
|---|---|---|---|---|
wan2.6-t2i | /services/aigc/image-generation/generation | messages array | 1280*1280 to 1440*1440, ratio 1:4 to 4:1 | 2,100 chars |
wan2.5-t2i-preview | /services/aigc/text2image/image-synthesis | prompt string | 1280*1280 to 1440*1440, ratio 1:4 to 4:1 | 2,000 chars |
wan2.2-t2i-plus | /services/aigc/text2image/image-synthesis | prompt string | 512–1440 per side, max 1440*1440 | 500 chars |
wan2.2-t2i-flash | /services/aigc/text2image/image-synthesis | prompt string | 512–1440 per side, max 1440*1440 | 500 chars |
wan2.1-t2i-plus | /services/aigc/text2image/image-synthesis | prompt string | 512–1440 per side, max 1440*1440 | 500 chars |
wan2.1-t2i-turbo | /services/aigc/text2image/image-synthesis | prompt string | 512–1440 per side, max 1440*1440 | 500 chars |
wanx2.0-t2i-turbo | /services/aigc/text2image/image-synthesis | prompt string | 512–1440 per side, max 1440*1440 | 800 chars |
wan2.6-t2i also supports a synchronous endpoint (single-request, immediate response).
SDK version requirements
- wan2.6-t2i: DashScope Python SDK 1.25.7+, Java SDK 2.22.6+
- wan2.5 and earlier: DashScope Python SDK 1.25.2+, Java SDK 2.22.2+
Authorizations
string
header
required
DashScope API Key. Create one in the Qwen Cloud console.
Header Parameters
enum<string>
required
Must be enable to create an asynchronous task.
enable