Video Generation
curl --request POST \
--url https://api.minimaxi.com/v1/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "A girl runs toward the camera and winks with a smile.",
"subject_reference": [
{
"type": "character",
"image": [
"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg"
]
}
],
"model": "S2V-01"
}
'import requests
url = "https://api.minimaxi.com/v1/video_generation"
payload = {
"prompt": "A girl runs toward the camera and winks with a smile.",
"subject_reference": [
{
"type": "character",
"image": ["https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg"]
}
],
"model": "S2V-01"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
prompt: 'A girl runs toward the camera and winks with a smile.',
subject_reference: [
{
type: 'character',
image: [
'https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg'
]
}
],
model: 'S2V-01'
})
};
fetch('https://api.minimaxi.com/v1/video_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimaxi.com/v1/video_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A girl runs toward the camera and winks with a smile.',
'subject_reference' => [
[
'type' => 'character',
'image' => [
'https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg'
]
]
],
'model' => 'S2V-01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/video_generation"
payload := strings.NewReader("{\n \"prompt\": \"A girl runs toward the camera and winks with a smile.\",\n \"subject_reference\": [\n {\n \"type\": \"character\",\n \"image\": [\n \"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg\"\n ]\n }\n ],\n \"model\": \"S2V-01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimaxi.com/v1/video_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"prompt\": \"A girl runs toward the camera and winks with a smile.\",\n \"subject_reference\": [\n {\n \"type\": \"character\",\n \"image\": [\n \"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg\"\n ]\n }\n ],\n \"model\": \"S2V-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"prompt\": \"A girl runs toward the camera and winks with a smile.\",\n \"subject_reference\": [\n {\n \"type\": \"character\",\n \"image\": [\n \"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg\"\n ]\n }\n ],\n \"model\": \"S2V-01\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "106916112212032",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}视频生成
主体参考视频生成任务
使用本接口上传人物主体图片及文本内容,创建视频生成任务。
POST
/
v1
/
video_generation
Video Generation
curl --request POST \
--url https://api.minimaxi.com/v1/video_generation \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: <content-type>' \
--data '
{
"prompt": "A girl runs toward the camera and winks with a smile.",
"subject_reference": [
{
"type": "character",
"image": [
"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg"
]
}
],
"model": "S2V-01"
}
'import requests
url = "https://api.minimaxi.com/v1/video_generation"
payload = {
"prompt": "A girl runs toward the camera and winks with a smile.",
"subject_reference": [
{
"type": "character",
"image": ["https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg"]
}
],
"model": "S2V-01"
}
headers = {
"Content-Type": "<content-type>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': '<content-type>', Authorization: 'Bearer <token>'},
body: JSON.stringify({
prompt: 'A girl runs toward the camera and winks with a smile.',
subject_reference: [
{
type: 'character',
image: [
'https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg'
]
}
],
model: 'S2V-01'
})
};
fetch('https://api.minimaxi.com/v1/video_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.minimaxi.com/v1/video_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'A girl runs toward the camera and winks with a smile.',
'subject_reference' => [
[
'type' => 'character',
'image' => [
'https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg'
]
]
],
'model' => 'S2V-01'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: <content-type>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.minimaxi.com/v1/video_generation"
payload := strings.NewReader("{\n \"prompt\": \"A girl runs toward the camera and winks with a smile.\",\n \"subject_reference\": [\n {\n \"type\": \"character\",\n \"image\": [\n \"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg\"\n ]\n }\n ],\n \"model\": \"S2V-01\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "<content-type>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.minimaxi.com/v1/video_generation")
.header("Content-Type", "<content-type>")
.header("Authorization", "Bearer <token>")
.body("{\n \"prompt\": \"A girl runs toward the camera and winks with a smile.\",\n \"subject_reference\": [\n {\n \"type\": \"character\",\n \"image\": [\n \"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg\"\n ]\n }\n ],\n \"model\": \"S2V-01\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.minimaxi.com/v1/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = '<content-type>'
request["Authorization"] = 'Bearer <token>'
request.body = "{\n \"prompt\": \"A girl runs toward the camera and winks with a smile.\",\n \"subject_reference\": [\n {\n \"type\": \"character\",\n \"image\": [\n \"https://cdn.hailuoai.com/prod/2025-08-12-17/video_cover/1754990600020238321-411603868533342214-cover.jpg\"\n ]\n }\n ],\n \"model\": \"S2V-01\"\n}"
response = http.request(request)
puts response.read_body{
"task_id": "106916112212032",
"base_resp": {
"status_code": 0,
"status_msg": "success"
}
}授权
请求头
请求体的媒介类型,请设置为 application/json 确保请求数据的格式为 JSON.
可用选项:
application/json 请求体
application/json
模型名称。可用值: S2V-01.
可用选项:
S2V-01 主体参考,仅当 model 为 S2V-01 时可用。目前仅支持单个主体
Show child attributes
Show child attributes
视频的文本描述,最大 2000 字符.
是否自动优化 prompt,默认为 true。设为 false 可进行更精确的控制
接收任务状态更新通知的回调 URL。支持通过 callback_url 参数可以配置回调,以接收任务状态的更新的异步通知。
地址验证:配置后,MiniMax 服务器会向 callback_url 发送一个 POST 请求,请求体中包含 challenge 字段。服务端需要在 3 秒内原样返回该 challenge 值以完成验证 状态更新:验证成功后,每当任务状态变更时,MiniMax 都会向该 URL 推送最新的任务状态。推送的数据结构与调用查询视频生成任务接口的响应体一致
回调返回的"status"包括以下状态:
"processing"- 生成中"success"- 成功"failed"- 失败
from fastapi import FastAPI, HTTPException, Request import json app = FastAPI() @app.post("/get_callback") async def get_callback(request: Request): try: json_data = await request.json() challenge = json_data.get("challenge") if challenge is not None: # Validation request, echo back challenge return {"challenge": challenge} else: # Status update request, handle accordingly # { # "task_id": "115334141465231360", # "status": "success", # "file_id": "205258526306433", # "base_resp": { # "status_code": 0, # "status_msg": "success" # } # } return {"status": "success"} except Exception as e: raise HTTPException(status_code=500, detail=str(e)) if __name__ == "__main__": import uvicorn uvicorn.run( app, # 必选 host="0.0.0.0", # 必选 port=8000, # 必选,端口可设置 # ssl_keyfile="yourname.yourDomainName.com.key", # 可选,看是否开启ssl # ssl_certfile="yourname.yourDomainName.com.key", # 可选,看是否开启ssl )
是否在生成的视频中添加水印,默认为 false
此页面对您有帮助吗?
⌘I