Skip to main content

Wan-T2V API Reference (2.1-2.6)

The Wan-T2V model generates a smooth video based on a text prompt.

Related documentation: User Guide

Scope

To ensure successful calls, make sure that the model, Endpoint URL, and API Key all belong to the same region. Cross-region calls will fail.
The sample code in this document applies to the Singapore region.
Alibaba Cloud Model Studio has launched workspace-dedicated domains for the China (Beijing) 2 and Singapore regions, which deliver superior performance and higher stability for inference requests. We recommend that you migrate to the new domains:
  • China (Beijing) 2 region: migrate from https://dashscope.aliyuncs.com to https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com
  • Singapore region: migrate from https://dashscope-intl.aliyuncs.com to https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com
{WorkspaceId} indicates your workspace ID, which you can view on the Workspace Details page in the Alibaba Cloud Model Studio console. The existing domains can still be used.

HTTP call

This API uses the legacy protocol and supports the wan2.6 and earlier series models (wan2.5/wan2.2/wan2.1).
Since T2V tasks take a long time to complete (typically 1 to 5 minutes), the API uses asynchronous calls. The entire process consists of two core steps: "Create Task -> Poll for Results", as follows:

Step 1: Create a task to obtain the task ID

  • Singapore
  • Virginia
  • Frankfurt
  • Beijing
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesisWhen calling the API, replace {WorkspaceId} with the actual workspace ID.
  • After the task is created successfully, use the task_id returned by the API to query the result. The task_id is valid for 24 hours. Do not create the same task repeatedly; simply poll for the result.
  • For a beginner's guide, see Postman.

Request parameters

Request headers
Content-Typestring(required)Request content type. This parameter must be set to application/json.Authorizationstring(required)Request authentication. This API uses an Alibaba Cloud Model Studio API Key for authentication. Example value: Bearer sk-xxxx.X-DashScope-Asyncstring(Required)Asynchronous processing configuration parameter. HTTP requests support asynchronous calls only, and the value must be set to enable.
If this request header is missing, the error "current user api does not support synchronous calls" is returned.
Request Body
model string (Required)Model name. For available models, see Models.Example value: wan2.6-t2v.input object (Required)Basic input information, such as the prompt.

Property

prompt string (Required)Text prompt. Describes the elements and visual features that you want in the generated video.Supports Chinese and English. Each Chinese character or letter counts as one character, and any excess is automatically truncated. The length limit varies by model version:
  • wan2.6 and wan2.5 series models: no more than 1500 characters.
  • wan2.2 and wan2.1 series models: no more than 800 characters.
Example value: A kitten running in the moonlight.For tips on using prompts, see the T2V/I2V Prompt Guide.negative_prompt string (Optional)Negative prompt, used to describe content that you do not want to see in the video, which constrains the video visuals.Supports Chinese and English, with a length of no more than 500 characters; any excess is automatically truncated.Example value: low resolution, fault, worst quality, low quality, deformed, extra fingers, bad proportions, etc.audio_url string (Optional)Supported models: wan2.6 and wan2.5 series models.The URL of the audio file. The model uses this audio to generate the video.Supported input formats:
  1. Public URL:
Audio limits:
  • Format: wav, mp3.
  • Duration: 3 to 30 s.
  • File size: no more than 15 MB.
  • Overlimit handling: If the audio length exceeds the duration value (for example, 5 seconds), only the first 5 seconds are automatically retained and the rest is discarded. If the audio is shorter than the video duration, the portion beyond the audio length is silent. For example, if the audio is 3 seconds and the video duration is 5 seconds, the first 3 seconds of the output video have sound and the last 2 seconds are silent.
parameters object (Optional)Image processing parameters, such as setting the video resolution, enabling intelligent prompt rewriting, and adding a watermark.

Property

size string (Optional)
  • size directly affects the fee. Confirm the model price before calling.
  • size must be set to a specific value (such as 1280*720), not 1:1 or 480P.
