The Wan - reference-to-video model supports multi-modal input (text, images, and videos) and generates videos featuring one or more characters, supporting single-character performances and multi-character interactive scenes. It also supports intelligent shot division for multi-shot videos.
References: User guide
Availability
The model, endpoint URL, and API key must belong to the same region. Cross-region calls fail.
Select a model: Confirm model availability in your target region.
Select a URL: Choose the regional endpoint URL. Both HTTP and HTTPS are supported.
Configure an API key: Select a region, get an API key, and configure it as an environment variable.
Sample codes in this topic apply to the Singapore region.
HTTP
Reference-to-video tasks typically take 1 to 5 minutes, so the API uses asynchronous invocation: "Create a task → Poll for the result".
Step 1: Create a task
Singapore
POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Virginia
POST https://dashscope-us.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Beijing
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
After the task is created, use the returned
task_idto query the result. Thetask_idis valid for 24 hours. Do not create duplicate tasks. Instead, use polling to retrieve the result.For a beginner's tutorial, see Use Postman or cURL.
Request parameters | Multi-character interaction (reference images and videos)Pass image and video URLs in Multi-character interaction (reference videos)Pass multiple video URLs in Single-character role assumptionPass a single video URL in Generate silent videoOnly To generate a silent video, explicitly set |
Request headers | |
Content-Type The content type of the request. Must be | |
Authorization The authentication credentials using a Model Studio API key. Example: | |
X-DashScope-Async Enables asynchronous processing. Must be Important Returns "current user api does not support synchronous calls" error if not included. | |
Request body | |
model The model name. For models and pricing, see Model pricing. Example: wan2.6-r2v-flash. | |
input Basic input information, including the prompt. | |
parameters The config parameters, such as video resolution. |
Response parameters | Successful responseSave the Error responseTask creation failed. See error codes to resolve the issue. |
output Task output. | |
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. | |
code The error code. Returned only when the request fails. See error codes for details. | |
message Detailed error message. Returned only when the request fails. See error codes for details. |
Step 2: Query the result
Singapore
GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id}
Virginia
GET https://dashscope-us.aliyuncs.com/api/v1/tasks/{task_id}
Beijing
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
Polling suggestion: Video generation can take several minutes. Use a polling mechanism with a reasonable query interval, such as 15 seconds, to retrieve the result.
Task status transition: PENDING → RUNNING → SUCCEEDED or FAILED.
Result URL: After the task is successful, a video URL is returned. The URL is valid for 24 hours. After you retrieve the URL, you must immediately download and save the video to a permanent storage service, such as Object Storage Service (OSS).
task_id validity: 24 hours. After this period, you cannot query the result, and the API returns a task status of
UNKNOWN.
Request parameters | Query task resultReplace |
Request headers | |
Authorization The authentication credentials using a Model Studio API key. Example: | |
URL path parameters | |
task_id The ID of the task to query. |
Response parameters | Task succeededVideo URLs are retained for only 24 hours and then automatically purged. Save generated videos promptly. Task failedWhen a task fails, Task query expiredThe |
output Task output. | |
usage Output statistics for successful tasks only. | |
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. |
Limitations
Data validity: The
task_idand videovideo_urlare retained for 24 hours only. After expiration, they cannot be queried or downloaded.Content moderation: Input prompt and output video undergo content moderation. Requests with non-compliant content return an IPInfringementSuspect or DataInspectionFailed error. For details, see Error messages.
Error codes
If the model call fails and returns an error message, see Error messages for resolution.
FAQ
Q: How do I get the domain name whitelist for video storage?
A: Videos generated by models are stored in OSS. The API returns a temporary public URL. To configure a firewall whitelist for this download URL, note the following: The underlying storage may change dynamically. This topic does not provide a fixed OSS domain name whitelist to prevent access issues caused by outdated information. If you have security control requirements, contact your account manager to obtain the latest OSS domain name list.