NezhaGateNezhaGate
POST https://nezhagate.com/v1/videos/generations

MiniMax H3 视频生成(异步任务):1080P 输出、固定生成原生音频;时长 duration=5–15 的任意整数秒,画幅六选一;带 image 即图生视频。提交后返回任务号(HTTP 202),轮询 GET /v1/videos/jobs/{id} 直到 status=succeeded,结果在 data[0].url。按秒计费、失败全额退。

在 Playground 试用 →

认证

Header
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

在控制台创建 API Key 后即可调用。

请求参数

参数类型必填说明
model string 是 模型 ID,此处为 minimax-h3。
prompt string 是 视频内容、镜头与运动的描述。最长 2000 字节(UTF-8,中文一个字算 3 字节,约 666 字)。传多张参考图时,可用 @Image1 / @Image2 在提示词里点名第几张,例如「@Image1 的角色站在 @Image2 的场景里」;不点名则由模型自行取用。
duration integer 否 时长秒数,5–15 的任意整数(默认 5)。也可写作 seconds。按秒计费。
resolution string 否 分辨率:1080P(默认 1080P;每档单价不同,见模型页价格表)。
size string 否 画幅:16:9 / 9:16 / 21:9 / 4:3 / 1:1 / 3:4(默认 16:9)。也可写作 aspect_ratio。
audio boolean 否 该模型固定生成原生音频,此参数会被忽略(传 false 会被拒绝)。
image string 否 图生视频:带参考图(默认作首帧)即走图生视频,可传公网 URL、data: URI 或 base64;不带则为文生视频。
images array 否 多张参考图,最多 5 张(本模型上限)。数组元素可以是公网 URL、data: URI 或 base64。超过上限会直接报错,不会截断。也可写作 reference_images。
image_role string 否 参考图用法:first_frame(默认,作首帧;传两张时第二张作尾帧)或 reference(作为主体/风格参考图,多张时用这个)。用 reference_images 传入时默认就是 reference。
audio_reference string / array 否 参考音频的公网 http(s) 链接,最多 3 段。必须与参考图或参考视频一起使用,不能单独提供。也可写作 audio_references,两者不要同时给。

请求示例

cURL
# 1) submit -> 202 {"id":"img_...","status":"queued"}
curl https://nezhagate.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "minimax-h3", "prompt": "a cat surfing a wave at sunset", "duration": 5, "resolution": "1080P", "size": "16:9"}'
# image-to-video: also pass  "image": "https://example.com/first-frame.png"
# 2) poll every ~5s until status=succeeded, then read data[0].url
curl https://nezhagate.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'

响应示例

200 · JSON
{
  "id": "img_3f9a...c2",
  "object": "video.generation.job",
  "status": "queued",
  "model": "minimax-h3"
}

异步视频任务(提交 → 轮询)

提交后立即返回 HTTP 202 与任务号,轮询直到 status=succeeded,结果在 data[0].url(mp4 直链)。时长、清晰度与画面比例的可选值见上方参数表;带 image 参数即图生视频。

curl · 提交任务(文生视频)
curl https://nezhagate.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "minimax-h3", "prompt": "一只猫在日落时冲浪", "size": "16:9"}'
图生视频:额外传 image 参数(首帧参考图,可为公网 URL、data: URI 或 base64)。
响应示例
{ "id": "img_3f9a...c2", "object": "video.generation.job", "status": "queued", "model": "minimax-h3" }
curl · 轮询结果
curl https://nezhagate.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'
响应示例
{
  "id": "img_3f9a...c2",
  "object": "video.generation.job",
  "status": "succeeded",
  "model": "minimax-h3",
  "data": [{ "url": "https://img.nezhagate.com/i/9f86d081a8....mp4" }]
}

🕑 data[0].url 是本站图床链接,保留 60 天后自动删除;需要长期使用,请下载后存到你自己的存储或 CDN。

按秒计费(每秒 $0.036 × 时长),预扣与结算完全一致;生成失败或超时会自动全额退还。

错误码

错误体统一为 error.message / error.type / error.code / error.param;请按 code 分支,完整清单见接入指南。

HTTPcode说明
401invalid_api_keyAPI Key 缺失或无效
402insufficient_quota余额不足或 Key 超出限额
400invalid_request模型或参数不支持
429rate_limit_exceeded上游限流
502upstream_error所有上游线路失败