Specifies the resolution of the generated video, in the format width*height. The default value and available enumeration values of this parameter depend on the model parameter, as follows:
  • wan2.6-t2v: Default value is 1920*1080 (1080P). Available resolutions: all resolutions corresponding to 720P and 1080P.
  • wan2.5-t2v-preview: Default value is 1920*1080 (1080P). Available resolutions: all resolutions corresponding to 480P, 720P, and 1080P.
  • wan2.2-t2v-plus: Default value is 1920*1080 (1080P). Available resolutions: all resolutions corresponding to 480P and 1080P.
  • wan2.1-t2v-turbo: Default value is 1280*720 (720P). Available resolutions: all resolutions corresponding to 480P and 720P.
  • wan2.1-t2v-plus: Default value is 1280*720 (720P). Available resolutions: all resolutions corresponding to 720P.
480P tier: The available video resolutions and their corresponding video aspect ratios are:
  • 832*480:16:9。
  • 480*832:9:16。
  • 624*624:1:1。
720P tier: The available video resolutions and their corresponding video aspect ratios are:
  • 1280*720:16:9。
  • 720*1280:9:16。
  • 960*960:1:1。
  • 1088*832:4:3。
  • 832*1088:3:4。
1080P tier: The available video resolutions and their corresponding video aspect ratios are:
  • 1920*1080: 16:9。
  • 1080*1920: 9:16。
  • 1440*1440: 1:1。
  • 1632*1248: 4:3。
  • 1248*1632: 3:4。
duration integer (Optional)
duration directly affects the fee. Fee = unit price (based on resolution) × duration (seconds). Confirm the model price before calling.
The duration of the generated video, in seconds. The values of this parameter depend on the model parameter:
  • wan2.6-t2v: The value is an integer in [2, 15]. The default value is 5.
  • wan2.5-t2v-preview: Available values are 5 and 10. The default value is 5.
  • wan2.2-t2v-plus: Fixed at 5 seconds, and cannot be modified.
  • wan2.1-t2v-plus: Fixed at 5 seconds, and cannot be modified.
  • wan2.1-t2v-turbo: Fixed at 5 seconds, and cannot be modified.
prompt_extendboolean (Optional)Specifies whether to enable intelligent prompt rewriting. When enabled, a large model is used to intelligently rewrite the input prompt. This significantly improves generation results for short prompts, but increases processing time.
  • true: Default value, enables intelligent rewriting.
  • false: Disables intelligent rewriting.
shot_type string (Optional)Supported models: wan2.6 models.Specifies the shot type of the generated video, that is, whether the video consists of a single continuous shot or multiple switching shots.Available values:
  • single: Default value, outputs a single-shot video.
  • multi: Outputs a multi-shot video.
Effective condition: Takes effect only when "prompt_extend": true.Parameter priority: shot_type > prompt. For example, if shot_type is set to "single", even if the prompt contains "generate a multi-shot video", the model still outputs a single-shot video.watermark boolean (Optional)Specifies whether to add a watermark. The watermark is located in the lower-right corner of the video, with fixed text "AI generated".
  • false: Default value, no watermark added.
  • true: Adds a watermark.
seedinteger (Optional)The random number seed, in the range [0, 2147483647].If not specified, the system automatically generates a random seed. To improve the reproducibility of generation results, it is recommended to fix the seed value.Note that, due to the probabilistic nature of model generation, even with the same seed, identical generation results cannot be guaranteed each time.
  • multi-shot narrative
  • Import an audio file
  • automatic dubbing
  • Generate a silent video
  • Use negative prompts
  • shot_type: Must be set to "multi" for multi-shot.
  • prompt_extend: Must be set to true for multi-shot (enables intelligent rewriting to optimize shot descriptions).

# The following URL is for the Singapore region. Replace {WorkspaceId} with your actual workspace ID. URLs differ by region.
curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \
    -H 'X-DashScope-Async: enable' \
    -H "Authorization: Bearer $DASHSCOPE_API_KEY" \
    -H 'Content-Type: application/json' \
    -d '{
    "model": "wan2.6-t2v",
    "input": {
        "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"
    },
    "parameters": {
        "size": "1280*720",
        "prompt_extend": true,
        "duration": 10,
        "shot_type":"multi"
    }
}'

