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

Reference Video Generation VQ2

POST/api/v1/video/generation

Header Parameters

Authorization*string

Format: Authorization: Bearer sk-xxxxxx

Request Body

application/json

_action*string

Fixed value i2v

model*string

Model Name, Supported: viduq2

characterImages*array<object>

Reference image information (non-subject invocation mode), supporting up to seven images

[]?object
imageUrl*string

Image Link

prompt*string

Generated prompt text, required

duration?integer

Video duration in seconds, supported range: [1, 10]

resolution?string

Resolution, supported: 360p, 540p, 720p, 1080p

seed?integer

Random seed, optional

aspectRatio?string

Aspect ratio (default: 16:9, available values: 16:9, 9:16, 3:4, 4:3, 1:1)

bgm?boolean

Whether to enable background music, optional, defaults to false

subjects*array<object>

Refer to subject information (subject invocation mode) (up to three images per subject, maximum of seven images supported). serverId mode: ID returned by the subject API, supporting a maximum of 7.

[]?object
images*array<object>

Refer to the main image information

[]?object
imageUrl*string

Image URL

serverId*string

Refer to the entity identifier information, which must be generated by calling the Create Entity API.

id*string

Identification information for the prompt; use @xxx in the prompt. When passing serverId, this parameter value must be set to the elementName of the subject.

voiceId?string

Reference subject voice timbre, optional

audio?boolean

Whether to enable audio (main invocation mode). false: Direct audio and video output is not required, outputting a silent video. true: Direct audio and video output is required, outputting a video with dialogue and background audio. Note 1: The voice_id parameter takes effect only when this parameter is set to true.

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 "Content-Type: application/json" \  -d '{    "_action": "string",    "model": "string",    "characterImages": [      {        "imageUrl": "string"      }    ],    "prompt": "string",    "subjects": [      {        "images": [          {            "imageUrl": "string"          }        ],        "serverId": "string",        "id": "string"      }    ]  }'
{
  "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"
}