跳到导航

MiniMax H3 Normal

以 Markdown 格式查看

通过文本、一两帧画面,或最多 4 张图片和 1 段视频作为参考,生成带声音的 480p、768p 或 1080p 的 5–15 秒视频,价格比 minimax-h3 低约三分之一。

  • 异步:创建调用返回任务 ID,任务成功后即可获得视频。Normal 的渲染比 Fast 更慢。
  • 768p 下价格比 minimax-h3 低三分之一,除 768p 外还提供 480p 和 1080p。
  • 每段视频都带有生成的声音;没有关闭声音的字段,也不支持音频输入。
  • 四种输入方式:仅文本、首帧、首尾帧,或最多 4 张参考图片和 1 段参考视频。seed 可选。
  • 按视频秒数计费。失败的任务不收费。
POST/v1/videos/tasks试一试

在调试窗口里打开本模型,填入你的 BeatAPI API 密钥即可创建任务。调用是真实的,费用从你自己的余额中扣除。

模型 ID

五个 MiniMax H3 模型共用这个端点,但输入各不相同。下面的取值直接来自网关契约。

模型 IDduration(秒)resolution参考图片上限参考视频上限参考音频上限适用场景
minimax-h34–30480p, 768p, 1080p, 2K933你要标准通道、单价更低;输入与 minimax-h3-fast 相同。
minimax-h3-fast4–30480p, 768p, 1080p, 2K933你要优先通道、出片更快,单价是 minimax-h3 的两倍;输入相同。
minimax-h3-normal5–15480p, 768p, 1080p41—价格最重要且可以接受更久的等待:渲染较慢,768p 下价格比 minimax-h3 低三分之一,增加 seed,但参考素材更少(不支持音频)。
minimax-h3-max5–15480p, 768p, 1080p———从文本或一两帧画面出发,需要 480p、768p 或 1080p 和 seed;不接受参考输入,也没有 aspect_ratio。
minimax-h3-max-turbo5–15480p, 768p, 1080p———输入和分辨率与 minimax-h3-max 相同,挂牌价为其一半。

接口与鉴权

POST https://api.beatapi.io/v1/videos/tasks

Authorization

string · 必需

你的 BeatAPI API 密钥,以 Bearer <BEATAPI_API_KEY> 形式发送。在控制台创建密钥。密钥只能保存在你的服务端,不要放进浏览器或移动端应用。

请求体使用 JSON,并设置 Content-Type: application/json。Idempotency-Key 为可选:每个逻辑请求发送一个唯一值(最长 255 个字符),仅在重试完全相同的请求体时复用。24 小时内,用相同的键和请求体重试会再次返回第一次的响应,并带上 Idempotent-Replayed: true;相同的键搭配不同的请求体则返回 409 idempotency_conflict。非 2xx 的响应不会被保存,因此 400 或 402 之后的重试会重新执行。

请求流程

  1. 创建任务 向接口 POST 下方的参数。返回 201 表示任务已被接受,其价格已从你的余额中预留;任务在后台运行。保存 data.id。
  2. 等待任务完成 调用 GET /v1/tasks/{task_id},两次调用之间等待 data.poll_after_seconds 秒(图片 5 秒,视频 8 秒),直到 status 为 succeeded 或 failed。也可以为 task.succeeded 和 task.failed 注册 Webhook;仍需保留轮询作为兜底,因为因处理超时而终止的任务不会发送事件。
  3. 保存结果 状态为 succeeded 时,下载每个 data.output.media[].url 并保存你需要的文件;BeatAPI 不承诺结果链接的保留时长。状态为 failed 时,读取 data.error_code 和 data.error_message:预扣的金额已退回你的余额,data.retryable 表示再次发送相同请求是否可能成功。

输入模式

模式必填输入说明
文本生成视频model、prompt不要传媒体数组。
首帧model、prompt、images(1 个链接)视频从该图片开始。请传与图片匹配的 aspect_ratio。
首尾帧model、prompt、images(2 个链接)images[0] 是首帧,images[1] 是尾帧。
参考model、prompt,以及 reference_images、reference_videos 中至少一个最多 4 张图片和 1 段视频。不能与 images 同时使用。不支持参考音频。

