curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-Hailuo-2.3",
"prompt": "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
"duration": 6,
"resolution": "1080P"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "MiniMax-Hailuo-2.3",
"prompt": "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
"duration": 6,
"resolution": "1080P",
},
)
print(response.json())
const response = await fetch("https://toapis.com/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "MiniMax-Hailuo-2.3",
prompt: "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
duration: 6,
resolution: "1080P"
})
});
console.log(await response.json());
{
"id": "vid_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "MiniMax-Hailuo-2.3",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
MiniMax-Hailuo-2.3
MiniMax-Hailuo-2.3 視頻生成
使用 MiniMax Hailuo 2.3 系列模型生成視頻,支持文生視頻和圖生視頻,可選 Fast 快速模式
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-Hailuo-2.3",
"prompt": "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
"duration": 6,
"resolution": "1080P"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "MiniMax-Hailuo-2.3",
"prompt": "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
"duration": 6,
"resolution": "1080P",
},
)
print(response.json())
const response = await fetch("https://toapis.com/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "MiniMax-Hailuo-2.3",
prompt: "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
duration: 6,
resolution: "1080P"
})
});
console.log(await response.json());
{
"id": "vid_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "MiniMax-Hailuo-2.3",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}
中國大陸用戶請注意: 中國大陸用戶請使用
https://toapis.cn 作為接口地址(Base URL)。文檔示例中的 https://toapis.com 請替換為 https://toapis.cn。- 異步任務接口,提交後返回任務 ID
- 支持模型:
MiniMax-Hailuo-2.3、MiniMax-Hailuo-2.3-Fast MiniMax-Hailuo-2.3:支持文生視頻和圖生視頻,畫質最優MiniMax-Hailuo-2.3-Fast:僅支持圖生視頻(必須傳入首幀圖片),生成速度更快
請傳入公網可訪問的圖片 URL。不要在
image_urls 中直接傳 base64 圖片數據;本地圖片請先使用 上傳圖片接口 獲取 URL。認證
string
必填
所有接口均需要使用 Bearer Token 認證。
Authorization: Bearer YOUR_API_KEY
請求參數
string
必填
模型名稱。可選值:
MiniMax-Hailuo-2.3- 支持文生視頻和圖生視頻MiniMax-Hailuo-2.3-Fast- 僅支持圖生視頻(必須傳入image_urls)
string
必填
視頻內容描述,最大 2000 字符。支持 15 種運鏡指令(如
[推進]、[拉遠]、[左搖,上升] 等),詳見下方運鏡指令表。示例:"一隻貓咪在花園中奔跑 [推進],然後停下來看向鏡頭 [固定]"integer
預設值:"6"
視頻時長(秒)。可選值:
6 或 10使用
1080P 分辨率時,僅支持 6 秒時長。string
預設值:"768P"
視頻分辨率。可選值:
768P- 高清(默認)1080P- 全高清(僅支持 6 秒時長)
string[]
首幀圖片 URL 數組。
- 不傳:文生視頻(
MiniMax-Hailuo-2.3-Fast不支持,必須傳入) - 傳 1 張:圖生視頻,圖片作爲視頻起始幀
- 格式:JPG、JPEG、PNG、WebP
- 大小:小於 20MB
- 尺寸:短邊 > 300px,長寬比在 2:5 ~ 5:2 之間
["https://example.com/first-frame.jpg"]object
模型對比
| 模型 | 文生視頻 | 圖生視頻 | 分辨率 | 時長 |
|---|---|---|---|---|
MiniMax-Hailuo-2.3 | ✅ | ✅ | 768P / 1080P | 6s / 10s |
MiniMax-Hailuo-2.3-Fast | ❌ | ✅(必傳首幀) | 768P / 1080P | 6s / 10s |
分辨率與時長組合
| 分辨率 | 支持的時長 | 備註 |
|---|---|---|
| 768P | 6 秒、10 秒 | 默認分辨率 |
| 1080P | 6 秒 | 不支持 10 秒 |
運鏡指令
在prompt 中使用 [指令] 語法控制運鏡效果:
| 類別 | 指令 |
|---|---|
| 平移 | [左移] [右移] |
| 左右搖 | [左搖] [右搖] |
| 推拉 | [推進] [拉遠] |
| 升降 | [上升] [下降] |
| 上下搖 | [上搖] [下搖] |
| 變焦 | [變焦推近] [變焦拉遠] |
| 其他 | [晃動] [跟隨] [固定] |
- 組合運鏡:同一
[]內多個指令同時生效,如[左搖,上升],建議不超過 3 個 - 順序運鏡:prompt 中前後出現的指令依次生效,如
"...[推進],然後...[拉遠]"
響應
string
任務 ID,用於查詢任務狀態。
string
對象類型,固定爲
generation.task。string
本次請求使用的模型名稱。
string
任務狀態:
queued、in_progress、completed 或 failed。integer
任務創建時間戳。
示例
文生視頻
{
"model": "MiniMax-Hailuo-2.3",
"prompt": "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
"duration": 6,
"resolution": "1080P"
}
圖生視頻
{
"model": "MiniMax-Hailuo-2.3",
"prompt": "讓圖片中的人物緩緩轉身並微笑",
"image_urls": ["https://example.com/portrait.jpg"],
"duration": 6,
"resolution": "1080P"
}
圖生視頻(Fast 快速模式)
{
"model": "MiniMax-Hailuo-2.3-Fast",
"prompt": "人物從靜止開始緩慢行走",
"image_urls": ["https://example.com/person.jpg"],
"duration": 6,
"resolution": "768P"
}
運鏡控制
{
"model": "MiniMax-Hailuo-2.3",
"prompt": "一個人拿起一本書 [上升],然後開始閱讀 [固定]",
"duration": 6,
"resolution": "768P"
}
10 秒長視頻
{
"model": "MiniMax-Hailuo-2.3",
"prompt": "海浪拍打沙灘,日落時分,金色光芒灑在海面上",
"duration": 10,
"resolution": "768P",
"metadata": {
"prompt_optimizer": true,
"fast_pretreatment": true
}
}
視頻生成爲異步任務。提交後使用 獲取視頻任務狀態 查詢進度和結果。
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-Hailuo-2.3",
"prompt": "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
"duration": 6,
"resolution": "1080P"
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "MiniMax-Hailuo-2.3",
"prompt": "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
"duration": 6,
"resolution": "1080P",
},
)
print(response.json())
const response = await fetch("https://toapis.com/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer your-ToAPIs-key",
"Content-Type": "application/json"
},
body: JSON.stringify({
model: "MiniMax-Hailuo-2.3",
prompt: "一隻貓咪在花園中奔跑,鏡頭緩緩推近,電影質感",
duration: 6,
resolution: "1080P"
})
});
console.log(await response.json());
{
"id": "vid_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ",
"object": "generation.task",
"model": "MiniMax-Hailuo-2.3",
"status": "queued",
"progress": 0,
"created_at": 1768380224,
"metadata": {}
}