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

Image-to-Video

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: VE3.1 VE3.1F

prompt*string

Prompt, maximum 2000 characters

image*object

First frame image, used in conjunction with lastFrame to enable video generation from the first and last frames.

imageUrl*string

Image Link

lastFrame?object

Last frame image; first frame image must also be provided.

imageUrl*string

Image Link

referenceImages*object

Provided for reference-based image and video generation

imageUrl*string

Image URL

negativePrompt?string

Negative prompt, used to describe content you do not want to appear in the image, up to 1000 characters.

n?integer

Number of generations, default 1, supported values: 1, 2, 3, 4

aspectRatio?string

Aspect ratio, default 16:9, supported: 16:9, 9:16

durationSeconds?integer

Video duration, in seconds, default 8, supported values: 4, 6, 8

resolution?string

Resolution, default 720p, supported: 720p, 1080p, 4K

generateAudio?boolean

Whether to generate audio, defaults to false

personGeneration?string

Character generation policy, default: allow_adult, supported values: allow_adult, disallow

seed?integer

Random seed, value range: 0-4294967295

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",    "prompt": "string",    "image": {      "imageUrl": "string"    },    "referenceImages": {      "imageUrl": "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"
}