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

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: minimax-hailuo-2.3, minimax-hailuo-2.3-fast

image*object

Image information; the first frame is required for flyer images. It must include the imageUrl field (image URL, must be publicly accessible). The image size must be less than 20MB. Supported formats include JPG/JPEG/PNG/WebP. The shorter side must be greater than 300px, and the aspect ratio must be between 2:5 and 5:2.

imageUrl*string

Image Link

headtailImages*object

First and last frame image information (supported only by minimax-hailuo-02), where the last frame image is required. Includes headImage.imageUrl (first frame image) and tailImage.imageUrl (last frame image).

headImage?object

First Frame Image Information

imageUrl?string

Image Link

tailImage?object

Last Frame Image Information

imageUrl?string

Image Link

prompt?string

Prompt, up to 2000 characters

duration?integer

Video resolution, supported: 768p (default), 1080p (6s only)

resolution?string

Video resolution, supported: 768p (default), 1080p (6s only)

promptOptimizer?boolean

Whether to automatically optimize the prompt, defaults to true

fastPretreatment?boolean

Whether to shorten the optimization time for prompt_optimizer, defaults to false. This parameter takes effect only when the image parameter is passed.

aigcWatermark?boolean

Whether to add a watermark to the generated video, defaults to false.

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

Image Count

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": {}  }'
{
  "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"
}