The Wan image-to-video model generates a smooth video from a first-frame image and a text prompt.
References: User guide
The newly released Wan2.7 - image-to-video supports first-frame-to-video, first-and-last-frame-to-video, and video continuation. We recommend using it as your preferred choice.
The Wan image-to-video model in this topic (wan2.6 and earlier) only supports first-frame-to-video.
Availability
Model, endpoint URL, and API key must be in the same region -- cross-region calls fail.
Select a model: Confirm the model is available in your target region.
Select a URL: Choose the corresponding regional endpoint URL. Both HTTP and HTTPS are supported.
Configure an API key: Select a region, get an API key, and configure it in environment variables.
Install the SDK: If you plan to call the API using an SDK, install the DashScope SDK.
Sample codes in this topic apply to the Singapore region.
HTTP
Image-to-video tasks take 1-5 minutes. Use asynchronous invocation: create task, then poll for results.
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
Frankfurt
POST https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Replace WorkspaceId with your actual Workspace ID when making API calls.
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 guidance for beginners, see Postman.
Request parameters | Multi-shot narrativeThis feature is supported only by wan2.6 models. Enable it by setting Automatic dubbingThis feature is supported only by wan2.6 and wan2.5 models. If you do not provide Provide an audio fileThis feature is supported only by wan2.6 and wan2.5 models. To specify background music or voiceover for your video, pass the URL of your custom audio file in the Generate a silent videoOnly the following models support generating silent videos:
Use a negative promptUse the negative_prompt parameter to prevent “flowers” from appearing in the generated video. |
Headers | |
Content-Type The content type of the request. Must be | |
Authorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
X-DashScope-Async Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be Important If this request header is missing, the error "current user api does not support synchronous calls" is returned. | |
Request body | |
model The model name. Check the model pricing. Example: wan2.6-i2v-flash. | |
input Contains basic input information (e.g., prompt). | |
parameters Video processing parameters (resolution, duration, prompt rewriting, watermarking). |
Response parameters | Successful responseSave the Error responseTask creation failed. See Error messages. |
output Task output information. | |
request_id Unique request identifier for tracing and troubleshooting. | |
code Error code. Returned only for failed requests. See Error messages. | |
message Detailed error message. Returned only for failed requests. See Error messages. |
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}
Frankfurt
GET https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1/tasks/{task_id}
Replace WorkspaceId with your actual Workspace ID when making API calls.
Polling recommendation: Video generation takes several minutes. Use a polling mechanism with a reasonable interval, such as 15 seconds.
Task state transition: PENDING → RUNNING → SUCCEEDED or FAILED.
Result link: After a task succeeds, a video URL valid for 24 hours is returned. Download and save the video to permanent storage, such as OSS.
task_idvalidity: 24 hours. After this period, queries return the task status asUNKNOWN.
Request parameters | Query task resultReplace |
Headers | |
Authorization Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
URL path parameters | |
task_id The ID of the task. |
Response parameters | Task succeededVideo URLs are valid for only 24 hours and then automatically purged. Save generated videos promptly. Task failedWhen a task fails, Task query expiredThe |
output Task output information. | |
usage Output statistics. Counted only for successful results. | |
request_id Unique request identifier for tracing and troubleshooting. |
DashScope SDK
SDK parameter names mostly match HTTP API (structures follow language conventions).
Image-to-video tasks take 1-5 minutes. The SDK wraps the async HTTP call flow and supports both sync and async invocation.
Actual processing time depends on queue length and service execution. Wait patiently for results.
Python SDK
Requires DashScope Python SDK ≥ 1.25.8. Older versions may error (“url error, please check url!”) -- see Install the SDK to update.
Set base_http_api_url based on the model’s region:
Singapore
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
Virginia
dashscope.base_http_api_url = 'https://dashscope-us.aliyuncs.com/api/v1'
Beijing
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
Frankfurt
dashscope.base_http_api_url = 'https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1'
Replace WorkspaceId with your actual Workspace ID when making API calls.
Sample code
Synchronous call
Synchronous calls block until completion. Three image input methods: public URL, Base64, local file path.
Request example
import base64
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import mimetypes
import dashscope
# Singapore region URL. Get URL: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
# If you haven't configured the environment variable, replace the next line with your Model Studio API key: api_key="sk-xxx"
# Get your API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
# --- Helper function: For Base64 encoding ---
# Format: data:{MIME_type};base64,{base64_data}
def encode_file(file_path):
mime_type, _ = mimetypes.guess_type(file_path)
if not mime_type or not mime_type.startswith("image/"):
raise ValueError("Unsupported or unrecognized image format")
with open(file_path, "rb") as image_file:
encoded_string = base64.b64encode(image_file.read()).decode('utf-8')
return f"data:{mime_type};base64,{encoded_string}"
"""
Image input methods:
Choose one of the following three methods,
1. Use a public URL - Suitable for publicly accessible images
2. Use a local file - Suitable for local development and testing
3. Use Base64 encoding - Suitable for private images or scenarios requiring encrypted transmission
"""
# [Method 1] Use a publicly accessible image URL
# Example: Use a public image URL
img_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
# [Method 2] Use a local file (supports absolute and relative paths)
# Format requirement: file:// + file path
# Example (absolute path):
# img_url = "file://" + "/path/to/your/img.png" # Linux/macOS
# img_url = "file://" + "/C:/path/to/your/img.png" # Windows
# Example (relative path):
# img_url = "file://" + "./img.png" # Relative to the current executable file's path
# [Method 3] Use a Base64-encoded image
# img_url = encode_file("./img.png")
# Set audio URL
audio_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
def sample_call_i2v():
# Synchronous call, returns result directly
print('please wait...')
rsp = VideoSynthesis.call(api_key=api_key,
model='wan2.6-i2v-flash',
prompt='A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.',
img_url=img_url,
audio_url=audio_url,
resolution="720P",
duration=10,
prompt_extend=True,
watermark=False,
negative_prompt="",
seed=12345)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print("video_url:", 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_call_i2v()Response example
The video_url is valid for 24 hours. Download promptly.
{
"status_code": 200,
"request_id": "2794c7a3-fe8c-4dd4-a1b7-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "c15d5b14-07c4-4af5-b862-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2026-01-22 23:24:46.527",
"scheduled_time": "2026-01-22 23:24:46.565",
"end_time": "2026-01-22 23:25:59.978",
"orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise."
},
"usage": {
"video_count": 1,
"video_duration": 0,
"video_ratio": "",
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"audio": true,
"SR": 720
}
}Asynchronous call
Async calls return task ID immediately. Poll for results or wait for completion.
Request example
import os
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
# Singapore region URL. Get URL: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
dashscope.base_http_api_url = 'https://dashscope-intl.aliyuncs.com/api/v1'
# If you haven't configured the environment variable, replace the next line with your Model Studio API key: api_key="sk-xxx"
# Get your API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
# Use a publicly accessible image URL
img_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"
# Set audio URL
audio_url = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"
def sample_async_call_i2v():
# Asynchronous call, returns a task_id
rsp = VideoSynthesis.async_call(api_key=api_key,
model='wan2.6-i2v-flash',
prompt='A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.',
img_url=img_url,
audio_url=audio_url,
resolution="720P",
duration=10,
prompt_extend=True,
watermark=False,
negative_prompt="",
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 asynchronous task information
status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
if status.status_code == HTTPStatus.OK:
print(status.output.task_status)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(status.status_code, status.code, status.message))
# Wait for asynchronous task to finish
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_i2v()Response example
1. Response example for task creation
{
"status_code": 200,
"request_id": "6dc3bf6c-be18-9268-9c27-xxxxxx",
"code": "",
"message": "",
"output": {
"task_id": "686391d9-7ecf-4290-a8e9-xxxxxx",
"task_status": "PENDING",
"video_url": ""
},
"usage": null
}2. Response example for querying task result
The video_url is valid for 24 hours. Download promptly.
{
"status_code": 200,
"request_id": "2794c7a3-fe8c-4dd4-a1b7-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "c15d5b14-07c4-4af5-b862-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2026-01-22 23:24:46.527",
"scheduled_time": "2026-01-22 23:24:46.565",
"end_time": "2026-01-22 23:25:59.978",
"orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise."
},
"usage": {
"video_count": 1,
"video_duration": 0,
"video_ratio": "",
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"audio": true,
"SR": 720
}
}Java SDK
Requires DashScope Java SDK ≥ 2.22.6. Older versions may error (“url error, please check url!”) -- see Install the SDK to update.
Set baseHttpApiUrl based on the model’s region:
Singapore
Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
Virginia
Constants.baseHttpApiUrl = "https://dashscope-us.aliyuncs.com/api/v1";
Beijing
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1";
Frankfurt
Constants.baseHttpApiUrl = "https://{WorkspaceId}.eu-central-1.maas.aliyuncs.com/api/v1";
Replace WorkspaceId with your actual Workspace ID when making API calls.
Sample code
Synchronous call
Synchronous calls block until completion. Three image input methods: public URL, Base64, local file path.
Request example
// Copyright (c) Alibaba, Inc. and its affiliates.
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.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Base64;
import java.util.HashMap;
import java.util.Map;
public class Image2Video {
static {
// Singapore region URL. Get URL: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
}
// If you haven't configured the environment variable, replace the next line with your Model Studio API key: apiKey="sk-xxx"
// Get your API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
/**
* Image input methods: Choose one of the following three
*
* 1. Use a public URL - Suitable for publicly accessible images
* 2. Use a local file - Suitable for local development and testing
* 3. Use Base64 encoding - Suitable for private images or scenarios requiring encrypted transmission
*/
// [Method 1] Public URL
static String imgUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png";
// [Method 2] Local file path (file://+absolute path)
// static String imgUrl = "file://" + "/your/path/to/img.png"; // Linux/macOS
// static String imgUrl = "file://" + "/C:/your/path/to/img.png"; // Windows
// [Method 3] Base64 encoding
// static String imgUrl = Image2Video.encodeFile("/your/path/to/img.png");
// Set audio URL
static String audioUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3";
public static void image2video() throws ApiException, NoApiKeyException, InputRequiredException {
// Set parameters
Map<String, Object> parameters = new HashMap<>();
parameters.put("prompt_extend", true);
parameters.put("watermark", false);
parameters.put("seed", 12345);
VideoSynthesis vs = new VideoSynthesis();
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.6-i2v-flash")
.prompt("A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.")
.imgUrl(imgUrl)
.audioUrl(audioUrl)
.duration(10)
.parameters(parameters)
.resolution("720P")
.negativePrompt("")
.build();
System.out.println("please wait...");
VideoSynthesisResult result = vs.call(param);
System.out.println(JsonUtils.toJson(result));
}
/**
* Encode a file into a Base64 string
* @param filePath File path
* @return Base64 string in the format: data:{MIME_type};base64,{base64_data}
*/
public static String encodeFile(String filePath) {
Path path = Paths.get(filePath);
if (!Files.exists(path)) {
throw new IllegalArgumentException("File does not exist: " + filePath);
}
// Detect MIME type
String mimeType = null;
try {
mimeType = Files.probeContentType(path);
} catch (IOException e) {
throw new IllegalArgumentException("Cannot detect file type: " + filePath);
}
if (mimeType == null || !mimeType.startsWith("image/")) {
throw new IllegalArgumentException("Unsupported or unrecognized image format");
}
// Read file content and encode
byte[] fileBytes = null;
try{
fileBytes = Files.readAllBytes(path);
} catch (IOException e) {
throw new IllegalArgumentException("Cannot read file content: " + filePath);
}
String encodedString = Base64.getEncoder().encodeToString(fileBytes);
return "data:" + mimeType + ";base64," + encodedString;
}
public static void main(String[] args) {
try {
image2video();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}Response example
The video_url is valid for 24 hours. Download promptly.
{
"request_id": "87c091bb-7a3c-4904-8501-xxxxxx",
"output": {
"task_id": "413ed6e4-5f3a-4f57-8d58-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
"orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
"submit_time": "2026-01-22 23:25:45.729",
"scheduled_time": "2026-01-22 23:25:45.771",
"end_time": "2026-01-22 23:26:44.942"
},
"usage": {
"video_count": 1,
"duration": 10.0,
"input_video_duration": 0.0,
"output_video_duration": 10.0,
"SR": "720"
},
"status_code": 200,
"code": "",
"message": ""
}Asynchronous call
Async calls return task ID immediately. Poll for results or wait for completion.
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 Image2Video {
static {
// Singapore region URL. Get URL: https://www.alibabacloud.com/help/en/model-studio/image-to-video-api-reference
Constants.baseHttpApiUrl = "https://dashscope-intl.aliyuncs.com/api/v1";
}
// If you haven't configured the environment variable, replace the next line with your Model Studio API key: api_key="sk-xxx"
// Get your API key: https://www.alibabacloud.com/help/zh/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
// Set input image URL
static String imgUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png";
// Set audio URL
static String audioUrl = "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3";
public static void image2video() throws ApiException, NoApiKeyException, InputRequiredException {
// Set parameters
Map<String, Object> parameters = new HashMap<>();
parameters.put("prompt_extend", true);
parameters.put("watermark", false);
parameters.put("seed", 12345);
VideoSynthesis vs = new VideoSynthesis();
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.6-i2v-flash")
.prompt("A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.")
.imgUrl(imgUrl)
.audioUrl(audioUrl)
.duration(10)
.parameters(parameters)
.resolution("720P")
.negativePrompt("")
.build();
// Asynchronous call
VideoSynthesisResult task = vs.asyncCall(param);
System.out.println(JsonUtils.toJson(task));
System.out.println("please wait...");
// Get result
VideoSynthesisResult result = vs.wait(task, apiKey);
System.out.println(JsonUtils.toJson(result));
}
// Get 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 single task result
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 {
image2video();
} catch (ApiException | NoApiKeyException | InputRequiredException e) {
System.out.println(e.getMessage());
}
System.exit(0);
}
}Response example
1. Response example for task creation
{
"request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx",
"output": {
"task_id": "7277e20e-aa01-4709-xxxxxxxx",
"task_status": "PENDING"
}
}2. Response example for querying task result
The video_url is valid for 24 hours. Download promptly.
{
"request_id": "87c091bb-7a3c-4904-8501-xxxxxx",
"output": {
"task_id": "413ed6e4-5f3a-4f57-8d58-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com/xxx.mp4?Expires=xxx",
"orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life from a concrete wall. He raps an English song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The lighting comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.",
"submit_time": "2026-01-22 23:25:45.729",
"scheduled_time": "2026-01-22 23:25:45.771",
"end_time": "2026-01-22 23:26:44.942"
},
"usage": {
"video_count": 1,
"duration": 10.0,
"input_video_duration": 0.0,
"output_video_duration": 10.0,
"SR": "720"
},
"status_code": 200,
"code": "",
"message": ""
}Limitations
Data validity: task_id and video URL retained for 24 hours only. After expiry, cannot be queried or downloaded.
Content moderation: Inputs (prompts, images) and outputs undergo security review. Violations return errors (e.g., “IPInfringementSuspect”, “DataInspectionFailed”). See .
Error codes
For failed calls and errors, see Error messages for troubleshooting.
FAQ
Q: How do I generate a video with a specific aspect ratio (e.g., 3:4)?
A: Output aspect ratio matches input image (img_url), but exact ratios (e.g., strict 3:4) aren’t guaranteed -- minor deviations may occur.
Why deviation occurs:
Model uses input image ratio as baseline, calculates nearest valid resolution based on target pixels (set by resolution). Width/height must be multiples of 16, requiring minor adjustments. Output ratio approximates target (e.g., 3:4) but not exact.
Example: Input image 750×1000 (aspect ratio 3:4 = 0.75), with resolution = "720P" (target ~920,000 pixels) produces output 816×1104 (aspect ratio ≈ 0.739, ~900,000 pixels).
Best practices:
Input control: Use an image with the target aspect ratio as the first frame.
Post-processing: For strict ratios, crop or pad the generated video with editing tools.
Q: How to 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.