Vidu reference video API reference

Updated at:

The Vidu reference-to-video model uses a reference image and a text prompt . The model incorporates the subject from the image into the scene described by the prompt to generate smooth video.

ImportantThis document applies only to the China (Beijing) region. Use an API key from this region.

Activate the service

Go to the Alibaba Cloud Model Studio console, search for Vidu, find the Vidu model card, and click Activate Now. In the dialog box that opens, confirm the activation and authorization.

Usage notes

To ensure successful API calls, ensure the model, endpoint URL, and API key are all in the same region. Cross-region calls will fail.

HTTP calls

Because reference-to-video tasks are long-running (typically 1 to 5 minutes), the API uses asynchronous calls. The process consists of two core steps: "Create a task -> Poll for the result".

Step 1: Create a task

China (Beijing) region: POST https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis

Note

  • 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 task repeatedly; just poll for the result.
  • For beginner guidance, see Postman.

Request parameters

Request headers

Content-Type string (Required)

The content type of the request. Must be application/json.

Authorization string (Required)

Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.

X-DashScope-Async string (Required)

Asynchronous processing configuration parameter. HTTP requests support asynchronous mode only, and it must be set to enable.

ImportantIf this request header is missing, the error "current user api does not support synchronous calls" is returned.

Request body

model string (required)

The model to use. Valid values:

  • vidu/viduq3-ad_reference2video
  • vidu/viduq3-drama_reference2video
  • vidu/viduq3-mix_reference2video
  • vidu/viduq3_reference2video
  • vidu/viduq3-turbo_reference2video
  • vidu/viduq2-pro_reference2video
  • vidu/viduq2_reference2video

Model selection guide

  • Advertising videos: Use viduq3-ad. Designed for the advertising industry, it features marketing-grade smart shot transitions, camera movements, and direct audio output. Upload product images to generate advertising videos.
  • Premium dramas / AI comics: Use viduq3-drama. Strong character consistency, refined effects, and realistic emotional expression, ideal for narrative content production.
  • General use: Use viduq3-mix. Balanced visual quality and dynamic effects, suitable for most reference-to-video scenarios.
  • Speed and cost efficiency: Use viduq3-turbo. The fastest generation speed.

input object (required)

The basic input, which includes reference images and a prompt.

Properties

prompt string (required)

The text prompt. Describes the elements and visual characteristics that you want in the generated video.

Both Chinese and English are supported. The maximum length is 5,000 characters. Text that exceeds this limit is automatically truncated.

Example: A man sits in a chair by a window, holding a guitar and playing a soothing American country folk song in a cafe.

For more information about how to write prompts, see Vidu Video Generation Prompt Guide.

media array (required)

A list of media assets that specifies the reference materials for video generation.

Each element of the array is a media object that contains type and url fields.

Element properties

type string (required)

The media asset type. The valid values depend on the selected model.

Provide reference images only

Supported models: vidu/viduq3-ad_reference2video, vidu/viduq3-drama_reference2video, vidu/viduq3-mix_reference2video, vidu/viduq3_reference2video, vidu/viduq3-turbo_reference2video, vidu/viduq2_reference2video

The value is fixed to:

  • image: Reference image.

Asset limit: 1 to 7 images.

Provide reference images and videos

Supported model: vidu/viduq2-pro_reference2video

Valid values:

  • image: The reference image. Required.
  • video: The reference video. Optional.

Asset limits:

  • Reference images only: 1 to 7 images.

  • Reference images and videos:

    • 1 to 4 images.
    • 1 to 2 videos.

url string (required)

The URL of the media asset. Assets include images and videos.

Provide an image (type=image)

The URL of the reference image. The URL must be publicly accessible.

Image limits:

  • Formats: JPEG, JPG, PNG, and WEBP.
  • Aspect ratio: 1:4 to 4:1.
  • File size: Up to 50 MB.

Provide a video (type=video)

The URL of the reference video. The URL must be publicly accessible.