请求参数

model

string · 必需

要运行的模型。

取值:minimax-h3-normal

取值有误时

  • 缺失:"model" is required
  • 把图片模型发到了这个端点:"model" nano-banana-2 is served by POST /v1/images/tasks, not this endpoint

prompt

string · 必需

视频中发生的内容:主体、动作、运镜、风格和声音。使用参考素材时,请说明每个输入的用途。

长度:1–5000 个字符

  • 长度按字符计算(一个中日韩字符算一个)。
  • 按位置引用输入,例如“第一张参考图片”。

取值有误时

  • 缺失:"prompt" is required
  • 为空或超过上限:"prompt" has an unsupported length

images

string[] · 可选

一个首帧,或一个首帧加一个尾帧。

数量:1–2
每一项都必须是公网 https:// 链接。本地文件请先上传(POST /v1/files),再传入返回的 data.url。

  • 一个链接:视频从这张图片开始。两个链接:images[0] 是首帧,images[1] 是尾帧。
  • 如果图片只是用来引导视频、而不是作为帧,请改用 reference_images。

取值有误时

  • 超过两个链接:"images" accepts at most 2 items
  • 与任何 reference_* 字段同时使用:Cannot combine "images" with reference inputs in one task
  • 不是 https:// 链接:"images[0]" must be a public HTTPS URL

reference_images

string[] · 可选

用来引导视频内容、角色、产品或风格的图片。

数量:1–4
每一项都必须是公网 https:// 链接。本地文件请先上传(POST /v1/files),再传入返回的 data.url。

  • 在提示词中按位置引用它们。

取值有误时

  • 超过上限:"reference_images" accepts at most 4 items
  • 与 images 同时使用:Cannot combine "images" with reference inputs in one task

reference_videos

string[] · 可选

用来借鉴动作、运镜或内容的一段视频。

数量:1–1
每一项都必须是公网 https:// 链接。本地文件请先上传(POST /v1/files),再传入返回的 data.url。

  • 最长 15 秒,帧率为 23.976 到 60 帧每秒;详见下方限制。
  • 参考视频的长度不会改变价格。

取值有误时

  • 超过一个链接:"reference_videos" accepts at most 1 items
  • 超过上限:The reference videos run 20 seconds in total; this model takes at most 15.
  • 帧率超出限制:reference_videos[0] runs at 12 frames per second; this model takes 23.976 to 60.

duration

integer · 可选 · 默认值: 5

视频长度,单位为秒,须为整数。

默认值:5
范围:5–15

  • 不传则使用 5。
  • 价格随该值变化(见计费)。

取值有误时

  • 超出范围或不是整数:"duration" is outside its supported range

aspect_ratio

string · 可选 · 默认值: 16:9

视频的宽高比,格式为 宽:高。

可选值:16:9, 9:16, 1:1, 4:3, 3:4, 21:9
默认值:16:9

  • 不传则使用 16:9。传了 images 或参考素材时也会照样发送这个默认值,所以请让 aspect_ratio 与输入匹配(例如竖版画面用 9:16)。
  • 该模型不支持 adaptive,请传固定比例。

取值有误时

  • 值不在列表中(例如 adaptive):"aspect_ratio" must be one of: [16:9 9:16 1:1 4:3 3:4 21:9]

resolution

string · 可选 · 默认值: 768p

输出分辨率。分辨率越高,每秒价格越高。

可选值:480p, 768p, 1080p
默认值:768p

  • Normal 不提供 2K 和 4K;需要 2K 请使用 minimax-h3-fast。

取值有误时

  • 值不在列表中(例如 2K 或 4K):"resolution" must be one of: [480p 768p 1080p]

seed

integer · 可选

用于固定生成的随机种子。不传则使用随机种子。

范围:0–4294967295

  • 从 0 到 4294967295 的整数。

取值有误时

  • 超出范围或不是整数:"seed" is outside its supported range

callback_url

string · 可选

任务成功或失败时通知的地址:公网 HTTPS URL,协议、主机和端口必须与你某个已启用的 Webhook 端点相同,并由该端点的 secret 签名。

