Skip to content

MiniMax H3 图生视频 ​

本页由 ModelFold 文档站根据上游官方 OpenAPI 文档同步生成。接口路径、参数、示例与官方保持一致;品牌与 API 域名已替换为 ModelFold。

接口 ​

POST /jobs/createTask

完整 URL: https://ai.modelfold.online/v1/jobs/createTask

鉴权:所有请求都需要 Authorization: Bearer <API_KEY> 请求头。

输出视频带与画面同步生成的立体声音轨,可在提示词中描述对白、音乐、音效。音频无法关闭。

查询任务状态 ​

    提交任务后,可通过统一的查询接口查看任务进度并获取结果:

    - [Get Task Details](/market/common/get-task-detail) — 了解如何查询任务状态并获取生成结果

TIP

生产环境中,建议使用 callBackUrl 参数接收生成完成的自动通知,而非轮询状态接口。

    ## 相关资源

    
      - [Market Overview](/market/quickstart) — 浏览所有可用模型
      - [Common API](/common-api/get-account-credits) — 查看账户积分与使用情况

请求参数 ​

请求体 (application/json) ​

参数类型必填说明
modelstring是生成任务的模型名称。用于 MiniMax H3 图生视频。 默认值:"minimax-h3/image-to-video"。 可选值:minimax-h3/image-to-video。 示例:minimax-h3/image-to-video。
callBackUrlstring否任务完成后的回调地址。
input`stringstring`是
  input.promptstring是视频生成提示词,长度为 1 至 7000 个字符。 示例:让画面中的人物自然地转身并微笑,镜头缓慢向前推进。
  input.first_frame_urlstring否首帧图片 URL。注意:首尾帧必须二选一。可公开访问的 HTTP(S) 地址;支持 JPG、JPEG、PNG、WEBP、HEIC、HEIF 格式;单张图片不超过 30 MB,图片边长需在 256 至 5760 像素之间,宽高比需在 0.4 至 2.5 之间。 示例:https://example.com/first-frame.jpg。
  input.last_frame_urlstring否尾帧图片 URL,可选,可单独传,图片限制同 first_frame_url。首帧、尾帧至少传一个。 示例:https://example.com/last-frame.jpg。
  input.durationinteger是生成视频时长,支持 4 至 15 秒的整数值。 默认值:6。 可选值:4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15。 示例:6。
  input.resolutionstring否视频分辨率。 默认值:"2K"。 可选值:768P / 2K。 示例:2K。

请求示例 ​

bash
curl -X POST "https://ai.modelfold.online/v1/jobs/createTask" \
  -H "Authorization: Bearer $MODELFOLD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "minimax-h3/image-to-video",
  "callBackUrl": "https://example.com/callback",
  "input": {
    "prompt": "让画面中的人物自然地转身并微笑,镜头缓慢向前推进",
    "first_frame_url": "https://example.com/first-frame.jpg",
    "last_frame_url": "https://example.com/last-frame.jpg",
    "duration": 6
  }
}'
json
{
  "model": "minimax-h3/image-to-video",
  "callBackUrl": "https://example.com/callback",
  "input": {
    "prompt": "让画面中的人物自然地转身并微笑,镜头缓慢向前推进",
    "first_frame_url": "https://example.com/first-frame.jpg",
    "last_frame_url": "https://example.com/last-frame.jpg",
    "duration": 6
  }
}

响应 ​

200 — 请求成功 ​

参数类型必填说明
codeinteger是请求状态码。请求失败时 HTTP 状态仍为 200,请始终以本字段判断:200 表示成功,其他值均表示失败,原因见 msg。常见值:401 API key 无效或缺失;402 积分不足;429 超出频率限制;422 或 500 请求未能处理(请先查看 msg、检查参数,再决定是否重试)。 可选值:200 / 401 / 402 / 404 / 422 / 429 / 433 / 455 / 500 / 501 / 505。 示例:200。
msgstring是响应消息,失败时的错误描述
dataobject是—
  data.taskIdstring是可以使用任务 ID 与“获取任务详细信息”端点一起查询任务状态。
json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_bytedance_1765186743319"
  }
}

回调 ​

videoTaskCompleted ​

回调地址:{request.body#/callBackUrl}(即请求体里的 callBackUrl)。

当 minimax-h3/image-to-video 任务成功或失败时,系统会发送此回调。

回调体参数

参数类型必填说明
codeinteger是统一回调状态码:成功为 200,失败为 501。 可选值:200 / 501。 示例:200。
msgstring是统一回调消息。 可选值:Playground task completed successfully. / Playground task failed.。 示例:Playground task completed successfully.。
dataobject是—
  data.taskIdstring是任务唯一标识符。
  data.modelstring是任务使用的模型。 可选值:minimax-h3/image-to-video。 示例:minimax-h3/image-to-video。
  data.statestring是任务最终状态。 可选值:success / fail。 示例:success。
  data.paramstring是包含已提交任务参数的 JSON 字符串。
  data.resultJsonstring否任务成功时,包含 resultUrls、firstFrameUrl、lastFrameUrl 或 resultObject 的 JSON 字符串;任务。仅在 state 为 success 时出现。
  data.failCodestring否失败码,数字字符串,如 "400"、"500"。仅在 state 为 fail 时出现。
  data.failMsgstring否失败原因,仅在 state 为 fail 时出现。
  data.costTimeinteger否处理耗时(秒),成功和失败回调都会返回。
  data.completeTimeinteger否任务完成时间戳。
  data.createTimeinteger否任务创建时间戳。
  data.updateTimeinteger否完成时间请以 completeTime 为准;updateTime 可能与 createTime 相同。
  data.creditsConsumednumber否本任务消耗的积分;失败任务为 0。

任务成功完成

json
{
  "code": 200,
  "msg": "Playground task completed successfully.",
  "data": {
    "taskId": "task_example_video_webhook_001",
    "model": "minimax-h3/image-to-video",
    "state": "success",
    "param": "{\"input\":\"{\\\"prompt\\\":\\\"Let the character in the scene turn around naturally and smile, camera slowly pushing forward\\\",\\\"first_frame_url\\\":\\\"https://example.com/input-image.jpg\\\",\\\"last_frame_url\\\":\\\"https://example.com/input-image.jpg\\\",\\\"duration\\\":6}\",\"callBackUrl\":\"https://example.com/callback\",\"model\":\"minimax-h3/image-to-video\"}",
    "resultJson": "{\"resultUrls\":[\"https://example.com/generated-video.mp4\"]}",
    "costTime": 12,
    "completeTime": 1234567890,
    "createTime": 1234560000,
    "updateTime": 1234567890,
    "creditsConsumed": 1.23
  }
}

任务失败

json
{
  "code": 501,
  "msg": "Playground task failed.",
  "data": {
    "taskId": "task_example_video_webhook_001",
    "model": "minimax-h3/image-to-video",
    "state": "fail",
    "param": "{\"input\":\"{\\\"prompt\\\":\\\"Let the character in the scene turn around naturally and smile, camera slowly pushing forward\\\",\\\"first_frame_url\\\":\\\"https://example.com/input-image.jpg\\\",\\\"last_frame_url\\\":\\\"https://example.com/input-image.jpg\\\",\\\"duration\\\":6}\",\"callBackUrl\":\"https://example.com/callback\",\"model\":\"minimax-h3/image-to-video\"}",
    "failCode": "400",
    "failMsg": "<error detail>",
    "costTime": 12,
    "creditsConsumed": 0
  }
}

ModelFold — 一个 API,接入所有主流 AI 模型。