Video limits:

  • Formats: MP4, AVI, and MOV.
  • Resolution: The total number of pixels must be at least 128 × 128.
  • Aspect ratio: 1:4 to 4:1.
  • Duration: 1 to 8 seconds for one reference video; 1 to 5 seconds for each of two reference videos.
  • File size: Up to 50 MB.

parameters object (required)

Parameters for video generation, such as video resolution and duration.

Properties

resolution string (optional)

ImportantThe resolution directly affects billing. Before you call the API, confirm the model pricing.

The resolution of the generated video. The valid values depend on the selected model:

  • vidu/viduq3-ad_reference2video: 720P or 1080P. Default: 720P.
  • vidu/viduq3-drama_reference2video: 720P or 1080P. Default: 1080P.
  • vidu/viduq3-mix_reference2video: 540P, 720P, or 1080P. Default: 720P.
  • vidu/viduq3_reference2video: 540P, 720P, or 1080P. Default: 720P.
  • vidu/viduq3-turbo_reference2video: 540P, 720P, or 1080P. Default: 720P.
  • vidu/viduq2-pro_reference2video: 540P, 720P, or 1080P. Default: 720P.
  • vidu/viduq2_reference2video: 540P, 720P, or 1080P. Default: 720P.

size string (optional)

The resolution of the generated video, in pixels, formatted as width*height.

The default value depends on resolution:

  • When resolution=540P, size defaults to 1024*576.
  • When resolution=720P, size defaults to 1280*720.
  • When resolution is 1080P, size defaults to 1920*1080.

Supported aspect ratios vary by model:

  • vidu/viduq3-drama_reference2video: Only 16:9 and 9:16 are supported.
  • Other models: 16:9, 4:3, 1:1, 3:4, and 9:16 are supported.

Resolution tier

Aspect ratio

Valid size values (width*height)

540P

16:9

1024*576

4:3

1024*768

1:1

1024*1024

3:4

768*1024

9:16

576*1024

720P

16:9

1280*720

4:3

1280*960

1:1

1280*1280

3:4

960*1280

9:16

720*1280

1080P

16:9

1920*1080

4:3

1920*1440

1:1

1808*1808

3:4

1440*1920

9:16

1080*1920

duration integer (required)

ImportantThe duration directly affects billing, which is calculated per second. Before you call the API, confirm the model pricing.

The duration of the generated video, in seconds.

  • vidu/viduq3-ad_reference2video: An integer in the range of [3, 15]. The default value is 5.

  • vidu/viduq3-drama_reference2video: An integer in the range of [2, 15]. The default value is 5.

    • When the number of storyboard shots is too large or significantly fewer than duration, the model may automatically adjust the duration to ensure story completeness; the actual video duration may be longer or shorter than the duration setting.
    • Billing is based on the actual output duration.
  • vidu/viduq3-mix_reference2video: an integer in the range [1, 16]. Default value is 5.

  • vidu/viduq3_reference2video: an integer in the range [1, 16]. Default value is 5.

  • vidu/viduq3-turbo_reference2video: an integer in the range [1, 16]. Default value is 5.

  • vidu/viduq2-pro_reference2video: an integer in the range [1, 10]. Default value is 5.

    • Special setting: You can set this parameter to 0 to let the model determine the duration automatically, up to a maximum of 10 seconds.

      • If you provide one reference video, the duration of the generated video usually matches the duration of the reference video.
      • If you provide two reference videos, the model uses the prompt and the duration of the generated video usually matches the duration of the primary reference video.
  • vidu/viduq2_reference2video: The value is an integer in the range of [1, 10]. The default value is 5.

audio boolean (optional)

Supported models: vidu/viduq3-ad_reference2video, vidu/viduq3-mix_reference2video, vidu/viduq3_reference2video, vidu/viduq3-turbo_reference2video.

Specifies whether to generate a video with audio. If enabled, the model automatically generates background music or sound effects that match the video content.

  • false: The default value. The output is a silent video.
  • true: Outputs a video with audio.

Notevidu/viduq3-drama_reference2video does not support this parameter. This model outputs videos with audio by default.