Response parameters

output objectThe task output information.

Property

task_id stringTask ID. The query validity period is 24 hours.task_status stringTask status.

Enumerated values

  • PENDING: Task queuing
  • RUNNING: Task processing
  • SUCCEEDED: Task executed successfully
  • FAILED: Task execution failed
  • CANCELED: Task canceled
  • UNKNOWN: Task does not exist or status unknown
request_idstringThe unique request identifier. It can be used for tracing request details and troubleshooting.codestringThe error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.messagestringThe detailed error information returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.
  • Successful response
  • Error response
Please save the task_id, which is used to query the task status and results.
{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Step 2: Query results by task ID

  • Singapore
  • Virginia
  • Frankfurt
  • Beijing
GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}When calling the API, replace {WorkspaceId} with the actual workspace ID.
  • Polling recommendation: Video generation takes several minutes. We recommend using a polling mechanism and setting a reasonable query interval (such as 15 seconds) to obtain the results.
  • Task status transitions: PENDING (Queuing) → RUNNING (Processing) → SUCCEEDED (Success) / FAILED (Failed).
  • Result link: After the task succeeds, a video link is returned, valid for 24 hours. We recommend downloading the file immediately after obtaining the link and storing it in permanent storage (such as Alibaba Cloud OSS).
  • task_id validity: 24 hours. After it expires, results can no longer be queried, and the API will return the task status as UNKNOWN.

Request parameters

Headers
Authorizationstring(required)Request authentication. This API uses an Alibaba Cloud Model Studio API Key for authentication. Example value: Bearer sk-xxxx.
Path parameters
task_id string(Required)The task ID.
  • Query task result
Replace {task_id} with the value of task_id returned by the API in the previous step. The task_id is valid for query within 24 hours, and replace {WorkspaceId} with your actual Workspace ID.
curl -X GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response parameters

outputobjectThe task output information.

Property

task_id stringTask ID. The query validity period is 24 hours.task_status stringTask status.

Enumerated values

  • PENDING: Task queuing
  • RUNNING: Task processing
  • SUCCEEDED: Task executed successfully
  • FAILED: Task execution failed
  • CANCELED: Task canceled
  • UNKNOWN: Task does not exist or status unknown
Status transitions during polling:
  • PENDING (Queuing) → RUNNING (Processing) → SUCCEEDED (Success) / FAILED (Failed).
  • The status on the first query is usually PENDING (Queuing) or RUNNING (Processing).
  • When the status changes to SUCCEEDED, the response will contain the URL of the generated video.
  • If the status is FAILED, check the error message and retry.
  • If the status is CANCELED, the task has been canceled; resubmit the task if you want to continue.
  • If the status is UNKNOWN, the task does not exist or its status is unknown, which may occur when the task_id does not exist or has exceeded the 24-hour validity period.
submit_time stringTask submission time. The time zone is UTC+8, in the format YYYY-MM-DD HH:mm:ss.SSS.scheduled_time stringTask execution time. The time zone is UTC+8, in the format YYYY-MM-DD HH:mm:ss.SSS.end_time stringTask completion time. The time zone is UTC+8, in the format YYYY-MM-DD HH:mm:ss.SSS.video_urlstringThe video URL. Returned only when task_status is SUCCEEDED.The link is valid for 24 hours, and you can download the video through this URL. The video format is MP4 (H.264 encoding).orig_prompt stringThe original input prompt, corresponding to the request parameter prompt.actual_prompt stringWhen prompt_extend=true, the system intelligently rewrites the input prompt. This field returns the optimized prompt actually used for generation.
  • If prompt_extend=false, this field is not returned.
  • Note: For wan2.6 models, this field is not returned regardless of the value of prompt_extend.
