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

# 创建 MiniMax H3 Context-IR 任务

> 使用文本、图片、视频和音频上下文生成结构化视频提示词。

Context-IR 是 `minimax-h3` 的提示词增强能力。它会理解多模态素材之间的关系，并返回更完整、结构化的视频提示词，**不会直接生成视频**。

```
POST /v1/videos/context-ir
```

<Note>
  本接口为异步接口。创建成功后保存平台任务 `id`，然后调用 [查询 Context-IR 任务](/guides/minimax-h3-context-ir-query) 获取增强后的提示词。
</Note>

## 请求示例

<CodeGroup>
  ```json 文本上下文 theme={null}
  {
    "model": "minimax-h3",
    "content": [
      {
        "type": "text",
        "text": "史诗级太空歌剧院线预告：女舰长站在巨大观景窗前，最后一支舰队跃迁离去。"
      }
    ],
    "duration": 5,
    "ratio": "16:9"
  }
  ```

  ```json 首帧图片上下文 theme={null}
  {
    "model": "minimax-h3",
    "content": [
      {
        "type": "text",
        "text": "镜头缓慢推进，人物抬头看向寺庙穹顶，烛火轻微摇曳。"
      },
      {
        "type": "image_url",
        "image_url": {
          "url": "https://example.com/first-frame.png"
        },
        "role": "first_frame"
      }
    ],
    "duration": 6,
    "ratio": "adaptive"
  }
  ```

  ```json 多模态参考上下文 theme={null}
  {
    "model": "minimax-h3",
    "content": [
      {
        "type": "text",
        "text": "参考人物外观、镜头运动和音色，生成电影感追逐镜头。"
      },
      {
        "type": "image_url",
        "image_url": {
          "url": "https://example.com/reference.png"
        },
        "role": "reference_image"
      },
      {
        "type": "video_url",
        "video_url": {
          "url": "https://example.com/reference.mp4"
        },
        "role": "reference_video"
      },
      {
        "type": "audio_url",
        "audio_url": {
          "url": "https://example.com/reference.mp3"
        },
        "role": "reference_audio"
      }
    ],
    "duration": 8,
    "ratio": "adaptive"
  }
  ```
</CodeGroup>

## 请求参数

| 参数         | 类型        | 必填   | 说明                                   |
| ---------- | --------- | ---- | ------------------------------------ |
| `model`    | string    | 是    | 固定使用 `minimax-h3`，与视频生成使用同一个模型 ID。   |
| `content`  | object\[] | 是    | 多模态上下文，必须包含且只能包含一项非空 `text`。         |
| `duration` | integer   | 是    | 目标视频时长，支持 4–15 秒。                    |
| `ratio`    | string    | 条件必填 | 文本上下文必须传固定比例；图片或多模态参考可使用 `adaptive`。 |

`content` 的角色组合、数量和素材限制与 [创建 MiniMax H3 视频任务](/guides/minimax-h3-create-task) 相同。

<Note>
  Context-IR 复用 H3 的音频输入规则：Base64 音频请使用 `data:audio/mp3;base64,...` 或 `data:audio/wav;base64,...`。沙箱实测 `data:audio/mpeg;base64,...` 会被上游识别为 `.mpeg` 并拒绝。
</Note>

<Warning>
  平台暂不接受 `callback_url`。请使用任务查询接口轮询状态，避免上游回调绕过平台任务 ID 和结算状态。
</Warning>

## 创建响应

HTTP 状态码：`202 Accepted`

```json theme={null}
{
  "id": "irtask_16a77bfc435343ff98cf67d17f23336e",
  "object": "video.context_ir.task",
  "created": 1786099200,
  "model": "minimax-h3",
  "status": "queued",
  "task_type": "h3_context_ir",
  "expires_at": 1786272000
}
```

创建时平台会按 Context-IR endpoint capability 中配置的输入、输出 Token 预冻结预算估算费用。这两个预算不是模型请求上限；任务完成后按照上游返回的真实 Token 用量结算，多余冻结金额自动退回。
