> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.com.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# MiniMax H3

> 通过 AnyFast 调用 MiniMax-H3，完成文生视频、图生视频和多模态参考视频生成。

MiniMax-H3 是面向视频生成的多模态模型。它支持文本、首尾帧、参考图片、参考视频和参考音频输入，生成任务采用异步模式：先创建任务，再根据 `task_id` 查询结果。

## 核心能力

* **文本生成视频** — 通过提示词控制主体、场景、镜头和动作
* **首尾帧控制** — 传入首帧，或同时传入首帧与尾帧
* **多模态参考** — 最多组合 12 个图片、视频和音频素材
* **灵活输出** — 支持 `768P`、`2K`，时长范围为 4–15 秒
* **异步任务** — 支持轮询查询，也可设置 `callback_url` 接收任务状态通知

## 快速开始

### 1. 创建视频任务

<CodeGroup>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://www.anyfast.com.cn/minimax/v2/video_generation \
    --header 'Authorization: Bearer YOUR_API_KEY' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "MiniMax-H3",
      "content": [
        {
          "type": "text",
          "text": "电影感航拍镜头，清晨的云海缓慢掠过雪山，光线柔和"
        }
      ],
      "resolution": "768P",
      "duration": 6,
      "ratio": "16:9",
      "aigc_watermark": false
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://www.anyfast.com.cn/minimax/v2/video_generation",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Content-Type": "application/json",
      },
      json={
          "model": "MiniMax-H3",
          "content": [
              {
                  "type": "text",
                  "text": "电影感航拍镜头，清晨的云海缓慢掠过雪山，光线柔和",
              }
          ],
          "resolution": "768P",
          "duration": 6,
          "ratio": "16:9",
          "aigc_watermark": False,
      },
  )

  response.raise_for_status()
  task_id = response.json()["task_id"]
  print(task_id)
  ```
</CodeGroup>

创建成功后返回：

```json theme={null}
{
  "task_id": "1234567890"
}
```

### 2. 查询任务结果

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://www.anyfast.com.cn/minimax/v2/query/video_generation/1234567890 \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python theme={null}
  import requests

  task_id = "1234567890"
  response = requests.get(
      f"https://www.anyfast.com.cn/minimax/v2/query/video_generation/{task_id}",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
  )

  response.raise_for_status()
  task = response.json()["task"]
  print(task["status"], task.get("content", {}).get("url"))
  ```
</CodeGroup>

任务状态包括 `queued`、`running`、`succeeded`、`failed` 和 `cancelled`。成功后可从 `task.content.url` 获取视频地址。查询接口仅保证可查询最近 7 天内创建的任务。

## 输入模式

`content` 必须且只能包含一个非空的 `text` 项，还可以添加媒体项：

| 输入类型 | `type`      | 可用 `role`                                    | 数量限制               |
| ---- | ----------- | -------------------------------------------- | ------------------ |
| 提示词  | `text`      | 不使用                                          | 必须且仅 1 个           |
| 图片   | `image_url` | `first_frame`、`last_frame`、`reference_image` | 首帧 1、尾帧 1、参考图最多 9  |
| 视频   | `video_url` | `reference_video`                            | 最多 3 个，总时长不超过 15 秒 |
| 音频   | `audio_url` | `reference_audio`                            | 最多 3 个，总时长不超过 15 秒 |

<Note>
  首帧/尾帧模式不能与参考图片、参考视频或参考音频模式混用。所有媒体项合计最多 12 个。
</Note>

### 首帧图生视频示例

```json theme={null}
{
  "model": "MiniMax-H3",
  "content": [
    {
      "type": "text",
      "text": "人物缓慢转身看向镜头，发丝随风飘动"
    },
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/first-frame.jpg"
      },
      "role": "first_frame"
    }
  ],
  "resolution": "768P",
  "duration": 6,
  "ratio": "adaptive"
}
```

### 多模态参考示例

```json theme={null}
{
  "model": "MiniMax-H3",
  "content": [
    {
      "type": "text",
      "text": "参考人物形象、运镜节奏和背景音乐，生成一段产品展示视频"
    },
    {
      "type": "image_url",
      "image_url": { "url": "https://example.com/character.png" },
      "role": "reference_image"
    },
    {
      "type": "video_url",
      "video_url": { "url": "https://example.com/camera-motion.mp4" },
      "role": "reference_video"
    },
    {
      "type": "audio_url",
      "audio_url": { "url": "https://example.com/music.mp3" },
      "role": "reference_audio"
    }
  ],
  "resolution": "2K",
  "duration": 10,
  "ratio": "adaptive"
}
```

## 参数说明

| 参数               | 类型      | 必填 | 说明                                                |
| ---------------- | ------- | -- | ------------------------------------------------- |
| `model`          | string  | 是  | 固定为 `MiniMax-H3`                                  |
| `content`        | array   | 是  | 提示词与媒体输入，合计最多 12 项                                |
| `resolution`     | string  | 否  | `768P` 或 `2K`                                     |
| `duration`       | integer | 否  | 4–15 秒                                            |
| `ratio`          | string  | 否  | `adaptive`、`21:9`、`16:9`、`4:3`、`1:1`、`3:4`、`9:16` |
| `callback_url`   | string  | 否  | 接收任务状态通知的 HTTPS 地址                                |
| `aigc_watermark` | boolean | 否  | 是否添加 AIGC 水印，默认 `false`                           |

<Warning>
  纯文本生成视频时，`ratio` 不能使用 `adaptive`，请指定一个明确比例。图生视频或参考素材模式可使用 `adaptive`。
</Warning>

## 媒体要求

* 请求体总大小不超过 64 MB
* 图片支持 JPG、JPEG、PNG、WEBP、HEIC、HEIF，单张不超过 30 MB
* 视频支持 MP4、MOV；视频编码支持 H.264/H.265，音频编码支持 AAC/MP3；单个不超过 50 MB、时长 2–15 秒
* 音频支持 WAV、MP3；单个不超过 15 MB、时长 2–15 秒
* 图片和视频宽高均为 256–5760 像素，宽高比范围为 0.4–2.5
* 视频帧率范围为 23.976–60 FPS

<CardGroup cols={2}>
  <Card title="创建视频任务" icon="video" href="/api-reference/model-api/minimax/minimax-h3">
    查看完整请求字段并在线调试。
  </Card>

  <Card title="查询视频任务" icon="magnifying-glass" href="/api-reference/model-api/minimax/minimax-h3-task-query">
    根据 task\_id 查询状态与视频结果。
  </Card>
</CardGroup>

<script src="/feedback.js" />
