Request parameters Request headers Content-Typestring(required) Request content type. This parameter must be set to application/json. Authorization string (Required) Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. X-DashScope-Asyncstring(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 following error occurs: "current user api does not support synchronous calls". Request body model string (required) Model name. For model output specifications, see Models. Valid values:
- pixverse/pixverse-v6-r2v-omni
- pixverse/pixverse-c1-r2v
- pixverse/pixverse-v6-r2v
- pixverse/pixverse-v5.6-r2v
Model selection
- For generation that combines image and video references, v6-r2v-omni is recommended, which supports passing both reference images and reference videos at the same time.
- For dynamic scenes such as fights, spell effects, and high-speed motion, as well as multi-grid scenes, c1 is recommended.
- For general scenarios, v6 is recommended; if you are using v5.6, upgrade directly to v6.
input object (required) Basic input information, including reference images and the prompt. Properties prompt string (required) Text prompt. It describes the elements and visual features that you expect in the generated video. Both Chinese and English are supported. Each Chinese character or letter counts as one character. The character encoding is UTF-8, and any excess is automatically truncated.
- pixverse/pixverse-v6-r2v-omni: Up to 5,000 characters.
- pixverse/pixverse-c1-r2v: Up to 5,000 characters.
- pixverse/pixverse-v6-r2v: Up to 2,048 characters.
- pixverse/pixverse-v5.6-r2v: Up to 2,048 characters.
Image reference: when reference images are passed in the media parameter, you can use @ref_name in the prompt to directly reference an image.
- The ref_name set in media must be globally unique within the same request and must correspond one-to-one to the references in the prompt.
- Formatting rule: a space must be kept after
@ref_name as a separator.
Example values:
- Plain prompt: A man sitting in a chair by the window, holding a guitar, playing a soothing American country folk song beside a cafe.
- Prompt with references: @man sitting in a chair by the window, holding a @guitar, playing a soothing American country folk song beside a @cafe.
media array (required) A list of media assets used to specify the reference images and videos required for video generation. Each element in the array is a media object containing the type and url fields. Element properties type string (required) The media asset type. Valid values:
image_url: Image URL.
video_url: Video URL (only supported by pixverse/pixverse-v6-r2v-omni).
Media asset quantity limits:
- Number of images: pixverse/pixverse-v6-r2v-omni supports up to 10 images, and other models support up to 7.
- Number of videos (omni only): 1 to 2.
url string (required) The media asset URL. Assets include images and videos (videos are only supported by the omni model). ref_name string (optional) The name identifier of the subject in the reference image or video, used for reference in the prompt via @ref_name. The length must not exceed 30 characters. parameters object (required) Video generation parameters, such as setting the video resolution, duration, and whether to generate audio. Properties resolution string (required for the omni model) The resolution tier of the generated video. Only pixverse/pixverse-v6-r2v-omni uses this parameter. Valid values: aspect_ratio string (required for the omni model) The aspect ratio of the generated video. Only pixverse/pixverse-v6-r2v-omni uses this parameter. Valid values:
auto: automatically uses the aspect ratio of the first image or video.
16:9
4:3
1:1
3:4
9:16
3:2
2:3
21:9
size string (required for c1/v6/v5.6 models) The resolution of the generated video, in the format of width*height pixel values. The pixverse/pixverse-v6-r2v-omni model does not support this parameter. See the table below for the optional values corresponding to different resolution tiers. pixverse/pixverse-c1-r2v model Resolution tier | Aspect ratio | size value (width*height) | 360P | 16:9 | 640*360 | 4:3 | 640*480 | 1:1 | 640*640 | 3:4 | 480*640 | 9:16 | 360*640 | 3:2 | 640*432 | 2:3 | 432*640 | 21:9 | 640*288 | 540P | 16:9 | 1024*576 | 4:3 | 1024*768 | 1:1 | 1024*1024 | 3:4 | 768*1024 | 9:16 | 576*1024 | 3:2 | 1024*688 | 2:3 | 688*1024 | 21:9 | 1024*448 | 720P | 16:9 | 1280*720 | 4:3 | 1108*832 | 1:1 | 960*960 | 3:4 | 832*1108 | 9:16 | 720*1280 | 3:2 | 1200*800 | 2:3 | 800*1200 | 21:9 | 1280*560 | 1080P | 16:9 | 1920*1080 | 4:3 | 1664*1248 | 1:1 | 1440*1440 | 3:4 | 1248*1664 | 9:16 | 1080*1920 | 3:2 | 1776*1184 | 2:3 | 1184*1776 | 21:9 | 1920*832 |
pixverse/pixverse-v6-r2v model Resolution tier | Aspect ratio | size value (width*height) | 360P | 16:9 | 640*360 | 4:3 | 640*480 | 1:1 | 640*640 | 3:4 | 480*640 | 9:16 | 360*640 | 3:2 | 640*432 | 2:3 | 432*640 | 21:9 | 640*288 | 540P | 16:9 | 1024*576 | 4:3 | 1024*768 | 1:1 | 1024*1024 | 3:4 | 768*1024 | 9:16 | 576*1024 | 3:2 | 1024*688 | 2:3 | 688*1024 | 21:9 | 1024*448 | 720P | 16:9 | 1280*720 | 4:3 | 1108*832 | 1:1 | 960*960 | 3:4 | 832*1108 | 9:16 | 720*1280 | 3:2 | 1200*800 | 2:3 | 800*1200 | 21:9 | 1280*560 | 1080P | 16:9 | 1920*1080 | 4:3 | 1664*1248 | 1:1 | 1440*1440 | 3:4 | 1248*1664 | 9:16 | 1080*1920 | 3:2 | 1776*1184 | 2:3 | 1184*1776 | 21:9 | 1920*832 |
pixverse/pixverse-v5.6-r2v model (upgrade to v6 recommended) Resolution tier | Aspect ratio | size value (width*height) | 360P | 16:9 | 640*360 | 4:3 | 640*480 | 1:1 | 640*640 | 3:4 | 480*640 | 9:16 | 360*640 | 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 | 1108*830 | 1:1 | 960*960 | 3:4 | 830*1108 | 9:16 | 720*1280 | 1080P | 16:9 | 1920*1080 | 4:3 | 1662*1246 | 1:1 | 1440*1440 | 3:4 | 1246*1662 | 9:16 | 1080*1920 |
Example: 1280*720. duration integer (Required) The duration of the generated video, in seconds. Valid values:
-
pixverse/pixverse-v6-r2v-omni:
- With a video reference: must be set to
0; the system automatically uses the longest duration of the input videos.
- With only image references: an integer in the range [1, 15].
-
pixverse/pixverse-c1-r2v: an integer in the range [1, 15].
-
pixverse/pixverse-v6-r2v: an integer in the range [1, 15].
-
pixverse/pixverse-v5.6-r2v:
- When size is any resolution corresponding to 360P, 540P, or 720P: The value can be 5, 8, or 10.
- When size is any resolution corresponding to 1080P: The value can be 5 or 8.
Example: 5. audio boolean (Optional) ImportantThe audio parameter directly affects the cost. Before making a call, confirm the billing details for PixVerse reference-to-video. Specifies whether to generate a video with sound. If enabled, the model automatically generates matching background music or sound effects based on the video content.
false: Default. Outputs a silent video.
true: Outputs a video with sound.
Example: false. watermark boolean (Optional) Specifies whether to add a watermark. The watermark is located in the lower-right corner of the video and the text is fixed as "AI Generated".
false: Default. No watermark is added.
true: A watermark is added.
Example: false. seed integer (Optional) The random number seed must be an integer in the range [0, 2147483647]. If not specified, a random seed is generated. A fixed seed improves reproducibility. Because model generation is probabilistic, the same seed does not guarantee identical results. | Reference-to-video (image + video, omni)Pass reference videos and images through media. Use resolution and aspect_ratio to control the output resolution and aspect ratio. # 调用时请将 {WorkspaceId} 替换为真实的业务空间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": "pixverse/pixverse-v6-r2v-omni",
"input": {
"media": [
{
"type": "video_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4",
"ref_name": "参考视频"
},
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260320/knsple/wan-r2v-role-frame.jpg",
"ref_name": "男人"
},
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png",
"ref_name": "咖啡厅"
}
],
"prompt": "@男人 在@咖啡厅 中弹吉他 参考@参考视频"
},
"parameters": {
"resolution": "720P",
"aspect_ratio": "16:9",
"duration": 0,
"audio": true,
"watermark": false
}
}'
Python SDKimport 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': 'video_url', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qigswt/wan-r2v-role2.mp4', 'ref_name': '参考视频'}, {'type': 'image_url', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260320/knsple/wan-r2v-role-frame.jpg', 'ref_name': '男人'}, {'type': 'image_url', 'url': 'https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png', 'ref_name': '咖啡厅'}]
def sample_async_call():
# 异步提交视频生成任务
# aspect_ratio/audio 为 parameters 段字段,不在具名签名内,经 parameters 透传
try:
job = client.videos.jobs.create(model='pixverse/pixverse-v6-r2v-omni',
media=media,
prompt='@男人 在@咖啡厅 中弹吉他 参考@参考视频',
resolution='720P',
duration=0,
watermark=False,
parameters={'aspect_ratio': '16:9',
'audio': 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()
Reference-to-videoPass reference images through media. Set size and duration to control the video resolution and duration. # 调用时请将 {WorkspaceId} 替换为真实的业务空间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": "pixverse/pixverse-c1-r2v",
"input": {
"media": [
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260320/knsple/wan-r2v-role-frame.jpg"
},
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png"
},
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png"
}
],
"prompt": "男人坐在靠窗的椅子上,手持吉他,在咖啡厅旁演奏一首舒缓的美国乡村民谣"
},
"parameters": {
"size": "1280*720",
"duration": 5,
"audio": false,
"watermark": true
}
}'
Reference-to-video (using ref_name)Pass reference images in media and pass ref_name to set the entity name for the reference image. # 调用时请将 {WorkspaceId} 替换为真实的业务空间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": "pixverse/pixverse-c1-r2v",
"input": {
"media": [
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260320/knsple/wan-r2v-role-frame.jpg",
"ref_name": "男人"
},
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/qpzxps/wan-r2v-object4.png",
"ref_name": "吉他"
},
{
"type": "image_url",
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/wfjikw/wan-r2v-backgroud5.png",
"ref_name": "咖啡厅"
}
],
"prompt": "@男人 坐在靠窗的椅子上,手持@吉他 ,在@咖啡厅 旁演奏一首舒缓的美国乡村民谣"
},
"parameters": {
"size": "1280*720",
"duration": 5,
"audio": false,
"watermark": true
}
}'
|