watermark boolean (optional)

Specifies whether to add a watermark to the lower-right corner of the video. The watermark text is fixed to "Content generated by AI".

  • false: Default value. A watermark is not added.
  • true: Adds a watermark.

seedinteger(optional)

The seed. The value range is [0, 2147483647].

If you do not specify a seed, the system generates one randomly. To improve the reproducibility of results, we recommend setting a fixed seed value.

Note that due to the model's probabilistic nature, using the same seed does not guarantee identical results across runs.

Example: 12345

Advertising (image only)

Supported model: vidu/viduq3-ad_reference2video.

curl --location 'https://{WorkspaceId}.cn-beijing.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": "vidu/viduq3-ad_reference2video",
    "input": {
        "media": [
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/dtnctw/ad-1.png"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/bspdpd/ad-2.png"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/mhsjyy/ad-3.png"
            }
        ],
        "prompt": "一个瑜伽裤的广告。商品是一条左右各有一个口袋的黑色高腰瑜伽裤。亚洲模特开心地说"我现在再也不穿没有口袋的瑜伽裤了"。画面保持清晰、稳定、容易理解。"
    },
    "parameters": {
        "duration": 8,
        "size": "1080*1920",
        "resolution": "1080P",
        "watermark": true
    }
}'

Python SDK

import dashscope
import os
from dashscope import DashScopeError

# 若没有配置环境变量,请用百炼API Key将下行替换为:api_key="sk-xxx"
# 获取API Key:https://help.aliyun.com/zh/model-studio/get-api-key
client = dashscope.Client(api_key=os.getenv("DASHSCOPE_API_KEY"))

media = [{'type': 'image', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/dtnctw/ad-1.png'}, {'type': 'image', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/bspdpd/ad-2.png'}, {'type': 'image', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/mhsjyy/ad-3.png'}]

def sample_async_call():
    # 异步提交视频生成任务
    try:
        job = client.videos.jobs.create(model='vidu/viduq3-ad_reference2video',
                                        prompt='一个瑜伽裤的广告。商品是一条左右各有一个口袋的黑色高腰瑜伽裤。亚洲模特开心地说"我现在再也不穿没有口袋的瑜伽裤了"。画面保持清晰、稳定、容易理解。',
                                        media=media,
                                        size='1080*1920',
                                        resolution='1080P',
                                        duration=8,
                                        watermark=True)
        print(job)
        print("task_id: %s" % job.task_id)
    except DashScopeError as e:
        print(f"HTTP返回码:{e.status_code}")
        print(f"错误码:{e.code}")
        print(f"错误信息:{e.message}")
        print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")
        return

    # 查询任务状态
    try:
        snapshot = client.videos.jobs.fetch(job.task_id)
        print(snapshot.status)
    except DashScopeError as e:
        print(f"HTTP返回码:{e.status_code}")
        print(f"错误码:{e.code}")
        print(f"错误信息:{e.message}")
        print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")

    # 等待任务完成
    try:
        done = client.videos.jobs.wait(job)
        print(done)
        print(done.video_url)
    except DashScopeError as e:
        print(f"HTTP返回码:{e.status_code}")
        print(f"错误码:{e.code}")
        print(f"错误信息:{e.message}")
        print("请参考文档:https://help.aliyun.com/zh/model-studio/developer-reference/error-code")

if __name__ == '__main__':
    sample_async_call()

Drama (image only)

Supported model: vidu/viduq3-drama_reference2video.

curl --location 'https://{WorkspaceId}.cn-beijing.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": "vidu/viduq3-drama_reference2video",
       "input": {
        "media": [
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/eelcsu/daram-1.png"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/adglrn/drama-2.png"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/fmofkp/drama-3.png"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260713/mktdht/drama-4.png"
            }
        ],
        "prompt": "酒店宴会厅,王桂兰(图3)(在画面右侧,坐在席位上)苏文博(图1)、许向暖(图2)(在画面左侧远处,敬酒中)。婚礼现场座无虚席,坐满宾客。苏文博的母亲王桂兰坐在席位上,眉头紧紧皱起,面露不满。镜头固定,捕捉她皱眉的表情。镜头推进王桂兰面部,她眼神阴沉,嘴角下撇,带着嫌弃和不满。强调她的不悦。"
    },
    "parameters": {
        "duration": 9,
        "size": "1080*1920",
        "resolution": "1080P",
        "watermark": true
    }
}'

