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

Text-to-Video

POST/api/v1/video/generation

Header Parameters

Authorization*string

Format: Authorization: Bearer sk-xxxxxx

Request Body

application/json

_action*string

Fixed Value t2v

model?string

Model name, supported: minimax-hailuo-02 minimax-hailuo-2.3

prompt*string

Generated prompt text, maximum length 2000 characters

duration?integer

Video duration in seconds, where available values depend on the resolution. Supported values: 6 (default), 10.

resolution?string

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

promptOptimizer?boolean

Whether to automatically optimize the prompt, defaults to true

fastPretreatment?boolean

Whether to reduce the optimization time of prompt_optimizer, default is false.

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

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",    "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"
}