curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "一名宇航员站在月球边缘眺望蓝色地球,镜头缓慢推进",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "女孩从童年自然成长为青年,镜头平稳推进,保持人物身份一致",
"duration": 5,
"resolution": "2K",
"image_with_roles": [
{"url": "https://example.com/start.jpg", "role": "first_frame"},
{"url": "https://example.com/end.jpg", "role": "last_frame"}
]
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物和图片2中的服装设计,让角色走过雨夜街道",
"duration": 6,
"resolution": "2K",
"aspect_ratio": "9:16",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"},
{"url": "https://example.com/outfit.png", "role": "reference_image"}
]
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "adaptive",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/voice.mp3", "role": "reference_audio"}
]
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "adaptive",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/voice.mp3", "role": "reference_audio"}
],
},
)
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-H3",
prompt: "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
duration: 5,
resolution: "2K",
aspect_ratio: "adaptive",
image_with_roles: [
{url: "https://example.com/person.png", role: "reference_image"}
],
video_with_roles: [
{url: "https://example.com/motion.mp4", role: "reference_video"}
],
audio_with_roles: [
{url: "https://example.com/voice.mp3", role: "reference_audio"}
]
})
});
console.log(await response.json());
{
"id": "vid_01KZ3H3EXAMPLE00000000000",
"object": "generation.task",
"model": "MiniMax-H3",
"status": "queued",
"progress": 0,
"created_at": 1785729000
}
MiniMax-H3
MiniMax Hailuo H3 视频生成
使用 MiniMax Hailuo H3 生成 2K 视频,支持文生视频、首尾帧图生视频和多模态参考生视频
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-H3",
"prompt": "一名宇航员站在月球边缘眺望蓝色地球,镜头缓慢推进",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "女孩从童年自然成长为青年,镜头平稳推进,保持人物身份一致",
"duration": 5,
"resolution": "2K",
"image_with_roles": [
{"url": "https://example.com/start.jpg", "role": "first_frame"},
{"url": "https://example.com/end.jpg", "role": "last_frame"}
]
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物和图片2中的服装设计,让角色走过雨夜街道",
"duration": 6,
"resolution": "2K",
"aspect_ratio": "9:16",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"},
{"url": "https://example.com/outfit.png", "role": "reference_image"}
]
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "adaptive",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/voice.mp3", "role": "reference_audio"}
]
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "adaptive",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/voice.mp3", "role": "reference_audio"}
],
},
)
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-H3",
prompt: "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
duration: 5,
resolution: "2K",
aspect_ratio: "adaptive",
image_with_roles: [
{url: "https://example.com/person.png", role: "reference_image"}
],
video_with_roles: [
{url: "https://example.com/motion.mp4", role: "reference_video"}
],
audio_with_roles: [
{url: "https://example.com/voice.mp3", role: "reference_audio"}
]
})
});
console.log(await response.json());
{
"id": "vid_01KZ3H3EXAMPLE00000000000",
"object": "generation.task",
"model": "MiniMax-H3",
"status": "queued",
"progress": 0,
"created_at": 1785729000
}
- 模型名称固定为
MiniMax-H3 - 支持文生视频、首帧/尾帧图生视频,以及图片、视频、音频联合参考生成
- 输出分辨率固定为
2K,时长支持4-15秒 - 异步任务接口,提交后返回统一的
generation.task
请优先传入公网可访问的素材 URL。首尾帧模式与多模态参考模式互斥;参考音频不能单独使用,必须同时提供至少一张参考图或一段参考视频。
认证
string
必填
所有接口均需要使用 Bearer Token 认证。
Authorization: Bearer YOUR_API_KEY
请求参数
string
默认值:"MiniMax-H3"
必填
视频生成模型名称,固定为
MiniMax-H3。string
必填
视频内容描述,最多
7000 个字符。建议明确描述主体、动作、场景、镜头、风格和声音要求。integer
默认值:5
输出视频时长,支持
4-15 秒的整数值。string
默认值:"2K"
输出视频分辨率,当前仅支持
2K。string
默认值:"16:9"
输出视频宽高比。可选值:
21:9、16:9、4:3、1:1、3:4、9:16、adaptive。- 文生视频:默认
16:9,不能使用adaptive - 首帧/尾帧模式:始终按输入图片自适应,传入的具体比例会被忽略
- 多模态参考模式:默认
adaptive,也可指定具体比例
string[]
兼容模式下的图片 URL 数组。新接入建议优先使用
image_with_roles 明确图片用途。- 1 张图片:作为
first_frame - 2 张图片:依次作为
first_frame和last_frame - 3-9 张图片:作为
reference_image
不要同时传入
image_urls 和 image_with_roles,否则图片用途可能产生歧义。array
array
array
boolean
默认值:false
是否在生成视频中添加 AIGC 标识水印。
string
客户侧业务 ID,例如订单号或流水号。提交后可使用同一状态接口按该 ID 查询任务。
string
ToAPIs 标准任务完成回调地址。需先配置 Token URL 和签名密钥;详见 任务 Webhook。
输入模式
| 模式 | 输入 | aspect_ratio |
|---|---|---|
| 文生视频 | prompt | 具体比例,默认 16:9 |
| 首帧图生视频 | prompt + 1 张 first_frame | 自动使用 adaptive |
| 首尾帧图生视频 | prompt + first_frame + last_frame | 自动使用 adaptive |
| 多模态参考生视频 | prompt + 参考图片/视频/音频 | 默认 adaptive,可指定具体比例 |
- 参考图最多
9张 - 参考视频最多
3段 - 参考音频最多
3段 - 图片、视频、音频合计最多
12个文件 - 首尾帧角色不能与任意参考角色混用
请求示例
文生视频
{
"model": "MiniMax-H3",
"prompt": "史诗级太空歌剧院线预告,女舰长站在巨大观景窗前,舰队跃迁离去,电影级光影",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}
首尾帧图生视频
{
"model": "MiniMax-H3",
"prompt": "女孩从童年自然成长为青年,镜头平稳推进,保持人物身份一致",
"duration": 5,
"resolution": "2K",
"image_with_roles": [
{"url": "https://example.com/start.jpg", "role": "first_frame"},
{"url": "https://example.com/end.jpg", "role": "last_frame"}
]
}
多参考图生成
{
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物和图片2中的服装设计,让角色走过雨夜街道",
"duration": 6,
"resolution": "2K",
"aspect_ratio": "9:16",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"},
{"url": "https://example.com/outfit.png", "role": "reference_image"}
]
}
视频与音频联合参考
{
"model": "MiniMax-H3",
"prompt": "参考视频1的动作和镜头节奏,并使用音频1的音色完成角色对白",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "adaptive",
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/voice.mp3", "role": "reference_audio"}
]
}
响应
string
ToAPIs 任务 ID,用于查询任务状态。
string
对象类型,固定为
generation.task。string
本次请求使用的模型名称,固定为
MiniMax-H3。string
任务状态:
queued、in_progress、completed 或 failed。integer
任务进度百分比,范围
0-100。integer
任务创建时间的 Unix 时间戳(秒)。
提交成功后,使用 获取视频任务状态 轮询。任务完成时,视频 URL 位于
result.data[0].url。curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "一名宇航员站在月球边缘眺望蓝色地球,镜头缓慢推进",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "16:9"
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "女孩从童年自然成长为青年,镜头平稳推进,保持人物身份一致",
"duration": 5,
"resolution": "2K",
"image_with_roles": [
{"url": "https://example.com/start.jpg", "role": "first_frame"},
{"url": "https://example.com/end.jpg", "role": "last_frame"}
]
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物和图片2中的服装设计,让角色走过雨夜街道",
"duration": 6,
"resolution": "2K",
"aspect_ratio": "9:16",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"},
{"url": "https://example.com/outfit.png", "role": "reference_image"}
]
}'
curl --request POST \
--url https://toapis.com/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "adaptive",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/voice.mp3", "role": "reference_audio"}
]
}'
import requests
response = requests.post(
"https://toapis.com/v1/videos/generations",
headers={
"Authorization": "Bearer your-ToAPIs-key",
"Content-Type": "application/json",
},
json={
"model": "MiniMax-H3",
"prompt": "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
"duration": 5,
"resolution": "2K",
"aspect_ratio": "adaptive",
"image_with_roles": [
{"url": "https://example.com/person.png", "role": "reference_image"}
],
"video_with_roles": [
{"url": "https://example.com/motion.mp4", "role": "reference_video"}
],
"audio_with_roles": [
{"url": "https://example.com/voice.mp3", "role": "reference_audio"}
],
},
)
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-H3",
prompt: "保持图片1中的人物,参考视频1的动作和运镜,并使用音频1的音色完成角色对白",
duration: 5,
resolution: "2K",
aspect_ratio: "adaptive",
image_with_roles: [
{url: "https://example.com/person.png", role: "reference_image"}
],
video_with_roles: [
{url: "https://example.com/motion.mp4", role: "reference_video"}
],
audio_with_roles: [
{url: "https://example.com/voice.mp3", role: "reference_audio"}
]
})
});
console.log(await response.json());
{
"id": "vid_01KZ3H3EXAMPLE00000000000",
"object": "generation.task",
"model": "MiniMax-H3",
"status": "queued",
"progress": 0,
"created_at": 1785729000
}
⌘I