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

Replace {WorkspaceId} with your actual workspace ID.

Note

  • After the task is created, use the returned task_id to query the result. The task_id is valid for 24 hours. Do not create duplicate tasks. Instead, use polling to retrieve the result.
  • For guidance for beginners, see Call APIs with Postman or cURL.

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)

Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be 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: 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

960*528

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

1920*1920

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 shots is too many or significantly fewer than the duration, the model may automatically adjust the video length to ensure story completeness. The actual video duration may be longer or shorter than the specified duration value.
    • Billing is calculated based on the actual output duration.
  • vidu/viduq3-mix_reference2video: The value is an integer in the range of [1, 16]. The default value is 5.

  • vidu/viduq3_reference2video: The value is an integer from 1 to 16. The default value is 5.

  • vidu/viduq3-turbo_reference2video: An integer from 1 to 16. The default value is 5.

  • vidu/viduq2-pro_reference2video: An integer from 1 to 10. The 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.

Replace {WorkspaceId} with your actual workspace ID.

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": "A yoga pants advertisement. The product is a pair of black high-waisted yoga pants with one pocket on each side. An Asian model happily says I will never wear yoga pants without pockets again. The video remains clear, stable, and easy to understand."
    },
    "parameters": {
        "duration": 8,
        "size": "1080*1920",
        "resolution": "1080P",
        "watermark": true
    }
}'

Python SDK

from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os

# If you have not configured environment variables, replace the following line with your API Key: api_key="sk-xxx"
# Get API Key: https://help.aliyun.com/en/model-studio/get-api-key
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():
    # Submit video generation task asynchronously
    rsp = VideoSynthesis.async_call(api_key=api_key,
                                model='vidu/viduq3-ad_reference2video',
                                prompt='A yoga pants advertisement. The product is a pair of black high-waisted yoga pants with one pocket on each side. An Asian model happily says I will never wear yoga pants without pockets again. The video remains clear, stable, and easy to understand.',
                                media=media,
                                size='1080*1920',
                                resolution='1080P',
                                duration=8,
                                watermark=True)
    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))

    # Query task status
    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 task to complete
    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()

Drama (image only)

Supported model: vidu/viduq3-drama_reference2video.

Replace {WorkspaceId} with your actual workspace ID.

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": "Hotel banquet hall. Wang Guilan (Image 3) sits on the right side of the frame. Su Wenbo (Image 1) and Xu Xiangnuan (Image 2) are in the distance on the left, making toasts. The wedding venue is packed with guests. Su Wenbo mother Wang Guilan sits at her seat, brow furrowed tightly, visibly displeased. The camera is fixed, capturing her frowning expression. The camera pushes in on Wang Guilan face - her gaze is dark, corners of her mouth turned down, showing disdain and dissatisfaction."
    },
    "parameters": {
        "duration": 9,
        "size": "1080*1920",
        "resolution": "1080P",
        "watermark": true
    }
}'

Image only

Replace {WorkspaceId} with your actual workspace ID.

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": "A man sits in a chair by a window, holding a guitar and playing a soothing American country folk song in a cafe."
    },
    "parameters": {
        "duration": 5,
        "size": "1280*720",
        "resolution": "720P",
        "watermark": true
    }
}'

Image and video

Supported model: vidu/viduq2-pro_reference2video.

Replace {WorkspaceId} with your actual workspace ID.

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": "A man sits in a chair by a window, holding a guitar and playing a soothing American country folk song in a cafe."
    },
    "parameters": {
        "duration": 5,
        "size": "1280*720",
        "resolution": "720P",
        "watermark": true
    }
}'

Response parameters

Successful response

Save the task_id to query the task status and result.

{
    "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.

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

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
  • RUNNING
  • SUCCEEDED
  • FAILED
  • CANCELED
  • UNKNOWN: The task does not exist or its status is unknown.

request_id string

Unique request identifier for tracing and troubleshooting.

message string

Detailed error message. Returned only for failed requests. See Error codes.

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, Replace {WorkspaceId} with your actual workspace ID.

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
  • RUNNING
  • SUCCEEDED
  • FAILED
  • CANCELED
  • UNKNOWN: The task does not exist or its status is unknown.
State transitions during polling:
  • PENDING → RUNNING → SUCCEEDED or FAILED.
  • The initial query status is usually PENDING or RUNNING.
  • When the status changes to SUCCEEDED, the response contains the generated video URL.
  • If the status is FAILED, check the error message and retry the task.

submit_time string

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

scheduled_time string

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

end_time string

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

video_urlstring

The URL of the video. This parameter is 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.

code string

Error code. Returned only for failed requests. See Error codes.

message string

Detailed error message. Returned only for failed requests. 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_id string

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": "A man sits in a chair by a window, holding a guitar and playing a soothing American country folk song in a cafe.",
        "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

When a task fails, task_status is FAILED with an error code and message. See Error codes.

{
    "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 is valid for 24 hours. After this period, queries return the following error.

{
    "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 I have to provide both size and resolution?

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:

  • Only size is passed: The size parameter is ignored, and the system uses the default resolution=720P and its corresponding default size value (1280*720).

    Example: The API returns size="1280*720" and SR=720.

  • If you provide only resolution: The output uses the specified resolution tier.

    For example, if you set resolution=540P, the API returns size="960*528" and SR=540. If you set resolution=1080P, the API returns size="1920*1080" and SR=1080.