codestringThe error code returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.messagestringThe detailed error information returned when the request fails. This parameter is not returned when the request succeeds. For details, see Error codes.
usage objectOutput information statistics. Only successful results are counted.

Property

video_duration integerReturned only when using wan2.5 or earlier models, used for billing.The duration of the generated video, in seconds. Enumerated values: 5 and 10.duration floatReturned only when using wan2.6 models, used for billing.Indicates the total video duration, where duration=input_video_duration+output_video_duration.input_video_duration integerReturned only when using wan2.6 models. Fixed at 0.output_video_duration integerReturned only when using wan2.6 models.The duration of the output video, in seconds. Its value is equal to the value of input.duration.SR integerReturned only when using wan2.6 models. The resolution tier of the generated video. Example value: 720.size stringReturned only when using wan2.6 models. The resolution of the generated video. The format is "widthheight". Example value: 19201080.video_ratio stringReturned only for wan2.5 or earlier models. The resolution of the generated video. The format is "widthheight". Example value: 832480.video_count integerThe number of generated videos. Fixed at 1.
request_idstringThe unique request identifier. It can be used for tracing request details and troubleshooting.
  • Task succeeded
  • Task failed
  • Task query expiration
The video URL is retained for only 24 hours and is automatically cleared after expiration. Save the generated video in a timely manner.
{
    "request_id": "abbf7aa3-9652-4785-a622-xxxxxx",
    "output": {
        "task_id": "38513c71-5190-48e1-9f3b-xxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2025-09-29 14:05:22.119",
        "scheduled_time": "2025-09-29 14:05:28.278",
        "end_time": "2025-09-29 14:10:00.437",
        "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 '。",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx"
    },
    "usage": {
        "duration": 10,
        "size": "1280*720",
        "input_video_duration": 0,
        "output_video_duration": 10,
        "video_count": 1,
        "SR": 720
    }
}

DashScope SDK Calls

The SDK parameter naming is basically the same as that of the HTTP API, and the parameter structure is encapsulated according to the characteristics of each language. Since T2V tasks are time-consuming (usually 1-5 minutes), the SDK encapsulates the HTTP asynchronous invocation process at the underlying layer, supporting both synchronous and asynchronous calling methods.
The actual execution time depends on the number of queued tasks and the service execution status. Please wait patiently when obtaining the results.

Python SDK Calls

Make sure the DashScope Python SDK version is no earlier than 2.0.1 before running the following code.If the version is too low, errors such as "url error, please check url!" may occur. See Install SDK to update it.
Set region based on the region where the model is located (pass it in when constructing the Client; the region value varies by region):
  • Singapore
  • Beijing
  • Virginia
  • Frankfurt
region="ap-southeast-1"When calling the API, replace {WorkspaceId} with the actual workspace ID.
  • Synchronous call
  • Asynchronous call
Sample request
import dashscope
import os
from dashscope import DashScopeError

# The following is the configuration for the Singapore (ap-southeast-1) region. Replace {WorkspaceId} with your actual workspace ID when calling. The region value varies by region.
client = dashscope.Client(
    # If no environment variable is configured, replace the following line with your Model Studio API key: api_key="sk-xxx".
    # API keys vary by region. For more information, see https://www.alibabacloud.com/help/model-studio/get-api-key.
    api_key=os.getenv("DASHSCOPE_API_KEY"),
    workspace="{WorkspaceId}",
    region="ap-southeast-1",
)

def sample_sync_call_t2v():
    # generate is a one-step call (submits the task and waits for completion) that returns a completed Job.
    print('please wait...')
    # audio_url and negative_prompt are input-section fields, not in the named signature; pass them through extra_input.
    try:
        job = client.videos.generate(model='wan2.6-t2v',
                                     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 '.",
                                     extra_input={'audio_url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250929/stjqnq/%E7%8B%90%E7%8B%B8.mp3',
                                                  'negative_prompt': ""},
                                     size='1280*720',
                                     duration=10,
                                     prompt_extend=True,
                                     watermark=False,
                                     seed=12345)
        print(job)
        print(job.video_url)
    except DashScopeError as e:
        print(f"HTTP status code: {e.status_code}")
        print(f"Error code: {e.code}")
        print(f"Error message: {e.message}")
        print("See the documentation: https://www.alibabacloud.com/help/model-studio/developer-reference/error-code")

