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

Single Image/First and Last Frames/Intelligent Multi-Frame Video Generation VQ2T

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-turbo

resolution?string

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

seed?integer

Random Seed

bgm?boolean

Whether to enable background music, default is false

image*object

Image Information (Image-to-Video only)

imageUrl*string

Image Link

headtailImages*object

First and Last Frame Image Information (Only supported for video generation from first and last frames)

headImage*object

First Frame Image Information

imageUrl*string

Image Link

tailImage*object

Last Frame Image Information

imageUrl*string

Image Link

startImage*object

First frame image, supporting PNG, JPEG, JPG, and WebP formats, with a file size not exceeding 50 MB and an aspect ratio of less than 1:4 or 4:1 (only supported by Intelligent Multi-Frame Video Generation).

imageUrl*string

Image Link

imageSettings*array<object>

Smart multi-frame configuration, with a minimum of 2 frames and a maximum of 9 frames per task (only supported for smart multi-frame video generation)

[]?object
keyImage*object

Keyframe image, serving as the last frame of the current video segment or the first frame of the next segment.

imageUrl*string

Image Link

prompt?string

Extension prompt, used to control the extended video content, with a maximum length of 1,500 characters.

duration?integer

Multi-frame duration, the video duration between different keyframes, defaults to 5 seconds, with options ranging from 2 to 7 seconds.

prompt*string

Generated prompt text (supported only in single-image and first-last frame modes)

duration?integer

Video duration, in seconds (supported only in single-image and first-last-frame modes). Image-to-video: [1,10]. First-last-frame-to-video: [1,8].

metaData?string

Metadata identifier, JSON-formatted string, pass-through field (supported only by intelligent multi-frame video generation)

callbackUrl?string

Callback URL (Only supported for Smart Multi-frame Video Generation)

payload?string

Pass-through parameters without any processing, for data transmission only, up to 1,048,576 characters (supported only by intelligent multi-frame video generation)

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 Tokens

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",    "image": {      "imageUrl": "string"    },    "headtailImages": {      "headImage": {        "imageUrl": "string"      },      "tailImage": {        "imageUrl": "string"      }    },    "startImage": {      "imageUrl": "string"    },    "imageSettings": [      {        "keyImage": {          "imageUrl": "string"        }      }    ],    "prompt": "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"
}