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