Image only

curl --location 'https://{WorkspaceId}.cn-beijing.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": "vidu/viduq3-mix_reference2video",
       "input": {
        "media": [
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260320/knsple/wan-r2v-role-frame.jpg"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
            }
        ],
        "prompt": "男人坐在靠窗的椅子上,手持吉他,在咖啡厅旁演奏一首舒缓的美国乡村民谣"
    },
    "parameters": {
        "duration": 5,
        "size": "1280*720",
        "resolution": "720P",
        "watermark": true
    }
}'

Image and video

Supported model: vidu/viduq2-pro_reference2video.

curl --location 'https://{WorkspaceId}.cn-beijing.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": "vidu/viduq2-pro_reference2video",
       "input": {
        "media": [
            {
                "type": "video",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png"
            },
            {
                "type": "image",
                "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
            }
        ],
        "prompt": "男人坐在靠窗的椅子上,手持吉他,在咖啡厅旁演奏一首舒缓的美国乡村民谣"
    },
    "parameters": {
        "duration": 5,
        "size": "1280*720",
        "resolution": "720P",
        "watermark": true
    }
}'

Response parameters

output object

The output data for the task.

Properties

task_id string

The task ID. Valid for queries for 24 hours.

task_status string

The status of the task.

Enumeration values

  • PENDING: The task is queuing.
  • RUNNING: The task is being processed.
  • SUCCEEDED: The task succeeded.
  • FAILED: The task failed.
  • CANCELED: The task was canceled.
  • UNKNOWN: The task does not exist or its status is unknown.

request_idstring

Unique request identifier for tracing and troubleshooting.

codestring

The error code returned when the request fails. This parameter is not returned when the request succeeds. For more information, see Error codes.

messagestring

The detailed error message returned when the request fails. This parameter is not returned when the request succeeds. For more information, see Error codes.

Successful response

Save the task_id for querying the task status and results.

{
    "output": {
        "task_status": "PENDING",
        "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx"
    },
    "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx"
}

Error response

Task creation failed. See Error codes for troubleshooting.

{
    "code": "InvalidApiKey",
    "message": "No API-key provided.",
    "request_id": "7438d53d-6eb8-4596-8835-xxxxxx"
}

Step 2: Query the task result

China (Beijing) region: GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id}

Note

  • Polling recommendation: Video generation can take several minutes. We recommend using a polling mechanism with a reasonable query interval (for example, 15 seconds) to retrieve the result.
  • Task status transitions: PENDING (queued) → RUNNING (in progress) → SUCCEEDED (successful) / FAILED (failed).
  • task_id validity period: 24 hours. After the validity period expires, you can no longer query the result, and the API returns the task status as UNKNOWN.
  • RPS limit: The query API has a default RPS limit of 20. For higher-frequency queries or to receive event notifications, we recommend configuring asynchronous task callbacks.
  • More operations: For operations such as querying tasks in batches or canceling tasks, see Manage asynchronous tasks.

Request parameters

Request headers

Authorization string (Required)

Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx.

Path parameters

task_id string (Required)

The ID of the task.

Query task result

Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours

curl -X GET https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/api/v1/tasks/{task_id} \
--header "Authorization: Bearer $DASHSCOPE_API_KEY"

Response parameters

outputobject

The output data for the task.

Properties

task_id string

The task ID. Valid for queries for 24 hours.

task_status string

The status of the task.

Enumeration values

  • PENDING: The task is queuing.
  • RUNNING: The task is being processed.
  • SUCCEEDED: The task succeeded.
  • FAILED: The task failed.
  • CANCELED: The task was canceled.
  • UNKNOWN: The task does not exist or its status is unknown.
