MiniMax H3

MiniMax H3 是原生多模态视频模型,支持文生视频、首尾帧视频,以及使用图片、视频和音频的多模态参考生成。通过 AI Video API 的统一异步任务接口,可生成 4–15 秒、768p 或 2K 视频。

模型

使用模型名 minimax-h3 调用:

POST https://api.aivideoapi.ai/v1/videos/generations

计费

分辨率输出视频输入参考视频
2k34 积分/秒34 积分/秒
768p22 积分/秒22 积分/秒
  • 前 5 张输入图片免费,第 6 张起每张 9 积分。
  • 参考音频免费。
  • 服务端会探测所有参考视频的合计时长,合计后向上取整并计费。
  • 创建任务时预扣积分;生成失败会全额退款。

例如,默认 5 秒 2K 文生视频消耗 170 积分。5 秒 2K 输出加 12 秒参考视频消耗 (5 + 12) × 34 = 578 积分。

请求体

字段类型必填说明
modelstring固定为 minimax-h3
inputobject下表中的生成参数
callback_urlstring接收平台任务完成或失败通知的回调地址

Input 参数

字段类型必填说明
promptstring非空视频提示词,最长 7000 字符
generation_typestringomni_reference(默认)或 first_and_last_frames
image_urlsstring[]公网 HTTP(S) 图片 URL;参考模式最多 9 张,首尾帧模式 1–2 张
video_urlsstring[]最多 3 个公网 MP4/MOV URL;每段 2–15 秒,合计不超过 15 秒
audio_urlsstring[]最多 3 个公网 MP3/WAV URL;不可作为唯一参考素材
resolutionstring2k(默认)或 768p
durationinteger输出时长 4–15 秒,默认 5
aspect_ratiostringadaptive21:916:94:31:13:49:16
watermarkboolean是否添加 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_framesimage_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"

状态流转为 pendingprocessingcompletedfailed。成功结果使用统一的 output.urls 数组;MiniMax 的临时下载地址会在任务完成前转存到平台存储。


常见错误码

请求失败时,API 返回 JSON 格式的错误响应:

{
  "error": {
    "code": "insufficient_credits",
    "message": "Your credit balance is too low. Please top up.",
    "type": "billing_error"
  }
}

错误码一览

HTTP 状态码错误码类型说明
400invalid_requestinvalid_request_error缺少必填参数或参数无效
401invalid_api_keyauthentication_errorAPI Key 无效、已禁用或已删除
402insufficient_creditsbilling_error积分余额不足,请充值
403ip_not_allowedpermission_error请求 IP 不在 Key 的白名单中
404model_not_foundinvalid_request_error模型不存在或已停用
404task_not_foundinvalid_request_error任务 ID 不存在
429rate_limit_exceededrate_limit_error请求过于频繁,请降低频率
429spend_limit_exceededbilling_error达到 Key 的消费限额(每小时/每天/总量)
500internal_errorapi_error服务器内部错误
503upstream_errorupstream_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 服务返回错误,可能原因:

  • 输入内容包含敏感或违规信息
  • 上游服务暂时不可用
  • 请求参数不被上游支持

因上游错误导致任务失败时,预扣积分会自动退还。