The Wan text-to-video model generates smooth videos based on text prompts. It supports the following features:
Basic features: You can select the video duration (5, 10, or 15 seconds), specify the video resolution (480P, 720P, or 1080P), enable intelligent prompt rewriting, and add watermarks.
Audio features: Automatic dubbing or using a custom audio file for audio-visual synchronization. (Supported by wan2.5 and wan2.6)
Multi-shot narrative: Supports generating videos with multiple shots while maintaining subject consistency across shot changes. (Supported only by wan2.6)
Quick links: Try it online (Singapore | Beijing) | Wan official website
The features on the Wan official website may differ from those supported by the API. This document describes the actual capabilities of the API and is updated as new features are released.
Model overview
Input prompt | Output video (wan2.6, multi-shot video) |
Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '. |
Prerequisites
Before making a call, obtain an API key and set the API key as an environment variable. To make calls using the SDK, install the DashScope SDK.
The Beijing and Singapore regions have separate API keys and request endpoints. Do not use them interchangeably. Cross-region calls cause authentication failures or service errors.
HTTP Call
Because text-to-video tasks take a long time to complete (typically 1 to 5 minutes), the API uses asynchronous invocation. The process involves two core steps: Create a task -> Poll for the result. The steps are as follows:
The time required depends on the number of queued tasks and the service execution status. Please be patient while you wait for the result.
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
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. The task_id is valid for 24 hours. Do not create duplicate tasks. Use polling to retrieve the result.
Request parameters | Multi-shot narrativeOnly the wan2.6-t2v model supports generating multi-shot videos. Enable this feature by setting Automatic dubbingThis feature is supported only by wan2.5 and later models. If you do not provide Use an audio fileThis feature is supported only by wan2.5 and later models. To specify background music or dubbing for the video, pass the URL of your custom audio file using the Generate a silent videowan2.2 and earlier models generate silent videos by default. No parameters need to be set. wan2.5 and later models generate videos with audio by default. Use a negative promptYou can use the `negative_prompt` parameter to exclude elements, such as "flowers", from appearing in the video. |
Headers | |
Content-Type The content type of the request. Set this parameter to | |
Authorization The identity authentication credentials for the request. This API uses an Model Studio API key for identity authentication. Example: Bearer sk-xxxx. | |
X-DashScope-Async The asynchronous processing configuration parameter. HTTP requests support only asynchronous processing. You must set this parameter to Important If this request header is missing, the error message "current user api does not support synchronous calls" is returned. | |
Request body | |
model The model name. For a list of available models and their pricing, see Model pricing. Example: wan2.5-t2v-preview. | |
input The basic input information, such as the prompt. | |
parameters The image editing parameters. For example, you can set the video resolution, enable intelligent prompt rewriting, or add a watermark. |
Response parameters | Successful responseSave the task_id to query the task status and result. Error responseThe task creation failed. For more information, see Error messages to resolve the issue. |
output The task output information. | |
request_id The unique request ID. You can use this ID to trace and troubleshoot issues. | |
code The error code for a failed request. This parameter is not returned if the request is successful. For more information, see Error messages. | |
message The detailed information about a failed request. This parameter is not returned if the request is successful. For more information, see Error messages. |
Step 2: Query the result by task ID
Singapore: GET https://dashscope-intl.aliyuncs.com/api/v1/tasks/{task_id}
China (Beijing): GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
Polling suggestion: Video generation takes several minutes. Use a polling mechanism and set a reasonable query interval, such as 15 seconds, to retrieve the result.
Task status transition: PENDING → RUNNING → SUCCEEDED or FAILED.
Result link: After the task is successful, a video link is returned. The link is valid for 24 hours. After you retrieve the link, immediately download and save the video to a permanent storage service, such as Object Storage Service.
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 The API keys for the Singapore and Beijing regions are different. Create an API key. The following `base_url` is for the Singapore region. For models in the Beijing region, replace the `base_url` with `https://dashscope.aliyuncs.com/api/v1/tasks/86ecf553-d340-4e21-xxxxxxxxx`. |
Headers | |
Authorization The identity authentication credentials for the request. This API uses an Model Studio API key for identity authentication. Example: Bearer sk-xxxx. | |
URL path parameters | |
task_id The task ID. |
Response parameters | Successful task executionVideo URLs are retained for only 24 hours and are automatically purged after this period. You must save the generated videos promptly. Failed task executionIf a task fails, task_status is set to FAILED, and an error code and message are provided. For more information, see Error messages to resolve the issue. Task query expiredThe task_id is valid for 24 hours. After this period, the query fails and the following error message is returned. |
output The task output information. | |
usage Statistics for the output information. Only successful results are counted. | |
request_id The unique request ID. You can use this ID to trace and troubleshoot issues. |
DashScope SDK calls
The parameter naming in the SDK is mostly consistent with the HTTP API. The parameter structure is encapsulated based on the features of each programming language.
Because text-to-video tasks take a long time to complete (typically 1 to 5 minutes), the SDK encapsulates the HTTP asynchronous invocation process at the underlying layer and supports both synchronous and asynchronous invocation methods.
The time required depends on the number of queued tasks and the service execution status. Please be patient while you wait for the result.
Python SDK calls
The
wan2.6-t2vmodel does not support SDK calls.Make sure that your DashScope Python SDK version is
1.25.2or later before you run the following code.If your SDK version is too low, you may encounter errors such as 'url error, please check url!'. For more information, see Install SDK to update your SDK.
Synchronous invocation
Request example
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# If you use a model in the China (Beijing) region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
# If you have not configured the environment variable, replace the following line with your Model Studio API key: api_key="sk-xxx"
# The API keys for the Singapore and China (Beijing) regions are different. Get an API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
def sample_sync_call_t2v():
# call sync api, will return the result
print('please wait...')
rsp = VideoSynthesis.call(api_key=api_key,
model='wan2.5-t2v-preview',
prompt="Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
audio_url='https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
size='832*480',
duration=10,
negative_prompt="",
prompt_extend=True,
watermark=False,
seed=12345)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_sync_call_t2v()Response example
The video_url is valid for 24 hours. You should download the video promptly.
{
"status_code": 200,
"request_id": "167f3beb-3dd0-47fe-a83c-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "5b65411f-d946-4e29-859e-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-bj.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2025-10-23 11:47:23.879",
"scheduled_time": "2025-10-23 11:47:34.351",
"end_time": "2025-10-23 11:52:35.323",
"orig_prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
"actual_prompt": "Low-angle shot, medium close-up, warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its crimson fur contrasting with the dimly lit room. Its tail rests lightly on the edge of the chair, and its fingers slowly turn yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. The fox slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera. Its mouth clearly moves as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them.\""
},
"usage": {
"video_count": 1,
"video_duration": 10,
"video_ratio": "832*480"
}
}Asynchronous invocation
Request example
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# If you use a model in the China (Beijing) region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
# If you have not configured the environment variable, replace the following line with your Model Studio API key: api_key="sk-xxx"
# The API keys for the Singapore and China (Beijing) regions are different. Get an API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
def sample_async_call_t2v():
# call async api, will return the task information
# you can get task status with the returned task id.
rsp = VideoSynthesis.async_call(api_key=api_key,
model='wan2.5-t2v-preview',
prompt="Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
audio_url='https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
size='832*480',
duration=10,
negative_prompt="",
prompt_extend=True,
watermark=False,
seed=12345)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print("task_id: %s" % rsp.output.task_id)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
# get the task information include the task status.
status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
if status.status_code == HTTPStatus.OK:
print(status.output.task_status) # check the task status
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(status.status_code, status.code, status.message))
# wait the task complete, will call fetch interval, and check it's in finished status.
rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_async_call_t2v()Response example
1. Response example for creating a task
{
"status_code": 200,
"request_id": "c86ff7ba-8377-917a-90ed-xxxxxx",
"code": "",
"message": "",
"output": {
"task_id": "721164c6-8619-4a35-a6d9-xxxxxx",
"task_status": "PENDING",
"video_url": ""
},
"usage": null
}2. Response example for querying a task result
The video_url is valid for 24 hours. You should download the video promptly.
{
"status_code": 200,
"request_id": "167f3beb-3dd0-47fe-a83c-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "5b65411f-d946-4e29-859e-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-bj.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2025-10-23 11:47:23.879",
"scheduled_time": "2025-10-23 11:47:34.351",
"end_time": "2025-10-23 11:52:35.323",
"orig_prompt": "Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.",
"actual_prompt": "Low-angle shot, medium close-up, warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, central composition. In a classic detective's office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its crimson fur contrasting with the dimly lit room. Its tail rests lightly on the edge of the chair, and its fingers slowly turn yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. The fox slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera. Its mouth clearly moves as it speaks in a smooth, cynical voice: \"The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them.\""
},
"usage": {
"video_count": 1,
"video_duration": 10,
"video_ratio": "832*480"
}
}Java SDK
The
wan2.6-t2vmodel does not support SDK calls.Make sure that your DashScope Java SDK version is
2.22.2or later before you run the following code.If the version is too low, you may encounter errors such as 'url error, please check url!'. For more information, see Install the SDK to update.
Synchronous invocation
Request example
// Copyright (c) Alibaba, Inc. and its affiliates.
// dashscope sdk >= 2.18.2
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
import java.util.HashMap;
import java.util.Map;
public class Text2Video {
/**
* Create a video compositing task and wait for the task to complete.
*/
static {
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
// If you use a model in the China (Beijing) region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
}
// If you have not configured the environment variable, replace the following line with your Model Studio API key: api_key="sk-xxx"
// The API keys for the Singapore and China (Beijing) regions are different. Get an API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
public static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
VideoSynthesis vs = new VideoSynthesis();
Map<String, Object> parameters = new HashMap<>();
parameters.put("prompt_extend", true);
parameters.put("watermark", false);
parameters.put("seed", 12345);
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.5-t2v-preview")
.prompt("Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.")
.audioUrl("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3")
.negativePrompt("")
.size("832*480")
.duration(10)
.parameters(parameters)
.build();
System.out.println("please wait...");
VideoSynthesisResult result = vs.call(param);
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
try {
text2Video();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}Response example
The video_url is valid for 24 hours. You should download the video promptly.
{
"request_id": "4e9aab26-c50b-4ea7-b2c0-xxxxxx",
"output": {
"task_id": "9e0fc846-ee92-42ac-af42-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
},
"usage": {
"video_count": 1,
"video_duration": 10,
"video_ratio": "832*480"
}
}Asynchronous invocation
Request example
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisListResult;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.task.AsyncTaskListParam;
import com.alibaba.dashscope.utils.JsonUtils;
import com.alibaba.dashscope.utils.Constants;
import java.util.HashMap;
import java.util.Map;
public class Text2Video {
/**
* Create a video compositing task and wait for the task to complete.
*/
static {
// If you use a model in the China (Beijing) region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
Constants.baseHttpApiUrl="https://dashscope-intl.aliyuncs.com/api/v1";
}
// If you have not configured the environment variable, replace the following line with your Model Studio API key: api_key="sk-xxx"
// The API keys for the Singapore and China (Beijing) regions are different. Get an API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
public static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void text2Video() throws ApiException, NoApiKeyException, InputRequiredException {
VideoSynthesis vs = new VideoSynthesis();
Map<String, Object> parameters = new HashMap<>();
parameters.put("prompt_extend", true);
parameters.put("watermark", false);
parameters.put("seed", 12345);
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.5-t2v-preview")
.prompt("Shot from a low angle, in a medium close-up, with warm tones, mixed lighting (the practical light from the desk lamp blends with the overcast light from the window), side lighting, and a central composition. In a classic detective office, wooden bookshelves are filled with old case files and ashtrays. A green desk lamp illuminates a case file spread out in the center of the desk. A fox, wearing a dark brown trench coat and a light gray fedora, sits in a leather chair, its fur crimson, its tail resting lightly on the edge, its fingers slowly turning yellowed pages. Outside, a steady drizzle falls beneath a blue sky, streaking the glass with meandering streaks. It slowly raises its head, its ears twitching slightly, its amber eyes gazing directly at the camera, its mouth clearly moving as it speaks in a smooth, cynical voice: 'The case was cold, colder than a fish in winter. But every chicken has its secrets, and I, for one, intended to find them '.")
.audioUrl("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3")
.negativePrompt("")
.size("832*480")
.duration(10)
.parameters(parameters)
.build();
// Asynchronous call
VideoSynthesisResult task = vs.asyncCall(param);
System.out.println(JsonUtils.toJson(task));
System.out.println("please wait...");
// Get the result
VideoSynthesisResult result = vs.wait(task, apiKey);
System.out.println(JsonUtils.toJson(result));
}
// Get the task list
public static void listTask() throws ApiException, NoApiKeyException {
VideoSynthesis is = new VideoSynthesis();
AsyncTaskListParam param = AsyncTaskListParam.builder().build();
param.setApiKey(apiKey);
VideoSynthesisListResult result = is.list(param);
System.out.println(result);
}
// Get the result of a single task
public static void fetchTask(String taskId) throws ApiException, NoApiKeyException {
VideoSynthesis is = new VideoSynthesis();
// If DASHSCOPE_API_KEY is set as an environment variable, apiKey can be null
VideoSynthesisResult result = is.fetch(taskId, apiKey);
System.out.println(result.getOutput());
System.out.println(result.getUsage());
}
public static void main(String[] args) {
try {
text2Video();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}Response example
1. Response example for creating a task.
{
"request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx",
"output": {
"task_id": "7277e20e-aa01-4709-xxxxxxxx",
"task_status": "PENDING"
}
}2. Response example for querying a task result
The video_url is valid for 24 hours. You should download the video promptly.
{
"request_id": "4e9aab26-c50b-4ea7-b2c0-xxxxxx",
"output": {
"task_id": "9e0fc846-ee92-42ac-af42-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
},
"usage": {
"video_count": 1,
"video_duration": 10,
"video_ratio": "832*480"
}
}Limitations
Data validity: The task_id and video URL are retained for only 24 hours. After this period, they can no longer be queried or downloaded.
Audio support: wan2.5 and later versions generate videos with audio by default (supporting automatic dubbing or custom audio upload). wan2.2 and earlier versions generate only silent videos. If needed, you can use speech synthesis to generate audio.
Content Moderation: The input prompt and output video are subject to Content Moderation. Requests that contain non-compliant content will result in the "IPInfringementSuspect" or "DataInspectionFailed" error. For more information, see Error messages.
Network access configuration: The video link is stored in Object Storage Service (OSS). If your business system cannot access external OSS links because of security policies, you must add the following OSS domain names to the network access whitelist.
# OSS domain name list 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
Key parameter descriptions
Set audio parameters
Supported models: wan2.6-t2v, wan2.5-t2v-preview.
Audio settings: wan2.5 and later versions generate videos with audio by default. The audio behavior depends on whether you provide input.audio_url. Two modes are supported:
Automatic dubbing: When you do not provide
audio_url, the model automatically generates matching background audio or music based on the prompt and video content.Use custom audio: When you provide
audio_url, the model uses your audio file to generate the video. The video content aligns with the audio (such as lip movements and rhythm).
Billing and rate limiting
For the free quota and unit price, see Models.
For rate limits, see Wan series.
Billing description:
You are billed based on the duration in seconds of successfully generated videos. You are charged only when the query result API returns a
task_statusofSUCCEEDEDand a video is successfully generated.No fees are incurred for failed model calls or processing errors, and your free quota is not consumed.
Error codes
If a call fails, see Error messages for troubleshooting.
FAQ
Q: How do I view the number of model calls?
A: One hour after the model call is complete, you can go to the Model Observation (Singapore) or Model Observation (Beijing) page to view metrics such as the number of calls and the success rate for the model. For more information, see How do I view model call records?
Q: How do I convert a temporary video link to a permanent one?
A: You cannot directly convert the link. The correct method is to have the backend service download the video file using the URL and then upload it to a permanent object storage service, such as OSS, to generate 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 recommended best practice is to have the backend download and save the video, and then use a permanent link for playback.