State 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 contains 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 the 24-hour validity period has expired.

submit_time string

The time when the task was submitted. The format is YYYY-MM-DD HH:mm:ss.SSS.

scheduled_time string

The time when the task was executed. The format is YYYY-MM-DD HH:mm:ss.SSS.

end_time string

The time when the task was completed. The format is YYYY-MM-DD HH:mm:ss.SSS.

video_urlstring

The video URL. Returned only when task_status is SUCCEEDED.

The video is in MP4 format (H.264 encoded). The video URL is valid for 24 hours. Download the video promptly.

orig_prompt string

The original input prompt, corresponding to the request parameter prompt.

codestring

The error code returned when the request fails. This parameter is not returned when the request succeeds. For more information, see Error codes.

messagestring

The detailed error message returned when the request fails. This parameter is not returned when the request succeeds. For more information, see Error codes.

usage object

Usage statistics (counted for successful tasks only).

Properties

duration integer

The total duration of the generated video, used for billing.

size string

Specifies the resolution of the generated video.

fps integer

Specifies the frame rate of the generated video. The value is fixed at 24.

SR string

Specifies the resolution tier of the generated video.

audio boolean

Indicates whether the generated video includes audio.

video_count integer

Specifies the number of videos generated. The value is fixed at 1.

reference_type string

Specifies the type of reference materials used.

request_idstring

Unique request identifier for tracing and troubleshooting.

Task succeeded

Video URLs are valid for only 24 hours and then automatically purged. Save generated videos promptly.

{
    "request_id": "8f240644-efe8-43bf-86ff-xxxxxx",
    "output": {
        "task_id": "b7e05baa-c318-440d-b293-xxxxxx",
        "task_status": "SUCCEEDED",
        "submit_time": "2026-03-27 15:10:42.723",
        "scheduled_time": "2026-03-27 15:10:42.754",
        "end_time": "2026-03-27 15:11:17.388",
        "orig_prompt": "男人坐在靠窗的椅子上,手持吉他,在咖啡厅旁演奏一首舒缓的美国乡村民谣",
        "video_url": "https://prod-ss-vidu.s3.cn-northwest-1.amazonaws.com.cn/xxx.mp4?xxx"
    },
    "usage": {
        "duration": 5,
        "size": "960*528",
        "output_video_duration": 5,
        "fps": 24,
        "video_count": 1,
        "audio": false,
        "reference_type": "image,video",
        "SR": "540"
    }
}

Task failed

If the task fails, task_status is set to FAILED, and an error code and message are provided. See Error codes for troubleshooting.

{
    "request_id": "e5d70b02-ebd3-98ce-9fe8-759d7d7b107d",
    "output": {
        "task_id": "86ecf553-d340-4e21-af6e-a0c6a421c010",
        "task_status": "FAILED",
        "code": "InvalidParameter",
        "message": "The size is not match xxxxxx"
    }
}

Task query expired

The task_id can be queried within 24 hours; after that it can no longer be queried, and the following error message is returned.

{
    "request_id": "a4de7c32-7057-9f82-8581-xxxxxx",
    "output": {
        "task_id": "502a00b1-19d9-4839-a82f-xxxxxx",
        "task_status": "UNKNOWN"
    }
}

Error codes

If the model call fails and returns an error message, see Error codes for resolution.

FAQ

Q: Do size and resolution have to be passed at the same time?

A: No. Both parameters are optional, but we recommend providing both. This allows you to precisely control the aspect ratio of the generated video. For details, see Valid size values.

If you do not provide both, the system handles the request as follows:

  • Pass size only: the size parameter is ignored, and the system forcibly processes the request with the default resolution=720P and its corresponding size default value (1280*720).

    For example, the API returns size="1280*720", SR=720.

  • Pass resolution only: the output is generated at the specified resolution tier with the 16:9 aspect ratio corresponding to that tier.

    For example, when resolution=540P, the API returns size="960528", SR=540; when resolution=1080P, the API returns size="19201080", SR=1080.