curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Context-IR",
"prompt": "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
"duration": 5,
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "MiniMax-H3-Context-IR",
"prompt": "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
"duration": 5,
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "MiniMax-H3-Context-IR",
prompt: "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
duration: 5,
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
MiniMax-H3
MiniMax-H3 Context-IR 提示词增强
- 多模态上下文理解,产出增强后的结构化提示词(文本,不生成视频)
- 与 H3 视频生成共用同一套素材字段与互斥规则
- 按 token 计费,通常 20~40 秒出结果
- 可单独使用,也可作为 768P 预览 → 2K 再生成 workflow 的第一步
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Context-IR",
"prompt": "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
"duration": 5,
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "MiniMax-H3-Context-IR",
"prompt": "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
"duration": 5,
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "MiniMax-H3-Context-IR",
prompt: "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
duration: 5,
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
Full 2K Workflow(可选):① Context-IR 增强 prompt → ② MiniMax-H3 用
768P 出预览 → ③ Regeneration 升 2K。三步单价合计等于直出 2K,但试错成本更低。也可单独调用本接口。curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "MiniMax-H3-Context-IR",
"prompt": "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
"duration": 5,
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "MiniMax-H3-Context-IR",
"prompt": "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
"duration": 5,
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "MiniMax-H3-Context-IR",
prompt: "史诗级太空歌剧院线预告:女舰长独自站在巨大观景窗前,最后一支舰队正在集结并跃迁离去。",
duration: 5,
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "请求参数无效",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "身份验证失败,请检查您的API密钥",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "账户余额不足,请充值后再试",
"type": "payment_required"
}
}
认证
string
必填
Bearer Token 认证。访问 API Key 管理页面 获取密钥。
Authorization: Bearer YOUR_API_KEY
说明
将原始想法与素材交给模型做多模态理解,返回一段结构化、语义更丰富的提示词。- 不创建视频,结果在
result.prompt(不是result.videos) - 素材字段与 视频生成 校验规则一致(首尾帧与参考互斥、不能只给音频),便于把同一份输入继续用于生成
{
"code": 200,
"data": {
"actual_time": 28,
"completed": 1700000128,
"cost": 0.011204,
"created": 1700000100,
"credits_cost": 0.11204,
"estimated_time": 100,
"id": "task_01J9HA7J*************",
"progress": 100,
"result": {
"prompt": "integrated_multimodal_description: [Shot 1] Cinematic, close-up shot. The camera slowly pushes in on a lone adult astronaut standing in a dimly lit, metallic corridor. The astronaut wears a weathered, white and silver extravehicular spacesuit heavily scuffed with grey dust, featuring a completely opaque, gold-tinted helmet visor. The astronaut slowly pushes open a rusted, thick steel airlock door on the right side of the frame. As the heavy metal door shifts, a sudden, intense beam of vibrant green light spills across the dark frame, illuminating the intricate fabric folds of the suit. The curved golden visor vividly reflects a dense, tangled mass of luminescent green leaves and vines. [Shot 2] At 00:02.500, the camera cuts to a wide shot from directly behind the astronaut from Shot 1, smoothly pedestaling up to reveal the interior of the abandoned orbital station. The vast, hexagonal titanium room is completely overrun by a lush, zero-gravity living garden. Giant, emerald-green vines spiral tightly around cracked, grey ceiling support beams, while thick patches of bioluminescent cyan moss emit a soft glow from the rusted floor grid. Several large, perfectly spherical water droplets float weightlessly in the midground, refracting the ambient green light. The astronaut lowers their heavy, white-gloved hands to their sides, standing perfectly motionless before the massive canopy of overgrown flora.\noverall_soundscape: A loud, grinding metallic creak dominates the foreground as the heavy steel door shifts, instantly followed by a pronounced, high-pitched hiss of escaping pressurized air. A continuous, low-frequency mechanical hum rumbles in the background, establishing the station's deadened room tone. As the space opens, the distinct, crisp rustle of thick foliage is clearly heard, accompanied by soft, resonant liquid plops as unseen water drops collide in the metallic chamber.\nnon_diegetic_music: Ambient electronic score, slow tempo, featuring a deep, sustained synthesizer drone heavily overlaid with delicate, shimmering glockenspiel notes and a solitary, reverberating cello."
},
"status": "completed",
"usage": {
"input_tokens": 5512,
"output_tokens": 2388,
"total_tokens": 7900
}
}
}
result.prompt 原样作为 MiniMax-H3 的 prompt 即可继续生成。
请求参数
string
必填
固定值:
MiniMax-H3-Context-IRstring
必填
原始想法描述,≤ 7000 字符
integer
默认值:"5"
目标视频时长(秒),4~15,默认
5。影响增强结果中的节奏描述。string
目标画幅。纯文本输入时必填,且不能是
adaptive。常用:16:9、9:16、1:1、4:3、3:4、21:9 等。string
首帧图 URL
string
尾帧图 URL
string[]
参考图数组(一律按参考图处理),≤ 9 张
object[]
带角色图片:
role 为 first_frame / last_frame / reference_imagestring[]
参考视频,≤ 3 段;单段 2~15 秒,总时长 ≤ 15 秒
string[]
参考音频,≤ 3 段;不能单独输入,须搭配参考图或参考视频
计费
按 token 计费(H3 家族中唯一按 token 结算的模型):| 项目 | 单价 |
|---|---|
| 输入 tokens | $0.87 / 百万 |
| 输出 tokens | $3.45 / 百万 |
prompt_tokens / completion_tokens 对账,多退少补。多模态输入(图/视频/音频)会显著增加输入 token。
注意事项
- 通常 20~40 秒完成,建议每 3~5 秒轮询 任务状态。
- 参数错误同步 400,不建任务、不扣费;生成阶段失败会
failed并自动退款。 - 完整 workflow 见 Regeneration 页说明。
Response
integer
响应状态码,成功时为 200
⌘I