MiniMax H3
MiniMax H3 是原生多模态视频模型,支持文生视频、首尾帧视频,以及使用图片、视频和音频的多模态参考生成。通过 AI Video API 的统一异步任务接口,可生成 4–15 秒、768p 或 2K 视频。
模型
使用模型名 minimax-h3 调用:
POST https://api.aivideoapi.ai/v1/videos/generations
计费
| 分辨率 | 输出视频 | 输入参考视频 |
|---|---|---|
2k | 34 积分/秒 | 34 积分/秒 |
768p | 22 积分/秒 | 22 积分/秒 |
- 前 5 张输入图片免费,第 6 张起每张 9 积分。
- 参考音频免费。
- 服务端会探测所有参考视频的合计时长,合计后向上取整并计费。
- 创建任务时预扣积分;生成失败会全额退款。
例如,默认 5 秒 2K 文生视频消耗 170 积分。5 秒 2K 输出加 12 秒参考视频消耗 (5 + 12) × 34 = 578 积分。
请求体
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
model | string | 是 | 固定为 minimax-h3 |
input | object | 是 | 下表中的生成参数 |
callback_url | string | 否 | 接收平台任务完成或失败通知的回调地址 |
Input 参数
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
prompt | string | 是 | 非空视频提示词,最长 7000 字符 |
generation_type | string | 否 | omni_reference(默认)或 first_and_last_frames |
image_urls | string[] | 否 | 公网 HTTP(S) 图片 URL;参考模式最多 9 张,首尾帧模式 1–2 张 |
video_urls | string[] | 否 | 最多 3 个公网 MP4/MOV URL;每段 2–15 秒,合计不超过 15 秒 |
audio_urls | string[] | 否 | 最多 3 个公网 MP3/WAV URL;不可作为唯一参考素材 |
resolution | string | 否 | 2k(默认)或 768p |
duration | integer | 否 | 输出时长 4–15 秒,默认 5 |
aspect_ratio | string | 否 | adaptive、21:9、16:9、4:3、1:1、3:4、9:16 |
watermark | boolean | 否 | 是否添加 MiniMax AIGC 水印,默认 false |
本接口只接受公网 HTTP(S) 素材 URL,不支持 mm_file:// 和 Data URI。
生成模式
文生视频
不传任何媒体数组即可。宽高比默认 16:9;纯文生视频不能使用 adaptive。
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-h3",
"input": {
"prompt": "史诗级太空歌剧预告,女舰长望着最后一支舰队跃迁离去",
"resolution": "2k",
"duration": 5,
"aspect_ratio": "16:9"
}
}'
首尾帧视频
将 generation_type 设为 first_and_last_frames。image_urls[0] 是首帧,可选的 image_urls[1] 是尾帧。该模式不能混用视频或音频参考,输出比例跟随输入帧图片。
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-h3",
"input": {
"prompt": "镜头缓缓向前推进,晨光逐渐照亮整个房间",
"generation_type": "first_and_last_frames",
"image_urls": [
"https://example.com/first.png",
"https://example.com/last.png"
],
"resolution": "2k",
"duration": 5
}
}'
多模态参考视频
使用 omni_reference 组合参考图片、视频和音频。音频必须同时配合至少一张参考图片或一个参考视频。不传 aspect_ratio 时默认使用 adaptive。
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax-h3",
"callback_url": "https://your-server.com/webhook",
"input": {
"prompt": "角色使用参考音色说:随风而行,自由生活",
"generation_type": "omni_reference",
"image_urls": ["https://example.com/character.png"],
"video_urls": ["https://example.com/motion.mp4"],
"audio_urls": ["https://example.com/voice.mp3"],
"resolution": "2k",
"duration": 5,
"aspect_ratio": "adaptive"
}
}'
任务生命周期
创建接口返回平台任务 ID:
{
"code": 200,
"msg": "success",
"data": {
"taskId": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24"
}
}
查询任务:
curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
-H "Authorization: Bearer sk-your-api-key"
状态流转为 pending → processing → completed 或 failed。成功结果使用统一的 output.urls 数组;MiniMax 的临时下载地址会在任务完成前转存到平台存储。
常见错误码
请求失败时,API 返回 JSON 格式的错误响应:
{
"error": {
"code": "insufficient_credits",
"message": "Your credit balance is too low. Please top up.",
"type": "billing_error"
}
}
错误码一览
| HTTP 状态码 | 错误码 | 类型 | 说明 |
|---|---|---|---|
| 400 | invalid_request | invalid_request_error | 缺少必填参数或参数无效 |
| 401 | invalid_api_key | authentication_error | API Key 无效、已禁用或已删除 |
| 402 | insufficient_credits | billing_error | 积分余额不足,请充值 |
| 403 | ip_not_allowed | permission_error | 请求 IP 不在 Key 的白名单中 |
| 404 | model_not_found | invalid_request_error | 模型不存在或已停用 |
| 404 | task_not_found | invalid_request_error | 任务 ID 不存在 |
| 429 | rate_limit_exceeded | rate_limit_error | 请求过于频繁,请降低频率 |
| 429 | spend_limit_exceeded | billing_error | 达到 Key 的消费限额(每小时/每天/总量) |
| 500 | internal_error | api_error | 服务器内部错误 |
| 503 | upstream_error | upstream_error | 上游 AI 服务返回错误 |
常见场景
invalid_request (400)
缺少必填字段或参数格式错误时返回。
{
"error": {
"code": "invalid_request",
"message": "'model' is required.",
"type": "invalid_request_error"
}
}
insufficient_credits (402)
积分不足。可通过 GET /v1/credits 查询余额,前往 Dashboard > Billing 充值。
invalid_api_key (401)
可能原因:
- Key 不以
sk-开头 - Key 已被禁用或删除
- 用户账户已被封禁
upstream_error (503)
上游 AI 服务返回错误,可能原因:
- 输入内容包含敏感或违规信息
- 上游服务暂时不可用
- 请求参数不被上游支持
因上游错误导致任务失败时,预扣积分会自动退还。