curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Lite",
"prompt": "镜头穿过夜晚的霓虹街道,雨滴落在车窗上。",
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}'
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "MiniMax-H3-Lite only supports resolution = 480P or 768P",
"type": "invalid_request_error"
}
}
MiniMax-H3
MiniMax-H3-Lite 视频生成
支持文生视频、首帧或首尾帧图生视频、多模态参考生视频。输出支持 480P 和 768P,时长为 4 到 15 秒。
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Lite",
"prompt": "镜头穿过夜晚的霓虹街道,雨滴落在车窗上。",
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}'
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "MiniMax-H3-Lite only supports resolution = 480P or 768P",
"type": "invalid_request_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Lite",
"prompt": "镜头穿过夜晚的霓虹街道,雨滴落在车窗上。",
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}'
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "MiniMax-H3-Lite only supports resolution = 480P or 768P",
"type": "invalid_request_error"
}
}
输出宽高比。也可以通过
size 或 ratio 传递。- 文生视频和多模态参考生视频可选
21:9、16:9、4:3、1:1、3:4、9:16,默认16:9。传adaptive或auto会返回 HTTP 400。 - 首帧或首尾帧图生视频按输入帧图比例输出。可省略该字段或传
adaptive。传其他合法比例时仍使用输入帧图比例。
参考音频的公网 HTTP(S) URL 数组。最多 3 段,每段 2 到 15 秒,合计不超过 15 秒。至少搭配一张参考图或一段参考视频。单段音频也可使用字符串字段
audio_url。输入素材要求
素材 URL 必须能从公网直接访问。尺寸范围适用于宽和高,比例按宽除以高计算。| 素材 | 格式与编码 | 单文件大小 | 尺寸、宽高比和帧率 |
|---|---|---|---|
| 图片 | JPG / JPEG / PNG / WEBP / HEIC / HEIF | ≤ 30 MB | 256–5760 px, 0.4–2.5 |
| 参考视频 | MP4 / MOV (H.264 / H.265, AAC / MP3) | ≤ 50 MB | 256–5760 px, 0.4–2.5, 23.976–60 fps |
| 参考音频 | WAV / MP3 | ≤ 15 MB | — |
请求示例
首帧图生视频
{
"model": "MiniMax-H3-Lite",
"prompt": "镜头缓缓推进,晨光逐渐照亮房间。",
"first_frame_image": "https://example.com/first.png",
"resolution": "480P",
"duration": 4
}
首尾帧图生视频
{
"model": "MiniMax-H3-Lite",
"prompt": "镜头从清晨自然过渡到夜晚,屋内灯光亮起。",
"image_with_roles": [
{
"url": "https://example.com/first.png",
"role": "first_frame"
},
{
"url": "https://example.com/last.png",
"role": "last_frame"
}
],
"resolution": "768P",
"duration": 5
}
多模态参考生视频
{
"model": "MiniMax-H3-Lite",
"prompt": "以参考图为角色形象,复现参考视频的动作,并用参考音色说出对白。",
"image_urls": [
"https://example.com/character.png"
],
"video_urls": [
"https://example.com/motion.mp4"
],
"audio_urls": [
"https://example.com/voice.mp3"
],
"resolution": "768P",
"duration": 5,
"aspect_ratio": "16:9"
}
查询任务
提交成功后,从data[0].task_id 获取任务 ID。通过查询任务状态每 5 到 10 秒轮询一次,客户端超时建议设为 15 分钟。
curl https://api.apimart.ai/v1/tasks/task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ \
--header 'Authorization: Bearer <token>'
data.status 为 completed 时,从 data.result.videos[0].url 数组获取视频地址。状态为 failed 时,查看 data.error.message。
实际扣费金额见 data.cost。
计费
费用按所选分辨率及输入素材计算。账户适用单价见模型价格查询接口。- 输出视频与参考视频使用同一档每秒单价。例如生成 5 秒视频并传入共 6 秒的参考视频,按 11 秒计费。
- 首帧、尾帧和参考图合计前 5 张免费,第 6 张起按张收费。
- 参考音频免费。
常见参数错误
以下情况会在提交时返回 HTTP 400,无需轮询,也不会扣费。- 分辨率或时长超出范围。使用
480P或768P,并将duration设为 4 到 15 的整数。 - 只传尾帧、混用帧图和参考素材,或只传参考音频。尾帧需搭配首帧,参考音频需搭配参考图或参考视频。
- 参考素材数量或参考视频时长超限。检查各素材上限并裁剪参考视频。
- 参考视频时长无法读取。检查 URL 是否可公网直连、视频文件是否有效。
model_not_found,检查模型 ID 是否精确写成 MiniMax-H3-Lite。