Wan reference-to-video model generates videos with consistent characters from a prompt and a character's appearance from an input video or image. If a video is used as the reference, its voice can also be transferred.
Basic features: Supports video duration from 2 to 10 seconds in integer increments, video resolution (720P or 1080P), and watermarking.
Audio features: Generates sound from prompts and reference the voice of the input video.
Multi-shot narrative: Generates videos with multiple shots while maintaining subject consistency.
Quick entry: Try Wan online
The features available on the Wan official website may differ from those supported by the API. This document describes the API's current capabilities and will be updated as they change.
Prerequisites
You must obtain an API key and set the API key as an environment variable.
The Beijing and Singapore regions have separate API keys and request endpoints. Do not use them interchangeably. Cross-region calls result in authentication failures or service errors.
HTTP
Because video generation tasks take a long time (usually 1 to 5 minutes), the API uses asynchronous invocation. The process involves two main steps: "Create a task -> Poll for the result". The steps are as follows:
The actual time required depends on the number of tasks in the queue and the service's execution status.
Step 1: Create a task to get a task ID
Singapore: POST https://dashscope-intl.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
US (Virginia): POST https://dashscope-us.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
China (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 Postman.
Request parameters | Single-character referenceTo generate a multi-shot video, reference the character's appearance from a video or image (and voice from a video), and set `shot_type` to `multi`. Multi-character referenceTo generate a multi-shot video, use reference videos or images for characters and props, define their relationship in a prompt, and set `shot_type` to `multi`. You can reference the same character multiple times in the prompt. |
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 a list of models and their prices, see Model pricing. Example: wan2.6-r2v. | |
input The basic input information, such as the prompt. | |
parameters Video editing parameters. Use these to set the video resolution, enable prompt rewriting, add a watermark, and more. |
Response parameters | Successful responseSave the Error responseTask creation failed. See error codes to resolve the issue. |
output The task output information. | |
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 by task ID
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. We recommend that you 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 API keys are region-specific. See API key documentation for details. For models in the Beijing region, replace base_url with |
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 successfulVideo URLs are retained for only 24 hours and then automatically purged. Save generated videos promptly. Task failedWhen a task fails, Task query expiredThe |
output The task output information. | |
usage Statistics on the output information. Only successful results are counted. | |
request_id Unique identifier for the request. Use for tracing and troubleshooting issues. |
Limitations
Data validity: The task_id and video URL are retained for only 24 hours. After this period, they cannot be queried or downloaded.
Content moderation: Both the input prompt and the output video are subject to content moderation. Requests with non-compliant content will result in an "IPInfringementSuspect" or "DataInspectionFailed" error, see Error messages.
Network access configuration: The video links are stored in Object Storage Service (OSS). If your business system cannot access external OSS links because of security policies, add the following OSS domain names to your network access whitelist.
# List of OSS domain names dashscope-result-bj.oss-cn-beijing.aliyuncs.com dashscope-result-hz.oss-cn-hangzhou.aliyuncs.com dashscope-result-sh.oss-cn-shanghai.aliyuncs.com dashscope-result-wlcb.oss-cn-wulanchabu.aliyuncs.com dashscope-result-zjk.oss-cn-zhangjiakou.aliyuncs.com dashscope-result-sz.oss-cn-shenzhen.aliyuncs.com dashscope-result-hy.oss-cn-heyuan.aliyuncs.com dashscope-result-cd.oss-cn-chengdu.aliyuncs.com dashscope-result-gz.oss-cn-guangzhou.aliyuncs.com dashscope-result-wlcb-acdr-1.oss-cn-wulanchabu-acdr-1.aliyuncs.com
Billing and rate limits
For free quota and unit prices, see Model list and pricing.
For rate limits, see Wan series.
Billing description:
Input images are not billed. Input videos are billed.
Billing is based on the combined duration of the input and output videos, measured in seconds. You are charged only when a query returns a
task_statusofSUCCEEDEDand a video is successfully generated.Failed model calls or processing errors do not incur any fees and do not consume the free quota for new users.
Error codes
If a call fails, see Error messages for troubleshooting.
FAQ
Q: How can I convert a temporary video link to a permanent one?
A: You cannot convert the link directly. The correct procedure is for your backend service to retrieve the URL, download the video file programmatically, and then upload it to a permanent object storage service, such as Alibaba Cloud OSS. This generates a new, permanent access link.
Q: Can the returned video link be played directly in a browser?
A: This is not recommended because the link expires after 24 hours. The best practice is to have your backend download and store the video, and then use the permanent link for playback.