长度:≤ 2048 个字符

  • 请先用 POST /v1/webhooks 注册端点。BeatAPI 会推送 task.succeeded 或 task.failed,事件体、请求头和重试规则与账户 Webhook 相同;订阅了该事件的账户端点也会收到,与该端点地址完全相同时只通知一次。
  • 签名端点被删除、停用或改到别的主机后,这条回调作废。

取值有误时

  • 值不是字符串:"callback_url" must be a string.
  • 地址超过 2048 个字符:"callback_url" must be at most 2048 characters.
  • 不是 URL,或没有主机、没有 http 或 https 协议:"callback_url" must be a valid https URL.
  • 使用了 http,或指向私有等非公网地址:"callback_url" must be a public HTTPS URL.
  • 没有任何已启用的 Webhook 端点与之协议、主机和端口相同:"callback_url" must be on the host of one of your active webhook endpoints, whose secret signs it; register one with POST /v1/webhooks.

网关还会在创建任务之前检查以下组合:

  • images 不能与参考素材字段同时使用。
  • Normal 的生成速度更慢,768p 的价格比 minimax-h3 低三分之一;只支持 480p、768p 和 1080p。
  • 参考模式最多接受 4 张图片和 1 段视频,不接受参考音频;生成的视频包含原生音频。

输入素材限制

网关会在创建任务之前读取每一项输入,超出这些限制的输入会被拒绝,并返回点名该输入的 400 bad_request。不扣费。

素材创建任务前检查的限制
图片宽和高均为 256–5760 像素;宽高比(宽 ÷ 高)0.4–2.5
视频合计不超过 15 秒;23.976–60 FPS
  • 这些限制适用于 images 和 reference_images(图片)以及 reference_videos(视频)。该模型不接受参考音频,因此音频一行不适用。
  • 各输入按 images、reference_images、reference_videos 的顺序逐个检查;单个输入按长度、边长、宽高比、帧率的顺序检查,所有参考视频的总时长最后检查。报错信息会按列表名和位置指出对应输入,位置与字段报错一样从 0 开始计数:images[0] is 200x200 pixels; this model takes images 256 to 5760 pixels on each side.
  • 时长按 0.1 秒的容差测量。尺寸只在托管方返回相关信息时才会检查。
  • 只有当链接所在主机返回 HTTP 4xx 错误或返回空文件时,才会在创建时被拒绝,例如 reference_videos[0] could not be downloaded: the URL returned HTTP 404.;输入的其他问题会在提交之后才显现,并导致任务失败(全额退款)。
  • 手头只有本地文件?请用 POST /v1/files 上传,并传入返回的 data.url。

声音与本模型不接受的字段

每段视频都带有生成的声音。没有 generate_audio 字段,也没有音频输入。

传入模型不接受的字段会在扣费之前被拒绝,而不是被忽略:

  • reference_audios、generate_audio、watermark、quality、sound,以及其他视频模型的任何字段 → field "reference_audios" is not supported by model minimax-h3-normal(其中是你传入的字段名)。
  • 其他任何未知字段 → unknown field: <name>。

请求示例

