典名词元DMTOKENSHome
API DocumentationThird-Party Tools Tutorial
AI Model APIVideoWanxiang

Reference-to-Video 2.6

POST/api/v1/video/generation

Header Parameters

Authorization*string

Format: Authorization: Bearer sk-xxxxxx

X-DashScope-Async*string

Configuration parameters for asynchronous processing. HTTP requests only support asynchronous mode and must be set to enable.

Request Body

application/json

model*string

Model name, fixed value: wan2.6-r2v-flash wan2.6-r2v

Value in"wan2.6-r2v-flash" | "wan2.6-r2v"
input*object

Basic input information, such as prompts.

prompt?string

Text prompt. Used to describe the desired elements and visual characteristics to be included in the generated video. Supports Chinese and English; each Chinese character, letter, and punctuation mark counts as one character, and any excess is automatically truncated. wan2.6-r2v-flash: Maximum length of 1500 characters. wan2.6-r2v: Maximum length of 1500 characters. Character reference instructions: Use identifiers like "character1" and "character2" to reference characters, with each reference (video or image) containing only a single character. The model identifies characters in references solely through this method. Example value: character1 is happily watching a movie on the sofa.

negative_prompt?string

Negative prompt, used to describe content that should not appear in the video frame, allowing you to restrict the video output. Supports both Chinese and English, with a maximum length of 500 characters; any excess will be automatically truncated. Example values: low resolution, errors, worst quality, low quality, deformed, extra fingers, bad proportions, etc.

reference_urls*array<string>

An array of URLs for uploaded reference files, supporting both videos and images. Used to extract character appearance and voice (if applicable) to generate videos that match the reference features. Each URL can point to either an image or a video: Number of images: 0-5. Number of videos: 0-3. Total limit: images + videos ≤ 5. When multiple reference files are provided, the character order is defined by the array order. That is, the first URL corresponds to character1, the second to character2, and so on. Each reference file must contain only one main character. For example, character1 is a little girl, and character2 is an alarm clock.

[]?string
parameters*object

Video processing parameters, such as setting video resolution, configuring video duration, enabling intelligent prompt rewriting, and adding watermarks.

size?string

Specifies the resolution of the generated video in the format of widthheight. The default value and available enumerated values for this parameter depend on the model parameter, with the following rules: wan2.6-r2v-flash: The default value is 19201080 (1080P). Available resolutions: all resolutions corresponding to 720P and 1080P. wan2.6-r2v: The default value is 19201080 (1080P). Available resolutions: all resolutions corresponding to 720P and 1080P. 720P tier: Available video resolutions and their corresponding aspect ratios are: 1280720: 16:9. 7201280: 9:16. 960960: 1:1. 1088832: 4:3. 8321088: 3:4. 1080P tier: Available video resolutions and their corresponding aspect ratios are: 19201080: 16:9. 10801920: 9:16. 14401440: 1:1. 16321248: 4:3. 1248*1632: 3:4.

duration?integer

The duration of the generated video, in seconds. wan2.6-r2v-flash: An integer in the range [2, 10]. Default value is 5. wan2.6-r2v: An integer in the range [2, 10]. Default value is 5. Example value: 5.

shot_type?string

Specifies the shot type for the generated video, indicating whether the video consists of a single continuous shot or multiple cut shots. Parameter priority: shot_type > prompt. For example, if shot_type is set to "single", even if the prompt includes "generate a multi-shot video", the model will still output a single-shot video. Optional values: single: default value, outputs a single-shot video; multi: outputs a multi-shot video. Example value: single. Type, indicating whether the video consists of a single continuous shot or multiple cut shots. Parameter priority: shot_type > prompt. For example, if shot_type is set to "single", even if the prompt includes "generate a multi-shot video", the model will still output a single-shot video. Optional values: single: default value, outputs a single-shot video; multi: outputs a multi-shot video.

audio?boolean

Supported models: wan2.6-r2v-flash. Whether to generate video with audio. Optional values: true: Default value, outputs video with audio. false: Outputs silent video.

watermark?string

Whether to add a watermark. The watermark is located in the bottom-right corner of the video, and the text is fixed as "AI Generated". false: Default value, no watermark is added. true: Add a watermark.

seed?string

Random seed, with a value range of [0, 2147483647].

Response Body

application/json

Success

TypeScript Definitions

Use the response body type in TypeScript.

code*integer

Status Code

data*object

Data Object

urls*array<string>

Result Set

[]?string
usage*object

Usage Information

images*integer

Number of Images

seconds*integer

Video Duration in Seconds

input_tokens*integer

Input Token Count

total_tokens*integer

Total Token Count

output_tokens*integer

Output Token Count

expired*string

Validity Period

task_id*string

Task ID

task_status*string

Task Status

message*string

Status Information

request_id*string

Request ID

curl -X POST "https://api.ygw.ai/api/v1/video/generation" \  -H "Authorization: string" \  -H "X-DashScope-Async: string" \  -H "Content-Type: application/json" \  -d '{    "model": "wan2.6-r2v-flash",    "input": {      "reference_urls": [        "string"      ]    },    "parameters": {}  }'
{
  "code": 0,
  "data": {
    "urls": [
      "string"
    ],
    "usage": {
      "images": 0,
      "seconds": 0,
      "input_tokens": 0,
      "total_tokens": 0,
      "output_tokens": 0
    },
    "expired": "string",
    "task_id": "string",
    "task_status": "string"
  },
  "message": "string",
  "request_id": "string"
}