API ReferenceVideo APIs

MiniMax H3 API

ReachAPI 通过公开模型 ID minimax-h3 提供 MiniMax Hailuo-03,并使用统一异步视频任务接口。

  • 提交任务:POST /v1/vids/create
  • 查询任务:GET /v1/tasks/{task_id}
  • 执行方式:异步任务;轮询任务接口或提供 callback_url
  • 模型 ID:minimax-h3

认证

Authorization: Bearer YOUR_REACH_API_KEY
Content-Type: application/json

能力与价格

时长分辨率比例输入模式
415 秒整数2K768P21:916:94:31:13:49:16adaptive文本、首帧、首尾帧、多模态参考

必须显式传入 input.content,且至少包含一个非空文本项。网关不会把旧字段 promptimage_urlimage_urls 自动转换为 content。

计费项2K768P
输出视频$0.13 / 秒$0.08 / 秒
参考视频输入$0.13 / 秒$0.08 / 秒
输入图片前 5 张免费,第 6 张起 $0.04 / 张前 5 张免费,第 6 张起 $0.04 / 张
输入音频免费免费

任务成功后根据实际用量结算;参考视频输入使用请求输出分辨率对应的秒价。

提交任务

{
  "model": "minimax-h3",
  "callback_url": "https://your-domain.com/callback",
  "input": {
    "content": [
      {
        "type": "text",
        "text": "A paper boat drifts through a rainy street at night"
      }
    ],
    "duration_seconds": 6,
    "resolution": "2K",
    "aspect_ratio": "16:9"
  }
}

顶层参数

字段类型必填说明
modelstring固定为 minimax-h3
callback_urlstring任务终态 HTTPS 回调地址,最大 2048 字符,禁止本地或内网目标
inputobject视频生成参数

input 参数

字段类型必填说明
contentobject array非空显式输入,至少含一个非空文本项
resolutionstring2K768P
duration_secondsinteger415 之间的整数
aspect_ratiostring条件必填纯文本请求必填,规则见下文

码率、帧率以及视频和音频编码由平台决定,不能配置。 完整请求体不得超过 64 MB。

比例规则

输入模式规则
纯文本必填且不能是 adaptive,只能使用六种固定比例
首帧或首尾帧输出始终跟随输入图片比例;即使传入 aspect_ratio,该值也会被忽略
多模态参考模式可选;指定固定比例时会生效,省略或传 adaptive 时跟随参考素材比例

input.content

类型role上限说明
text至少一个非空文本项;每个文本项最多 7000 个字符
image_urlfirst_frame1起始画面;仅一张图片且省略 role 时按首帧处理
image_urllast_frame1结束画面
image_urlreference_image9主体或风格参考
video_urlreference_video3动作或镜头参考
audio_urlreference_audio3音频参考

URL 分别放在 image_url.urlvideo_url.urlaudio_url.url。视频必须使用 reference_video,音频必须使用 reference_audio

同一请求不能混用首尾帧输入与 reference_imagereference_videoreference_audio

支持四种模式:

  • 文生视频:text
  • 首帧图生视频:text + first_frame
  • 首尾帧:text + first_frame + last_frame
  • 多模态参考:text + 一个或多个 reference_*

多个素材按数组顺序在提示词中引用为 Image 1Image 2Video 1Audio 1,不要使用 Seedance 风格的 @ 引用。

输入素材要求

输入格式大小其他约束
图片JPG、JPEG、PNG、WEBP、HEIC、HEIF每张 ≤30 MB每边 256–5760 px,宽高比 0.4–2.5
参考视频MP4、MOV每个 ≤50 MB宽和高均为 256–5760 px;宽高比 0.4–2.5;H.264/H.265;AAC/MP3;单个 2–15 秒;总计 ≤15 秒;23.976–60 fps
参考音频WAV、MP3每个 ≤15 MB单个 2–15 秒,总计 ≤15 秒

素材 URL 必须能被上游服务端抓取。不支持 Base64、data: URI 或 mm_file:// 句柄。

请求示例

首帧图生视频

{
  "model": "minimax-h3",
  "input": {
    "content": [
      { "type": "text", "text": "The camera slowly pulls back" },
      {
        "type": "image_url",
        "role": "first_frame",
        "image_url": { "url": "https://cdn.example.com/start.jpg" }
      }
    ],
    "duration_seconds": 5,
    "resolution": "2K"
  }
}

首尾帧

{
  "model": "minimax-h3",
  "input": {
    "content": [
      {
        "type": "text",
        "text": "A smooth transition from close-up to wide shot"
      },
      {
        "type": "image_url",
        "role": "first_frame",
        "image_url": { "url": "https://cdn.example.com/start.jpg" }
      },
      {
        "type": "image_url",
        "role": "last_frame",
        "image_url": { "url": "https://cdn.example.com/end.jpg" }
      }
    ],
    "duration_seconds": 5,
    "resolution": "768P",
    "aspect_ratio": "adaptive"
  }
}

多模态参考

{
  "model": "minimax-h3",
  "input": {
    "content": [
      {
        "type": "text",
        "text": "Replace the person in Video 1 with Image 1 and synchronize the action to Audio 1"
      },
      {
        "type": "image_url",
        "role": "reference_image",
        "image_url": { "url": "https://cdn.example.com/person.png" }
      },
      {
        "type": "video_url",
        "role": "reference_video",
        "video_url": { "url": "https://cdn.example.com/motion.mp4" }
      },
      {
        "type": "audio_url",
        "role": "reference_audio",
        "audio_url": { "url": "https://cdn.example.com/beat.mp3" }
      }
    ],
    "duration_seconds": 5,
    "resolution": "2K"
  }
}

响应与轮询

提交响应:

{
  "code": 200,
  "msg": "",
  "status": "queued",
  "task_id": "task_xxx",
  "data": []
}

轮询 GET /v1/tasks/task_xxx,直到 statussuccessfailed

{
  "code": 200,
  "status": "success",
  "task_id": "task_xxx",
  "data": [{ "url": "https://cdn.example.com/generated/video-1.mp4" }],
  "cost": { "spend": 0.52 },
  "billing": [
    {
      "metric": "VIDEO_SECONDS",
      "quantity": 4,
      "unit": 1,
      "price": 130000,
      "amount": 520000,
      "conditions": { "resolution": "2K" }
    }
  ]
}

cost.spend 以美元展示,billing 是 credits 计费明细。结果 URL 可能过期,请及时转存。5 秒 / 2K 文生视频通常约需 3 分钟,请据此配置轮询。

错误

状态码说明
400字段缺失或非法、模式冲突、素材超限
401API Key 无效
402余额不足
422内容安全拦截
429限流,请退避重试
500 / 502模型或上游服务暂时不可用

失败任务会返回 status: "failed"error_code;未产生费用时 cost.spend0

On this page