cURL
curl --request POST \
--url https://api.beatapi.io/v1/videos/tasks \
--header "Authorization: Bearer $BEATAPI_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "minimax-h3-normal",
"prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys, distant bells",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "768p"
}'
Python
import os
import requests
response = requests.post(
"https://api.beatapi.io/v1/videos/tasks",
headers={"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}"},
json={
"model": "minimax-h3-normal",
"prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys, distant bells",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "768p"
},
timeout=60,
)
body = response.json()
if not response.ok:
raise RuntimeError(f"{response.status_code} {body['error']['code']}: {body['error']['message']}")
task = body["data"]
print(task["id"], task["status"])
JavaScript
const response = await fetch('https://api.beatapi.io/v1/videos/tasks', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.BEATAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
"model": "minimax-h3-normal",
"prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys, distant bells",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "768p"
}),
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status} ${body.error.code}: ${body.error.message}`);
console.log(body.data.id, body.data.status);

文本生成视频

一段带声音的 5 秒 768p 横屏视频。

curl --request POST \
--url https://api.beatapi.io/v1/videos/tasks \
--header "Authorization: Bearer $BEATAPI_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "minimax-h3-normal",
"prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys, distant bells",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "768p"
}'

首帧

视频从该图片开始;aspect_ratio 与其竖屏比例一致。

curl --request POST \
--url https://api.beatapi.io/v1/videos/tasks \
--header "Authorization: Bearer $BEATAPI_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "minimax-h3-normal",
"prompt": "The performer turns toward the camera as neon light sweeps across the stage",
"images": [
"https://cdn.beatapi.io/samples/neon-singer.png"
],
"duration": 5,
"aspect_ratio": "9:16",
"resolution": "768p"
}'

首尾帧

视频从第一张图片过渡到第二张,输出 1080p。

curl --request POST \
--url https://api.beatapi.io/v1/videos/tasks \
--header "Authorization: Bearer $BEATAPI_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "minimax-h3-normal",
"prompt": "The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot",
"images": [
"https://cdn.beatapi.io/samples/smart-bottle.png",
"https://cdn.beatapi.io/samples/neon-singer.png"
],
"duration": 6,
"aspect_ratio": "9:16",
"resolution": "1080p"
}'

图片参考加 seed

两张参考图片、固定的 seed 和最便宜的分辨率。

curl --request POST \
--url https://api.beatapi.io/v1/videos/tasks \
--header "Authorization: Bearer $BEATAPI_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "minimax-h3-normal",
"prompt": "The singer from the first reference image walks past the bottle from the second reference image, neon reflections, slow tracking shot",
"reference_images": [
"https://cdn.beatapi.io/samples/neon-singer.png",
"https://cdn.beatapi.io/samples/smart-bottle.png"
],
"duration": 5,
"aspect_ratio": "9:16",
"resolution": "480p",
"seed": 42
}'

图片与视频参考

请把视频链接换成你自己的 MP4 或 MOV,时长最长 15 秒,帧率 23.976 到 60 帧每秒。

curl --request POST \
--url https://api.beatapi.io/v1/videos/tasks \
--header "Authorization: Bearer $BEATAPI_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "minimax-h3-normal",
"prompt": "A product film: the bottle from the first reference image on a turntable, camera movement like the reference video",
"reference_images": [
"https://cdn.beatapi.io/samples/smart-bottle.png"
],
"reference_videos": [
"https://your-cdn.example.com/clips/source.mp4"
],
"duration": 8,
"resolution": "768p"
}'

响应

创建任务(201)

任务对象。任务成功之前 output 为 null。标注“运行中”的字段会在任务结束后消失。

{
"data": {
"id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
"object": "task",
"task_kind": "video",
"capability_id": "minimax-h3-normal",
"capability_version": 1,
"media_type": "video",
"model": "minimax-h3-normal",
"status": "queued",
"stage": "queued",
"created_at": 1791993600,
"updated_at": 1791993600,
"completed_at": null,
"poll_after_seconds": 8,
"output": null,
"usage": {
"credits_reserved": 0.1,
"credits_settled": 0,
"credits_refunded": 0,
"credits_charged": 0.1,
"billable_duration_seconds": 5
},
"request_id": "202611260732156684925978268d9d6yOLdMCKV",
"error_code": null,
"error_message": null
}
}
字段类型说明
data.idstring任务 ID:task_ 后接 32 位字母和数字。用于轮询以及匹配 Webhook 事件。
data.objectstring固定为 task。
data.task_kindstringimage 或 video。
data.capability_idstring你发送的模型 ID。
data.capability_versioninteger模型的契约版本,当前为 1。
data.media_typestringimage 或 video。
data.modelstring你发送的模型 ID(与 capability_id 相同)。
data.statusstringqueued、processing、succeeded 或 failed。只有后两个是终态。
data.stagestring与 status 相同;为旧版客户端保留。
data.created_atinteger任务创建时间,Unix 秒。
data.updated_atinteger最后一次变更时间,Unix 秒。
data.completed_atinteger | null任务结束时间,Unix 秒;运行中为 null。
data.poll_after_secondsinteger运行中:下一次轮询前需要等待的秒数(图片 5,视频 8)。
data.typical_secondsobject运行中且近期样本足够时出现:在最近的 window 内,根据 samples 个任务统计的完成时间 p50 和 p90,单位为秒。
data.outputobject | null任务结果;status 为 succeeded 之前为 null。见下方输出字段。
data.usage.credits_reservednumber创建任务时从你的余额中预扣的美元金额。
data.usage.credits_chargednumber该任务的费用(美元);失败的任务为 0。
data.usage.credits_settlednumber最终结算扣除的美元金额;任务成功时设置,否则为 0。
data.usage.credits_refundednumber退回你余额的美元金额;失败的任务在退款记录完成后等于预扣金额。
data.usage.billable_duration_secondsinteger仅视频:计价所依据的秒数。模型未上报时长时不出现。
data.request_idstring请求 ID。联系支持时请附上。
data.error_codestring | null失败码;任务未失败时为 null。
data.error_messagestring | null出了什么问题以及该改什么;任务未失败时为 null。

任务完成

GET /v1/tasks/{task_id} 返回 HTTP 200 和 status: "succeeded",结果在 data.output 中。

{
"data": {
"id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
"object": "task",
"task_kind": "video",
"capability_id": "minimax-h3-normal",
"capability_version": 1,
"media_type": "video",
"model": "minimax-h3-normal",
"status": "succeeded",
"stage": "succeeded",
"created_at": 1791993600,
"updated_at": 1791993690,
"completed_at": 1791993690,
"output": {
"media": [
{
"type": "video",
"url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4",
"mime_type": "video/mp4"
}
],
"url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4",
"r2_url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4"
},
"usage": {
"credits_reserved": 0.1,
"credits_settled": 0.1,
"credits_refunded": 0,
"credits_charged": 0.1,
"billable_duration_seconds": 5
},
"request_id": "202611260732156684925978268d9d6yOLdMCKV",
"error_code": null,
"error_message": null
}
}

输出字段

字段类型说明
output.mediaobject[]生成的文件;该模型为一段视频。
output.media[].typestring始终为 video。
output.media[].urlstring已存储视频的 HTTPS 链接。请下载并自行保存;不承诺保留期限。
output.media[].mime_typestring文件类型,例如 video/mp4。
output.urlstring主资产:视频链接。结果请读 output.url;media[] 列出全部产物。
output.r2_urlstringoutput.url 的旧名,值相同;请读 output.url。

任务失败

失败的任务在 GET /v1/tasks/{task_id} 上仍然是 HTTP 200:失败信息在响应体里。预扣金额会全额退回,因此不会扣费。

{
"data": {
"id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
"object": "task",
"task_kind": "video",
"capability_id": "minimax-h3-normal",
"capability_version": 1,
"media_type": "video",
"model": "minimax-h3-normal",
"status": "failed",
"stage": "failed",
"created_at": 1791993600,
"updated_at": 1791993690,
"completed_at": 1791993690,
"output": null,
"usage": {
"credits_reserved": 0.1,
"credits_settled": 0,
"credits_refunded": 0.1,
"credits_charged": 0,
"billable_duration_seconds": 5
},
"retryable": true,
"request_id": "202611260732156684925978268d9d6yOLdMCKV",
"error_code": "processing_failed",
"error_message": "The task failed during processing on our side. Retry; a failed task is refunded.",
"error": {
"code": "processing_failed",
"message": "The task failed during processing on our side. Retry; a failed task is refunded.",
"retryable": true
}
}
}
字段类型说明
data.error_codestringbad_request 和 content_policy_violation(需修改请求)之一,或 processing_unavailable、processing_timeout、processing_failed 和 result_transfer_failed(稍后重试)之一。见错误码。
data.error_messagestring一句话,指出问题和处理方式。
data.retryableboolean仅在任务失败时出现:为 true 表示再次发送相同请求可能成功。
data.errorobject仅失败的任务才有:code、message 和 retryable 合成一个对象,值与 data.error_code、data.error_message 和 data.retryable 相同。
data.usageobject退款记录完成后(通常就在任务失败的那一刻):credits_charged 和 credits_settled 为 0;credits_refunded 等于 credits_reserved。

完整示例

创建任务,按服务端给出的轮询提示等待,然后打印结果链接。请在环境变量中设置 BEATAPI_API_KEY 并安装 requests。

import os
import time
import uuid
import requests
API = "https://api.beatapi.io"
HEADERS = {"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}"}
def create_task(body: dict) -> dict:
# One Idempotency-Key per logical request: a retry with the same key cannot create a second task.
headers = {**HEADERS, "Idempotency-Key": str(uuid.uuid4())}
for attempt in range(3):
response = requests.post(f"{API}/v1/videos/tasks", headers=headers, json=body, timeout=60)
if response.status_code in (429, 503) and attempt < 2:
time.sleep(int(response.headers.get("Retry-After", 10)))
continue
break
try:
payload = response.json()
except ValueError: # an edge error page is not JSON
response.raise_for_status()
raise
if not response.ok:
error = payload["error"]
raise RuntimeError(f"{response.status_code} {error['code']}: {error['message']} (request_id={error.get('request_id')})")
return payload["data"]
def wait_for_task(task_id: str, timeout_seconds: int = 1800) -> dict:
deadline = time.monotonic() + timeout_seconds
while time.monotonic() < deadline:
response = requests.get(f"{API}/v1/tasks/{task_id}", headers=HEADERS, timeout=30)
if response.status_code == 429 or response.status_code >= 500:
time.sleep(int(response.headers.get("Retry-After", 10)))
continue
response.raise_for_status()
task = response.json()["data"]
if task["status"] in ("succeeded", "failed"):
return task
time.sleep(task.get("poll_after_seconds", 5))
raise TimeoutError(f"task {task_id} is still running; keep polling later")
task = create_task({
"model": "minimax-h3-normal",
"prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys, distant bells",
"duration": 5,
"aspect_ratio": "16:9",
"resolution": "768p"
})
print("created", task["id"])
task = wait_for_task(task["id"])
if task["status"] == "failed":
raise SystemExit(f"{task['error_code']}: {task['error_message']}")
for item in task["output"]["media"]:
print(item["url"])

计费

  • 按视频秒数计费:请求的 duration 乘以所选分辨率的费率。下方挂牌价按 8 秒计算,折合约每秒 0.0175(480p)、0.0175(480p)、0.02(768p)、$0.025(1080p)。
  • 768p 下比 minimax-h3 低三分之一(768p 每秒 0.03;‘minimax−h3−fast‘为0.03;`minimax-h3-fast` 为 0.06)。
  • 宽高比、参考素材的数量、seed 以及参考视频的长度都不会改变价格。
  • 价格在创建任务时预留;任务上的 usage.billable_duration_seconds 显示实际计费的秒数。
  • 失败的任务(包括提交后被内容审核拒绝的)会全额退款。

当前牌价,与价格页一致。享有协商折扣的账户实付更低;任务的 data.usage 始终显示实际扣费金额。

选项牌价(美元)
8 秒 · 480p$0.14
8 秒 · 768p$0.16
8 秒 · 1080p$0.2

常见错误

错误或现象原因处理方式
400 "resolution" must be one of: [480p 768p 1080p]传了 2K 或 4K:Normal 只有三档。传 480p、768p 或 1080p;需要 2K 请使用 minimax-h3-fast。
400 "aspect_ratio" must be one of: [16:9 9:16 1:1 4:3 3:4 21:9]传了 adaptive,该模型不接受。传固定比例,或不传该字段(默认 16:9)。
400 "duration" is outside its supported range不是 5 到 15 之间的整数,或以字符串形式传入。传入整数,例如 5。
400 field "reference_audios" is not supported by model minimax-h3-normalNormal 不支持音频输入(generate_audio 同理:声音始终开启)。删除该字段;需要音频参考请使用 minimax-h3-fast。
400 "reference_videos" accepts at most 1 itemsNormal 只接受一段参考视频(以及最多 4 张参考图片)。只传一段视频,或使用 minimax-h3-fast(最多 3 段)。
400 Cannot combine "images" with reference inputs in one task同一请求中同时使用了帧和 reference_*。帧和参考二选一。如果有多张图片,请全部放进 reference_images。
400 The reference videos run 20 seconds in total; this model takes at most 15.参考视频过长。裁剪视频。
400 "seed" is outside its supported rangeseed 为负数或小数,或大于 4294967295。传 0 到 4294967295 的整数,或不传 seed。
任务 failed,原因为 content_policy_violation提示词、某个输入或结果被内容审核拒绝。修改提示词或输入。原样重试仍会失败;不会收费。
402 insufficient_credits余额低于该请求预留的价格。充值,或降低 duration 或 resolution。

HTTP 错误速查

任务生成之前的错误会以非 2xx 响应返回,不扣费。请根据 error.code 或 error.retryable 判断处理方式;message 会指出问题所在。完整列表和重试策略见错误码。

{
"error": {
"code": "bad_request",
"message": "\"prompt\" is required",
"retryable": false,
"request_id": "202611260732156684925978268d9d6yOLdMCKV"
}
}
HTTP 状态码error.code处理方式
400bad_request, content_policy_violation修改请求;message 会点名出错的字段。不要原样重试。
401missing_api_key, invalid_api_key(旧版客户端可能看到 unauthorized)以 Authorization: Bearer <key> 发送有效的密钥。
402insufficient_credits充值,或提高密钥的额度,然后重新发送。
403forbidden该密钥或账户不能使用此模型(例如免费额度只覆盖部分模型)。不要原样重试。
404not_found在 GET /v1/tasks/{task_id} 上:该任务在此密钥所属账户下不存在。请检查 ID。
409idempotency_conflict换一个新的 Idempotency-Key,或等待使用该键的第一个请求完成。
429rate_limit_exceeded等待 Retry-After 秒(也见 error.retry_after_seconds)后重试。
500internal_error退避重试;若持续出现,请带上 request_id 联系支持。
503processing_unavailable, processing_timeout, processing_failed, result_transfer_failed未扣费。使用指数退避重试。

身份验证

AuthorizationBearer

通过 Authorization: Bearer <BEATAPI_API_KEY> 发送 API 密钥。

请求头

Idempotency-Keystring可选<=255 characters

请求体使用 JSON,并设置 Content-Type: application/json。Idempotency-Key 为可选:每个逻辑请求发送一个唯一值(最长 255 个字符),仅在重试完全相同的请求体时复用。24 小时内,用相同的键和请求体重试会再次返回第一次的响应,并带上 Idempotent-Replayed: true;相同的键搭配不同的请求体则返回 409 idempotency_conflict。非 2xx 的响应不会被保存,因此 400 或 402 之后的重试会重新执行。

请求

This endpoint expects an object.
modelenum必需

要运行的模型。

取值:minimax-h3-normal

取值有误时

  • 缺失:"model" is required
  • 把图片模型发到了这个端点:"model" nano-banana-2 is served by POST /v1/images/tasks, not this endpoint
允许的值:
promptstring必需1-5000 characters

视频中发生的内容:主体、动作、运镜、风格和声音。使用参考素材时,请说明每个输入的用途。

长度:1–5000 个字符

  • 长度按字符计算(一个中日韩字符算一个)。
  • 按位置引用输入,例如“第一张参考图片”。

取值有误时

  • 缺失:"prompt" is required
  • 为空或超过上限:"prompt" has an unsupported length
aspect_ratioenum可选默认为 16:9

视频的宽高比,格式为 宽:高。

可选值:16:9, 9:16, 1:1, 4:3, 3:4, 21:9

默认值:16:9

  • 不传则使用 16:9。传了 images 或参考素材时也会照样发送这个默认值,所以请让 aspect_ratio 与输入匹配(例如竖版画面用 9:16)。
  • 该模型不支持 adaptive,请传固定比例。

取值有误时

  • 值不在列表中(例如 adaptive):"aspect_ratio" must be one of: [16:9 9:16 1:1 4:3 3:4 21:9]
durationinteger可选5-15默认为 5

视频长度,单位为秒,须为整数。

默认值:5

范围:5–15

  • 不传则使用 5。
  • 价格随该值变化(见计费)。

取值有误时

  • 超出范围或不是整数:"duration" is outside its supported range
imageslist of strings可选

一个首帧,或一个首帧加一个尾帧。

数量:1–2

每一项都必须是公网 https:// 链接。本地文件请先上传(POST /v1/files),再传入返回的 data.url。

  • 一个链接:视频从这张图片开始。两个链接:images[0] 是首帧,images[1] 是尾帧。
  • 如果图片只是用来引导视频、而不是作为帧,请改用 reference_images。

取值有误时

  • 超过两个链接:"images" accepts at most 2 items
  • 与任何 reference_* 字段同时使用:Cannot combine "images" with reference inputs in one task
  • 不是 https:// 链接:"images[0]" must be a public HTTPS URL
reference_imageslist of strings可选

用来引导视频内容、角色、产品或风格的图片。

数量:1–4

每一项都必须是公网 https:// 链接。本地文件请先上传(POST /v1/files),再传入返回的 data.url。

  • 在提示词中按位置引用它们。

取值有误时

  • 超过上限:"reference_images" accepts at most 4 items
  • 与 images 同时使用:Cannot combine "images" with reference inputs in one task
reference_videoslist of strings可选

用来借鉴动作、运镜或内容的一段视频。

数量:1–1

每一项都必须是公网 https:// 链接。本地文件请先上传(POST /v1/files),再传入返回的 data.url。

  • 最长 15 秒,帧率为 23.976 到 60 帧每秒;详见下方限制。
  • 参考视频的长度不会改变价格。

取值有误时

  • 超过一个链接:"reference_videos" accepts at most 1 items
  • 超过上限:The reference videos run 20 seconds in total; this model takes at most 15.
  • 帧率超出限制:reference_videos[0] runs at 12 frames per second; this model takes 23.976 to 60.
resolutionenum可选默认为 768p

输出分辨率。分辨率越高,每秒价格越高。

可选值:480p, 768p, 1080p

默认值:768p

  • Normal 不提供 2K 和 4K;需要 2K 请使用 minimax-h3-fast。

取值有误时

  • 值不在列表中(例如 2K 或 4K):"resolution" must be one of: [480p 768p 1080p]
允许的值:
seedinteger可选0-4294967295

用于固定生成的随机种子。不传则使用随机种子。

范围:0–4294967295

  • 从 0 到 4294967295 的整数。

取值有误时

  • 超出范围或不是整数:"seed" is outside its supported range
callback_urlstring可选<=2048 characters

任务成功或失败时通知的地址:公网 HTTPS URL,协议、主机和端口必须与你某个已启用的 Webhook 端点相同,并由该端点的 secret 签名。

长度:≤ 2048 个字符

  • 请先用 POST /v1/webhooks 注册端点。BeatAPI 会推送 task.succeeded 或 task.failed,事件体、请求头和重试规则与账户 Webhook 相同;订阅了该事件的账户端点也会收到,与该端点地址完全相同时只通知一次。
  • 签名端点被删除、停用或改到别的主机后,这条回调作废。

取值有误时

  • 值不是字符串:"callback_url" must be a string.
  • 地址超过 2048 个字符:"callback_url" must be at most 2048 characters.
  • 不是 URL,或没有主机、没有 http 或 https 协议:"callback_url" must be a valid https URL.
  • 使用了 http,或指向私有等非公网地址:"callback_url" must be a public HTTPS URL.
  • 没有任何已启用的 Webhook 端点与之协议、主机和端口相同:"callback_url" must be on the host of one of your active webhook endpoints, whose secret signs it; register one with POST /v1/webhooks.

响应

任务对象。任务成功之前 output 为 null。标注“运行中”的字段会在任务结束后消失。

dataobject
Accepted or current BeatAPI task state.

错误

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
409
Conflict Error
429
Too Many Requests Error
500
Internal Server Error
503
Service Unavailable Error