模型简介

minimax-h3 是多模式视频生成模型,支持文生视频、首尾帧、参考生(参考图 / 参考视频 / 参考音频)三种玩法,输出 4–15 秒的有声视频。接口与 grok-video-3.5 相同,采用 OpenAI Sora 风格的异步任务流程。

快速信息

项目说明
模型名称minimax-h3
价格0.5 元/秒,按 seconds 计费;参考生模式下参考视频的时长也按秒额外计费
时长seconds:"4" – "15"
分辨率resolution:768P / 2K
画幅aspect_ratio:16:9 / 9:16 / 1:1 等
出片时间较慢,实测 4 秒 768P 文生视频约 7 分钟,轮询总超时建议 15 分钟
Base URLhttps://deepseektavern.com/v1

获取 API Key

登录 DeepSeek Tavern 控制台,在「令牌管理」中创建 API Key。详细步骤参考:API 密钥获取指南。

Base URL 统一为 https://deepseektavern.com/v1,认证方式:Authorization: Bearer <你的API密钥>。下文示例中的 YOUR_API_KEY 请替换为你自己的 Key。

调用流程

  1. POST /v1/videos 提交生成任务,返回任务 id
  2. GET /v1/videos/{id} 轮询任务状态,建议每 10 秒一次,直到 status 为 completed
  3. 用返回体中的 url 字段下载视频
注意

返回的 url 可能是 http:// 开头的链接。在 https 网页里直接嵌入播放可能会被浏览器拦截(混合内容),建议先下载到本地或你自己的存储,再使用。视频链接请及时保存。

三种生成模式

模式mode 参数素材说明
文生视频不传什么素材都不传只写 prompt
首尾帧shouweizhenimages:1–2 张第 1 张是首帧,第 2 张是尾帧;只传 1 张即首帧生视频
参考生cankaoshengimage_url / video_url / audio_url参考图 0–9 张;参考视频最多 3 个(mp4/mov,2–15 秒);参考音频最多 3 段

请求参数

POST https://deepseektavern.com/v1/videos,JSON 请求体:

参数类型必填说明
modelstring是minimax-h3
promptstring是视频内容描述:画面、动作、镜头、声音等
secondsstring否视频时长 "4" – "15",按秒计费
resolutionstring否768P / 2K
aspect_ratiostring否16:9 / 9:16 / 1:1 等
modestring否shouweizhen(首尾帧)/ cankaosheng(参考生);不传即文生视频
imagesarray首尾帧必填首尾帧模式:1–2 张,第 1 张首帧、第 2 张尾帧
image_urlarray否参考生模式:参考图数组,0–9 张
video_urlarray否参考生模式:参考视频数组,最多 3 个,mp4/mov,每个 2–15 秒,时长按秒额外计费
audio_urlarray否参考生模式:参考音频数组,最多 3 段
素材格式

图片支持公网 URL 或 data:image/...;base64,...;视频文件必须传 URL,不支持 data URI。

curl 示例

文生视频

curl https://deepseektavern.com/v1/videos \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "minimax-h3",
    "prompt": "雨夜的古风酒馆门口,灯笼摇晃,一位披斗篷的剑客推门而入,雨声和风铃声",
    "seconds": "6",
    "resolution": "768P",
    "aspect_ratio": "16:9"
  }'

首尾帧

curl https://deepseektavern.com/v1/videos \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "minimax-h3",
    "mode": "shouweizhen",
    "prompt": "少女从坐着看书到起身走向窗边,镜头平滑跟随",
    "images": [
      "https://example.com/first-frame.png",
      "https://example.com/last-frame.png"
    ],
    "seconds": "5",
    "resolution": "768P",
    "aspect_ratio": "9:16"
  }'

参考生

curl https://deepseektavern.com/v1/videos \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "minimax-h3",
    "mode": "cankaosheng",
    "prompt": "参考图中的角色在参考视频的舞台上跳舞,背景音乐使用参考音频的风格",
    "image_url": ["https://example.com/character.png"],
    "video_url": ["https://example.com/stage-5s.mp4"],
    "audio_url": ["https://example.com/bgm.mp3"],
    "seconds": "8",
    "resolution": "768P",
    "aspect_ratio": "16:9"
  }'

上面这个请求的费用:生成 8 秒 + 参考视频 5 秒 = 13 秒 × 0.5 元 = 6.5 元。

查询任务

curl https://deepseektavern.com/v1/videos/video_xxxxxxxx \
  -H "Authorization: Bearer YOUR_API_KEY"

完整 Python 示例:提交 + 轮询 + 下载

import base64
import time
import requests

API_KEY = "YOUR_API_KEY"
BASE = "https://deepseektavern.com/v1"
HEADERS = {"Authorization": f"Bearer {API_KEY}"}


def to_data_uri(path):
    """本地图片转 data URI(视频不支持,必须传 URL)"""
    mime = "image/png" if path.lower().endswith(".png") else "image/jpeg"
    with open(path, "rb") as f:
        return f"data:{mime};base64," + base64.b64encode(f.read()).decode()


# 1. 提交任务(这里以首尾帧为例;文生视频去掉 mode 和 images 即可)
payload = {
    "model": "minimax-h3",
    "mode": "shouweizhen",
    "prompt": "花苞在晨光中缓缓绽放,露珠滑落,鸟鸣声",
    "images": [to_data_uri("bud.png"), to_data_uri("bloom.png")],
    "seconds": "6",           # 按秒计费:6 秒 = 3 元
    "resolution": "768P",
    "aspect_ratio": "1:1",
}
r = requests.post(f"{BASE}/videos", json=payload, headers=HEADERS, timeout=120)
r.raise_for_status()
video_id = r.json()["id"]
print("任务已提交:", video_id)

# 2. 轮询:每 10 秒一次,总超时 15 分钟(实测 4 秒 768P 约 7 分钟出片)
deadline = time.time() + 15 * 60
while True:
    time.sleep(10)
    info = requests.get(f"{BASE}/videos/{video_id}", headers=HEADERS, timeout=60).json()
    status = info.get("status")
    print("状态:", status, info.get("progress", ""))
    if status == "completed":
        break
    if status in ("failed", "cancelled", "error"):
        raise RuntimeError(f"生成失败: {info}")
    if time.time() > deadline:
        raise TimeoutError("等待超过 15 分钟,可稍后用同一个 id 继续查询")

# 3. 用 url 字段下载(可能是 http 链接,下载后再使用,不要直接嵌入 https 网页)
video_url = info["url"]
with requests.get(video_url, stream=True, timeout=600) as resp:
    resp.raise_for_status()
    with open(f"{video_id}.mp4", "wb") as f:
        for chunk in resp.iter_content(1 << 16):
            f.write(chunk)
print("已保存:", f"{video_id}.mp4")

计费说明

项目价格
每秒视频0.5 元
4 秒 / 10 秒 / 15 秒2 元 / 5 元 / 7.5 元
参考生的参考视频参考视频时长按 0.5 元/秒额外计费