curl -sS -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-demo-001" \
-d '{
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "A cinematic view of ocean waves at sunset"}
],
"resolution": "768P",
"duration": 8,
"ratio": "16:9"
}'
import requests
response = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "order-demo-001",
},
json={
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "A cinematic view of ocean waves at sunset"},
],
"resolution": "768P",
"duration": 8,
"ratio": "16:9",
},
timeout=120,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "order-demo-001",
},
body: JSON.stringify({
model: "MiniMax-H3",
content: [
{ type: "text", text: "A cinematic view of ocean waves at sunset" },
],
resolution: "768P",
duration: 8,
ratio: "16:9",
}),
});
console.log(await response.json());
MiniMax H3
MiniMax H3 视频生成
使用 POST /v1/videos 以 content[] 提交 MiniMax H3 文生、关键帧和参考素材视频任务。
POST
https://magic666.top
/
v1
/
videos
curl -sS -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-demo-001" \
-d '{
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "A cinematic view of ocean waves at sunset"}
],
"resolution": "768P",
"duration": 8,
"ratio": "16:9"
}'
import requests
response = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "order-demo-001",
},
json={
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "A cinematic view of ocean waves at sunset"},
],
"resolution": "768P",
"duration": 8,
"ratio": "16:9",
},
timeout=120,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "order-demo-001",
},
body: JSON.stringify({
model: "MiniMax-H3",
content: [
{ type: "text", text: "A cinematic view of ocean waves at sunset" },
],
resolution: "768P",
duration: 8,
ratio: "16:9",
}),
});
console.log(await response.json());
MiniMax H3 视频生成
POST /v1/videos 接受 JSON 请求并返回异步任务 ID。当前适配层把请求转换为 MiniMax H3 的 content[] 协议:模型固定为 MiniMax-H3,输出固定为 768P,音频默认启用。
方法与路径
POST /v1/videos
鉴权与请求头
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
Idempotency-Key: order-demo-001
Idempotency-Key 建议由客户端为每次业务请求生成并持久化。网络超时后应复用原 Key 和原请求体,避免重复创建任务。
快速开始
curl -sS -X POST https://magic666.top/v1/videos \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-demo-001" \
-d '{
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "A cinematic view of ocean waves at sunset"}
],
"resolution": "768P",
"duration": 8,
"ratio": "16:9"
}'
import requests
response = requests.post(
"https://magic666.top/v1/videos",
headers={
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "order-demo-001",
},
json={
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "A cinematic view of ocean waves at sunset"},
],
"resolution": "768P",
"duration": 8,
"ratio": "16:9",
},
timeout=120,
)
response.raise_for_status()
print(response.json())
const response = await fetch("https://magic666.top/v1/videos", {
method: "POST",
headers: {
Authorization: "Bearer YOUR_API_KEY",
"Content-Type": "application/json",
"Idempotency-Key": "order-demo-001",
},
body: JSON.stringify({
model: "MiniMax-H3",
content: [
{ type: "text", text: "A cinematic view of ocean waves at sunset" },
],
resolution: "768P",
duration: 8,
ratio: "16:9",
}),
});
console.log(await response.json());
请求体
string
required
模型名称。MiniMax H3 请求固定使用
MiniMax-H3。插件兼容 minimax-h3、minimax-h3-pro、minimax-h3-768p、minimax-h3-2k 及其 Pro 变体,但这些历史名称都会归一到同一个 H3 入口,不会启用 2K 或独立 Pro 档。array<object>
required
内容数组。必须且只能包含一个
type: "text" 文本项,可再追加 0 到 12 个媒体项。文本项应放在数组前面。string
required
内容类型。支持
text、image_url、video_url 和 audio_url。string
文本提示词。请求中必须有且只有一个非空文本项,最多 7000 个 Unicode 字符。引用参考素材时,使用
<Picture 1>、<Video 1> 或 <Audio 1> 等标签,并按各媒体类型在数组中的顺序编号。string
图片的公网 HTTPS URL。支持 JPG/JPEG、PNG、WebP、HEIC 和 HEIF 静态图片;单文件不超过 30 MB,单边 256 到 5760 像素,解码后不超过 33,177,600 像素,宽高比需在 0.4 到 2.5 之间。
string
参考视频的公网 HTTPS URL。支持 MP4/MOV,H.264/H.265,可带 AAC/MP3 音轨;单文件不超过 50 MB,单段至少 2 秒。超过 15 秒时只保留开头 15 秒,参考视频总时长最多 15 秒。
string
参考音频的公网 HTTPS URL。支持 WAV/PCM、MP3、M4A/AAC 和裸 ADTS AAC;单文件不超过 15 MB,单段至少 2 秒。超过 15 秒时只保留开头 15 秒,独立参考音频总时长最多 15 秒。
string
媒体角色。图片可用
first_frame、last_frame 或 reference_image;视频使用 reference_video;音频使用 reference_audio。first_frame / last_frame 不能和任何 reference_* 角色混用。string
required
固定传
768P。当前网关不提供 2K,也不接受质量档位或自定义输出尺寸。integer
required
输出名义时长,单位为秒,必须是
1 到 15 的整数。查询和计费使用该名义时长;实际 MP4 容器时长可能因固定帧网格略有差异。string
required
画幅比例。支持
21:9、16:9、4:3、1:1、3:4 和 9:16。当前插件不透传 adaptive;缺少或不支持的比例会回退为 16:9。请求示例
首帧生视频
{
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "The camera slowly moves forward as clouds drift"},
{
"type": "image_url",
"image_url": {"url": "https://assets.example.com/first.png"},
"role": "first_frame"
}
],
"resolution": "768P",
"duration": 10,
"ratio": "16:9"
}
首尾帧
{
"model": "MiniMax-H3",
"content": [
{"type": "text", "text": "Transition smoothly from day to night"},
{
"type": "image_url",
"image_url": {"url": "https://assets.example.com/first.png"},
"role": "first_frame"
},
{
"type": "image_url",
"image_url": {"url": "https://assets.example.com/last.png"},
"role": "last_frame"
}
],
"resolution": "768P",
"duration": 10,
"ratio": "9:16"
}
混合参考素材
{
"model": "MiniMax-H3",
"content": [
{
"type": "text",
"text": "<Picture 1> performs the motion from <Video 1> in sync with <Audio 1>"
},
{
"type": "image_url",
"image_url": {"url": "https://assets.example.com/character.webp"},
"role": "reference_image"
},
{
"type": "video_url",
"video_url": {"url": "https://assets.example.com/motion.mp4"},
"role": "reference_video"
},
{
"type": "audio_url",
"audio_url": {"url": "https://assets.example.com/music.mp3"},
"role": "reference_audio"
}
],
"resolution": "768P",
"duration": 12,
"ratio": "16:9"
}
创建响应
{
"id": "video_abc123",
"task_id": "video_abc123",
"object": "video",
"model": "MiniMax-H3",
"status": "queued",
"progress": 0,
"created_at": 1786500000
}
id 和 task_id 通常相同,使用任意一个调用查询接口。创建成功不代表输入已经下载、审核或生成完成。
同步错误
| HTTP 状态 | 常见原因 |
|---|---|
400 | JSON、字段类型、角色、数量、URL 语法或幂等 Key 冲突 |
401 | API Key 缺失或无效 |
429 | 账户或入口限流;尚未创建任务,按 Retry-After 等待 |
500 | 服务内部错误;使用原幂等 Key 退避重试 |
400,请在查询响应的 task.error 中处理,例如 input_download_failed、input_format_unsupported、input_duration_out_of_range、content_policy_violation 和 fail_to_fetch_task。
注意事项
- 所有媒体 URL 必须是公网 HTTPS,服务不会读取客户端本地文件。
first_frame/last_frame与reference_image、reference_video、reference_audio不要混用。- 超过 15 秒的参考音视频会裁剪开头部分,不会压缩或加速,也不会改变请求的输出
duration。 - 需要长期保存结果时,在任务成功后尽快下载,不要自行猜测结果 URL。