MiniMax H3
curl --request POST \
--url https://api.ppio.com/v3/minimax/v2/video_generationimport requests
url = "https://api.ppio.com/v3/minimax/v2/video_generation"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.ppio.com/v3/minimax/v2/video_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/minimax/v2/video_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/minimax/v2/video_generation"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/minimax/v2/video_generation")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/minimax/v2/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body视频
MiniMax H3
POST
/
v3
/
minimax
/
v2
/
video_generation
MiniMax H3
curl --request POST \
--url https://api.ppio.com/v3/minimax/v2/video_generationimport requests
url = "https://api.ppio.com/v3/minimax/v2/video_generation"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.ppio.com/v3/minimax/v2/video_generation', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ppio.com/v3/minimax/v2/video_generation",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ppio.com/v3/minimax/v2/video_generation"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.ppio.com/v3/minimax/v2/video_generation")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ppio.com/v3/minimax/v2/video_generation")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_body参数及使用方式已对齐官方,详细参数可直接参考官方文档。
三种能力共用同一个查询接口:
其中 {api_domain} 为平台为您提供的 API 域名,{task_id} 为创建任务接口返回的任务 ID。查询响应中的 task.task_type 区分能力(generation、regeneration 或 h3_context_ir)。
两个模型共用相同的接口地址、鉴权方式、请求与查询结构,仅 model 取值、支持的分辨率以及输入计费方式不同。
768P 和 2K 使用不同的价格档位。具体单价以您所在平台的价格页面为准。失败或取消的任务不产生成功生成费用。MiniMax-H3-Max 仅按输出视频秒数计费(480P / 768P 分档),输入图片与参考视频均免费。
计费公式:单项费用 = 分辨率单价 × 用量;本次费用 = 各计费项之和。视频分辨率可在查询响应的 task.resolution 字段查看。任务成功后一次性结算,失败或取消不计费。
也可以传一张不带 role 的图片作为唯一图片,此时它按首帧处理。
请保存该 ID,并使用它调用查询接口。任务 ID 是后续查询任务状态和获取结果的唯一标识。
查询接口只能查询最近 7 天内创建的任务(UTC 时间窗口 [T-7d, T));超出该窗口的 task_id 会返回 invalid task_id。
建议轮询间隔为 10 至 30 秒,具体可根据业务场景调整。不要高频请求查询接口。
content.url 为生成结果地址。该下载 URL 有有效期,请及时下载或保存到自己的存储中;过期后可再次查询任务以获取新 URL。
status 可能为:
视频任务的 usage 字段如下;没有对应输入时,部分字段可能不返回。
按源视频:
content 中的 text 必须是最终实际下发给模型的提示词,不能使用 H3-Context-IR 处理前的原始提示词。
不支持 callback_url。源视频(768P 输出)须包含音轨、帧率 24 fps、宽高均为 32 的倍数、面积在 768×768 至 768×1344 之间、总帧数 107 至 362 帧(约 4 至 15 秒)。单次请求体不超过 64 MB,较大素材请使用公网 URL 或 mm_file://{file_id}。
创建成功返回任务 ID,之后按第三节轮询查询;任务成功后从 task.content.url 获取 2K 视频。
重生成保持源视频时长不变,上游仅在 output_seconds 返回该时长(input_seconds 为 0),因此输入源视频一项按 output_seconds 计费。任务成功后一次性结算,失败或取消不计费。具体单价以您所在平台的价格页面为准。
不支持 callback_url。
把 task.content.prompt 作为视频生成或视频重生成请求里的最终提示词使用。
任务成功后一次性结算,失败或取消不计费。具体单价以您所在平台的价格页面为准。
这里的 HTTP 错误体与查询到的异步失败任务不同:HTTP 错误详情位于顶层 error.type、error.message、error.http_code;异步任务失败详情位于 task.error.code 和 task.error.message。
上游业务错误会尽量保留原始错误码和错误信息。对于 failed 或 cancelled 任务,不要继续等待同一个 task ID;请修正请求后创建新任务。
一、概述
本文档说明 MiniMax H3 视频生成原厂协议的调用方式、请求参数、任务查询和计费规则。 MiniMax H3 为异步视频生成接口:提交任务后返回任务 ID,客户端通过查询接口获取任务状态。任务成功后,响应中的 content.url 为生成结果地址。 参数及使用方式已对齐官方,详细参数可直接参考官方文档。1.1 接口地址
MiniMax H3 原厂协议包含三种能力,创建接口各不相同,查询接口共用:| 能力 | 创建任务 |
|---|---|
| 视频生成 | POST /v3/minimax/v2/video_generation |
| 视频重生成 | POST /v3/minimax/v2/video_regeneration |
| H3-Context-IR | POST /v3/minimax/v2/h3_context_ir |
GET https://{api_domain}/v3/minimax/v2/query/video_generation/{task_id}
1.2 鉴权
所有请求都需要携带平台 API Key;创建任务的 POST 请求还必须指定 JSON 内容类型:Authorization: Bearer <YOUR_API_KEY>
Content-Type: application/json
1.3 支持模型
请求体中的 model 决定使用的模型,可选值如下:| 模型 | 支持分辨率 | 输入计费 |
|---|---|---|
| MiniMax-H3 | 768P、2K | 输入图片前 5 张免费,超出部分按张计费;参考视频输入按秒计费 |
| MiniMax-H3-Max | 480P、768P | 输入免费:输入图片与参考视频均不计费 |
1.4 计费说明
MiniMax H3 按实际生成用量计费,任务提交时不预扣费:| 用量 | 计费单位 |
|---|---|
| 输入图片 | 前 5 张不计费,超过部分按张计费 |
| 参考视频输入 | 秒 |
| 生成视频输出 | 秒 |
1.5 计费与 usage 字段对照
每次生成成功后,响应的 usage 里会返回本次用量。费用只和其中的秒数 / 图片数有关,按视频分辨率分档定价(H3 为 768P / 2K,H3-Max 为 480P / 768P),token 相关字段不参与计费。下表以 MiniMax-H3 为例逐字段说明;对 MiniMax-H3-Max,input_seconds 与 input_image_count 仍会返回,但均不计费。逐字段说明如下:| usage 字段 | 含义 | 是否计费 | 计费规则 |
|---|---|---|---|
| output_seconds | 生成视频的输出时长(秒) | ✅ 计费 | 按分辨率单价 × output_seconds |
| input_seconds | 输入视频时长(秒) | ✅ 计费(为 0 则不收) | 按分辨率单价 × input_seconds |
| input_image_count | 输入图片张数 | ✅ 超出部分计费 | 前 5 张免费,(input_image_count − 5) × 图片单价 |
| total_seconds | = input_seconds + output_seconds | ❌ 不计费 | 仅为汇总校验 |
| total_tokens | 上游返回的 token 统计 | ❌ 不计费 | 仅供参考,不参与计费 |
| prompt_tokens | 同上 | ❌ 不计费 | 仅供参考 |
| completion_tokens | 同上 | ❌ 不计费 | 仅供参考 |
二、创建视频生成任务
2.1 请求示例:文生视频
文生视频必须提供文本提示词和非自适应画幅:curl -X POST 'https://{api_domain}/v3/minimax/v2/video_generation' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "A cinematic product video in a clean studio"
}
],
"resolution": "768P",
"duration": 4,
"ratio": "16:9"
}'
2.2 请求示例:首帧生视频
curl -X POST 'https://{api_domain}/v3/minimax/v2/video_generation' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "Animate the subject naturally and keep the composition stable"
},
{
"type": "image_url",
"image_url": {
"url": "https://your-cdn.example.com/first-frame.png"
},
"role": "first_frame"
}
],
"resolution": "768P",
"duration": 4,
"ratio": "adaptive"
}'
2.3 请求示例:参考素材生视频
参考图片、视频和音频使用对应的 role:curl -X POST 'https://{api_domain}/v3/minimax/v2/video_generation' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "Create a product demonstration while preserving the reference style"
},
{
"type": "image_url",
"image_url": {
"url": "https://your-cdn.example.com/product.png"
},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {
"url": "https://your-cdn.example.com/reference.mp4"
},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {
"url": "https://your-cdn.example.com/reference.mp3"
},
"role": "reference_audio"
}
],
"resolution": "2K",
"duration": 6,
"ratio": "16:9"
}'
2.4 请求字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | MiniMax-H3 或 MiniMax-H3-Max |
| content | array | 是 | 多模态输入列表;每个请求必须包含一个非空 text 项 |
| content[].type | string | 是 | text、image_url、video_url 或 audio_url |
| content[].text | string | 文本项必填 | 非空提示词,每个文本项最多 7000 个字符 |
| content[].image_url.url | string | 图片项必填 | 公网 URL、mm_file://{file_id} 或图片 Base64 data URI |
| content[].video_url.url | string | 视频项必填 | 公网 URL、mm_file://{file_id} 或 MP4 Base64 data URI |
| content[].audio_url.url | string | 音频项必填 | 公网 URL、mm_file://{file_id} 或音频 Base64 data URI |
| content[].role | string | 按场景必填 | first_frame、last_frame、reference_image、reference_video 或 reference_audio;唯一图片不写 role 时按首帧处理 |
| resolution | string | 是 | Minimax-H3:768P 或 2K;Minimax-H3-Max:480P 或 768P |
| duration | integer | 是 | Minimax-H3:4 至 15 秒的整数;Minimax-H3-Max:5 至 15 秒的整数 |
| ratio | string | 文生视频必填 | adaptive、21:9、16:9、4:3、1:1、3:4 或 9:16;文生视频不可用 adaptive,图生视频固定按 adaptive 处理 |
| callback_url | string | 否 | 任务状态回调地址;首次配置时需在 3 秒内原样返回验证请求中的 challenge |
2.5 内容组合规则
| 规则 | 限制 |
|---|---|
| 文本 | 每个请求必须包含一个非空文本提示词;每个文本项最多 7000 个字符 |
| 首帧/尾帧 | 首帧和尾帧各最多 1 张;支持仅首帧、仅尾帧以及首尾帧组合 |
| 参考图片 | 最多 9 张,使用 role=reference_image |
| 参考视频 | 最多 3 个,使用 role=reference_video;单段 2 至 15 秒,总时长不超过 15 秒 |
| 参考音频 | 最多 3 个,使用 role=reference_audio;单段 2 至 15 秒,总时长不超过 15 秒;可作为唯一一种参考素材与文本一起提交 |
| 素材模式 | 首帧/尾帧模式不能和 reference_image、reference_video、reference_audio 模式混用 |
| 文生视频画幅 | 必须传 ratio,且不能使用 adaptive |
| 图生视频画幅 | 由输入图片决定,始终按 adaptive 处理;传入其他合法值会被忽略 |
| 参考素材生视频画幅 | ratio 可省略,默认 adaptive;也可指定具体画幅 |
| 回调 | 支持 callback_url;状态值为 queued、running、succeeded、failed、cancelled |
2.6 输入素材限制
单次请求体总大小不得超过 64 MB。Base64 会使数据体积增加约 33%,较大的素材应优先使用公网 URL 或 mm_file://{file_id}。| 素材 | 格式 | 单文件限制 | 数量、时长及尺寸限制 |
|---|---|---|---|
| 图片 | JPG、JPEG、PNG、WEBP、HEIC、HEIF | 不超过 30 MB | 宽高均为 256 至 5760 px;宽高比 0.4 至 2.5;首帧最多 1 张、尾帧最多 1 张、参考图片最多 9 张 |
| 参考视频 | MP4、MOV;视频编码 H.264/AVC 或 H.265/HEVC;音频编码 AAC 或 MP3 | 不超过 50 MB | 最多 3 个;单段 2 至 15 秒、总时长不超过 15 秒;宽高均为 256 至 5760 px;宽高比 0.4 至 2.5;帧率 23.976 至 60 fps |
| 参考音频 | WAV、MP3 | 不超过 15 MB | 最多 3 个;单段 2 至 15 秒、总时长不超过 15 秒 |
2.7 创建响应
创建成功返回任务 ID:{
"task_id": "427916141998479"
}
三、查询任务
3.1 查询示例
curl -X GET 'https://{api_domain}/v3/minimax/v2/query/video_generation/427916141998479' \
-H 'Authorization: Bearer <YOUR_API_KEY>'
3.2 处理中响应
任务处于 queued 或 running 时,请等待后继续查询:{
"task": {
"id": "427916141998479",
"status": "running",
"task_type": "generation",
"model": "MiniMax-H3",
"resolution": "768P"
}
}
3.3 成功响应
{
"task": {
"id": "427916141998479",
"model": "MiniMax-H3",
"status": "succeeded",
"created_at": 1785125529,
"updated_at": 1785125946,
"content": {
"url": "https://your-result-cdn.example.com/video.mp4"
},
"resolution": "768P",
"duration": 4,
"usage": {
"total_seconds": 4,
"input_seconds": 0,
"output_seconds": 4,
"input_image_count": 0
},
"ratio": "16:9",
"task_type": "generation",
"modality": "video"
}
}
3.4 失败和取消响应
{
"task": {
"id": "427916141998479",
"model": "MiniMax-H3",
"status": "failed",
"error": {
"code": "1026",
"message": "video description contains sensitive content"
},
"created_at": 1785125529,
"updated_at": 1785125700,
"resolution": "768P",
"duration": 4,
"usage": {},
"ratio": "16:9",
"task_type": "generation",
"modality": "video"
}
}
| 状态 | 说明 |
|---|---|
| queued | 已创建,等待处理 |
| running | 正在生成 |
| succeeded | 生成成功,可读取 content.url |
| failed | 生成失败;错误详情位于 error.code 和 error.message |
| cancelled | 任务已取消 |
3.5 查询返回字段
task 对象字段如下。不同状态下部分字段可能不返回;成功任务的输出位于 content,失败任务的错误位于 error。| 字段 | 类型 | 说明 |
|---|---|---|
| task.id | string | 任务 ID |
| task.model | string | 任务使用的模型,例如 MiniMax-H3 |
| task.status | string | queued、running、succeeded、failed 或 cancelled |
| task.error.code | string | 异步任务失败的业务错误码;仅失败时返回 |
| task.error.message | string | 异步任务失败的错误信息;仅失败时返回 |
| task.created_at | integer | 任务创建时间,Unix 秒级时间戳 |
| task.updated_at | integer | 任务状态最后更新时间,Unix 秒级时间戳 |
| task.content.url | string | 视频输出的限时下载 URL;视频任务成功后返回 |
| task.content.prompt | string | H3-Context-IR 的结构化增强提示词;仅对应任务成功后返回 |
| task.resolution | string | 输出分辨率 |
| task.duration | integer | 输出时长,单位为秒 |
| task.usage | object | 用量信息;成功时包含计量字段,失败响应中可能为空对象 |
| task.ratio | string | 实际输出画幅;不适用时可能为空字符串 |
| task.task_type | string | generation、h3_context_ir 或 regeneration |
| task.modality | string | 输出模态:视频任务为 video,H3-Context-IR 为 text |
| 字段 | 类型 | 说明 |
|---|---|---|
| usage.total_seconds | integer | 总计量秒数,即输入秒数加输出秒数 |
| usage.input_seconds | integer | 参考视频输入秒数 |
| usage.output_seconds | integer | 输出视频秒数 |
| usage.input_image_count | integer | 输入图片总数,包括首帧、尾帧和参考图片 |
| usage.input_audio_seconds | integer | 参考音频输入秒数;没有参考音频时不返回 |
| usage.total_tokens | integer | 总 Token 数,即 prompt_tokens + completion_tokens |
| usage.prompt_tokens | integer | 输入折算 Token 数 |
| usage.completion_tokens | integer | 输出折算 Token 数 |
四、视频重生成
视频重生成把一段已满足 MiniMax-H3 768P 规格的源视频重新生成为 2K。它使用独立的创建接口,model 仍为 MiniMax-H3,resolution 固定为 2K,并共用第三节的查询接口;查询响应中 task.task_type 为 regeneration。4.1 请求示例
两种输入方式二选一,不能同时提供,也不能都不提供:- 按源任务 ID:传 source_task_id,即此前一个成功的 /v2/video_generation 任务 ID(须属于同一账号、状态为 succeeded、且仍在 7 天查询窗口内)。
- 按源视频:传 content,其中恰好包含一个 type=video_url、role=base_video 的源视频项,并把生成该 768P 视频时的其余输入一并重传。
curl -X POST 'https://{api_domain}/v3/minimax/v2/video_regeneration' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMax-H3",
"source_task_id": "424010985738629",
"resolution": "2K"
}'
curl -X POST 'https://{api_domain}/v3/minimax/v2/video_regeneration' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMax-H3",
"content": [
{
"type": "video_url",
"video_url": { "url": "https://your-cdn.example.com/source-768p.mp4" },
"role": "base_video"
},
{
"type": "text",
"text": "最终实际下发给模型的提示词"
}
],
"resolution": "2K"
}'
4.2 请求字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 固定为 MiniMax-H3 |
| resolution | string | 是 | 固定为 2K |
| source_task_id | string | 与 content 二选一 | 此前一个成功的视频生成任务 ID;须属于同一账号、状态 succeeded、仍在 7 天查询窗口内 |
| content | array | 与 source_task_id 二选一 | 输入项列表,须恰好包含一个 role=base_video 的 video_url 项,并重传原始输入 |
| aigc_watermark | boolean | 否 | 是否添加 AIGC 水印,默认 false |
4.3 计费说明
视频重生成按最终生成的 2K 视频时长计费,同时包含输出与输入两部分,均按该时长计:| 用量 | 计费单位 |
|---|---|
| 输出 2K 视频 | 秒 |
| 输入源视频 | 秒 |
| 输入图片 | 前 5 张不计费,超过部分按张计费 |
五、H3-Context-IR
H3-Context-IR 把原始提示词与多模态输入改写为结构化的增强提示词,用于随后的视频生成,不产出视频。它使用独立的创建接口,model 为 MiniMax-H3,并共用第三节的查询接口;查询响应中 task.task_type 为 h3_context_ir、task.modality 为 text,增强提示词位于 task.content.prompt。5.1 请求示例
curl -X POST 'https://{api_domain}/v3/minimax/v2/h3_context_ir' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "A cinematic product video in a clean studio"
},
{
"type": "image_url",
"image_url": { "url": "https://your-cdn.example.com/product.png" },
"role": "reference_image"
}
],
"duration": 6
}'
5.2 请求字段
| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| model | string | 是 | 固定为 MiniMax-H3 |
| content | array | 是 | 多模态输入列表,不能为空;项的结构与视频生成一致(text、image_url、video_url、audio_url,可带 role) |
| duration | integer | 否 | 目标视频时长,4 至 15 秒的整数 |
5.3 响应
创建成功返回任务 ID,之后按第三节轮询查询。任务成功时增强提示词位于 task.content.prompt:{
"task": {
"id": "424262868365581",
"model": "MiniMax-H3",
"status": "succeeded",
"content": {
"prompt": "改写后的结构化增强提示词"
},
"task_type": "h3_context_ir",
"modality": "text",
"usage": {
"prompt_tokens": 120,
"completion_tokens": 480,
"total_tokens": 600
}
}
}
5.4 计费说明
H3-Context-IR 按 Token 计费,输入与输出分别计价,单位为每百万 Token:| 用量 | 计费单位 |
|---|---|
| 输入 | 每百万 prompt_tokens |
| 输出 | 每百万 completion_tokens |
六、Python 调用示例
以下示例使用标准 requests 库,不依赖特定 SDK:import os
import time
import requests
api_domain = os.environ["API_DOMAIN"]
api_key = os.environ["PLATFORM_API_KEY"]
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json",
}
payload = {
"model": "MiniMax-H3",
"content": [{"type": "text", "text": "A calm cinematic landscape"}],
"resolution": "768P",
"duration": 4,
"ratio": "16:9",
}
created = requests.post(
f"https://{api_domain}/v3/minimax/v2/video_generation",
headers=headers,
json=payload,
timeout=30,
)
created.raise_for_status()
task_id = created.json()["task_id"]
while True:
result = requests.get(
f"https://{api_domain}/v3/minimax/v2/query/video_generation/{task_id}",
headers=headers,
timeout=30,
)
result.raise_for_status()
task = result.json()["task"]
if task["status"] == "succeeded":
print(task["content"]["url"])
break
if task["status"] in ("failed", "cancelled"):
raise RuntimeError(task)
time.sleep(20)
七、常见错误
| HTTP | 场景 | 处理建议 |
|---|---|---|
| 400 | 请求 JSON、模型、画幅、时长或 content 组合不合法 | 根据 error.message 修正请求 |
| 401 | API Key 缺失或无效 | 检查 Authorization: Bearer <API_KEY> 请求头 |
| 402 | 余额或额度不足(创建接口) | 充值或调整额度后重试 |
| 422 | 输入包含敏感内容(创建接口) | 修改提示词或输入素材后重新创建任务 |
| 429 | 请求频率超过限制 | 降低提交或轮询频率,并使用退避重试 |
| 500 | 服务端错误 | 使用指数退避重试;避免无幂等控制地重复提交同一业务任务 |
7.1 HTTP 错误响应结构
创建或查询接口直接返回非 2xx HTTP 状态时,响应体采用以下结构。注意 error.http_code 是字符串,request_id 可用于排查请求。{
"type": "error",
"error": {
"type": "bad_request_error",
"message": "invalid params, content must include a non-empty text item (prompt is required) (2013)",
"http_code": "400"
},
"request_id": "021785229015510a2c883cf675b9804d"
}
八、使用建议
- 创建任务后持久化 task_id,不要只依赖客户端内存。
- 查询接口使用 10 至 30 秒轮询间隔,并在客户端设置整体超时。
- 收到 succeeded 后立即下载 content.url,下载 URL 可能过期;过期后可再次查询任务获取新 URL。
- 输入素材 URL 必须可被平台和 MiniMax 上游访问,不能依赖客户内网或临时登录态。
- 需要首尾帧时使用 first_frame/last_frame;需要参考素材时使用 reference_image、reference_video 或 reference_audio,不要混用两种模式。
最后修改于 2026年10月13日