if __name__ == '__main__':
    sample_sync_call_t2v()
Sample response
video_url is valid for 24 hours. Download the video in a timely manner.
{
    "request_id": "167f3beb-3dd0-47fe-a83c-xxxxxx",
    "task_id": "5b65411f-d946-4e29-859e-xxxxxx",
    "status": "SUCCEEDED",
    "video_url": "https://dashscope-result-bj.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
    "task_metrics": {
        "TOTAL": 1,
        "SUCCEEDED": 1,
        "FAILED": 0
    },
    "usage": {
        "video_count": 1,
        "duration": 10,
        "size": "1280*720",
        "input_video_duration": 0,
        "output_video_duration": 10,
        "SR": 720
    }
}

Java SDK Calls

Make sure the DashScope Java SDK version is no earlier than 2.22.14 before running the following code.If the version is too low, errors such as "url error, please check url!" may occur. See Install SDK to update it.
Set Constants.baseHttpApiUrl based on the region where the model is located:
  • Singapore
  • Virginia
  • Beijing
  • Frankfurt
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";When calling the API, replace {WorkspaceId} with the actual workspace ID.
  • Synchronous call
  • Asynchronous call
Sample request
// 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 {

    static {
          // Singapore region URL. Replace {WorkspaceId} with your actual workspace ID. URLs vary by region. For more information, see https://www.alibabacloud.com/help/model-studio/text-to-video-api-reference.
         Constants.baseHttpApiUrl="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
    }

    // If the environment variable is not configured, replace the following line with your Model Studio API key: api_key="sk-xxx"
    // API keys differ by region. Get an API key: https://www.alibabacloud.com/help/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.6-t2v")
                        .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("1280*720")
                        .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);
    }
}
Sample response
video_url is valid for 24 hours. Download the video in a timely manner.
{
    "request_id": "c1209113-8437-424f-a386-xxxxxx",
    "output": {
        "task_id": "966cebcd-dedc-4962-af88-xxxxxx",
        "task_status": "SUCCEEDED",
        "video_url": "https://dashscope-result-sh.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
        "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 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 '",
        "submit_time": "2026-01-22 23:13:40.553",
        "scheduled_time": "2026-01-22 23:13:49.415",
        "end_time": "2026-01-22 23:17:56.380"
    },
    "usage": {
        "video_count": 1,
        "duration": 10.0,
        "size": "1280*720",
        "input_video_duration": 0.0,
        "output_video_duration": 10.0,
        "SR": "720"
    },
    "status_code": 200,
    "code": "",
    "message": ""
}

Error codes

If the model call fails and returns an error message, see Error codes to resolve the issue.

FAQ

A: You cannot convert the link directly. The correct approach is: after the backend service obtains the URL, download the video file via code, then upload it to a permanent object storage service (such as Alibaba Cloud OSS) to generate a new, permanently accessible link.
import requests

def download_and_save_video(video_url, save_path):
    try:
        response = requests.get(video_url, stream=True, timeout=300) # Set a timeout
        response.raise_for_status() # Raise an exception if the HTTP status code is not 200
        with open(save_path, 'wb') as f:
            for chunk in response.iter_content(chunk_size=8192):
                f.write(chunk)
        print(f"视频已成功下载到: {save_path}")
        # Add the logic to upload to permanent storage here
    except requests.exceptions.RequestException as e:
        print(f"下载视频失败: {e}")

if __name__ == '__main__':
    video_url = "http://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxxx"
    save_path = "video.mp4"
    download_and_save_video(video_url, save_path)
A: This is not recommended, because the link expires after 24 hours. The best practice is to have the backend download and transfer the video first, then use a permanent link for video playback.