# MiniMax-H3-Context-IR 多模态提示词增强

> 视频生成

提交异步提示词增强任务。`input.content` 中必须且只能包含一个非空文本项；模型会根据其余媒体项及 `role` 自动选择处理模式。

支持的输入组合：
- 文生视频提示词：仅包含一个 `text` 项。
- 图生视频提示词：`text` 加一张首帧或尾帧图片，或者加首帧和尾帧各一张。
- 多模态参考提示词：`text` 加参考图片、参考视频和参考音频的组合。

图生视频与多模态参考互斥，不能在同一次请求中混用帧图片和参考媒体。

**输入媒体限制**（请求体总大小 ≤ 64 MB，大文件请用公网 URL，勿用 Base64）：

**图片 image_url**：
| 项 | 限制 |
|:---|:---|
| 格式 | JPG、JPEG、PNG、WEBP、HEIC、HEIF |
| 单文件大小 | ≤ 30 MB |
| 宽高范围 | [256, 5760] px |
| 长宽比（宽/高） | [0.4, 2.5] |
| 数量 | 首帧 ≤ 1、尾帧 ≤ 1、参考图 ≤ 9 |

**视频 video_url**（仅多模态参考场景）：
| 项 | 限制 |
|:---|:---|
| 容器 / 格式 | MP4（.mp4）、MOV（.mov） |
| 编码 | 视频 H.264/AVC、H.265/HEVC；音频 AAC、MP3 |
| 单文件大小 | ≤ 50 MB |
| 个数 | ≤ 3 |
| 单段时长 | [2, 15] s；总时长 ≤ 15 s |
| 宽高范围 | [256, 5760] px |
| 长宽比（宽/高） | [0.4, 2.5] |
| 帧率 | [23.976, 60] |

**音频 audio_url**（仅多模态参考场景）：
| 项 | 限制 |
|:---|:---|
| 格式 | WAV、MP3 |
| 单文件大小 | ≤ 15 MB |
| 个数 | ≤ 3 |
| 单段时长 | [2, 15] s；总时长 ≤ 15 s |

## 请求地址

`POST https://api.modelverse.cn/v1/tasks/submit`

## 请求体

## 响应

- **200** — 任务提交成功。
- **400** — 请求参数或输入组合无效。
- **default** — 错误响应。

## OpenAPI 定义

```json
{
  "openapi": "3.1.0",
  "x-language": "zh-CN",
  "info": {
    "title": "MiniMax-H3-Context-IR 多模态提示词增强接口文档",
    "version": "1.0.0",
    "description": "这是 ModelVerse 上 `MiniMax-H3-Context-IR` 的多模态提示词增强接口文档。通过多模态上下文（文本+图片/视频/音频）生成结构化、语义丰富的视频提示词。\n\n**重要说明**：本接口只返回增强后的视频提示词，不会创建视频生成任务。拿到增强提示词后，可作为输入传递给标准视频生成接口（如 `MiniMax-H3`）。\n\n接口路径包括 `POST /v1/tasks/submit`、`GET /v1/tasks/status`。\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "该模型文档中使用的 ModelVerse API 端点。"
    }
  ],
  "tags": [
    {
      "name": "MiniMax-H3-Context-IR",
      "description": "MiniMax-H3-Context-IR 多模态提示词增强任务。"
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "MiniMax-H3-Context-IR"
        ],
        "operationId": "submitMiniMaxH3ContextIRTask",
        "summary": "MiniMax-H3-Context-IR 多模态提示词增强",
        "description": "提交异步提示词增强任务。`input.content` 中必须且只能包含一个非空文本项；模型会根据其余媒体项及 `role` 自动选择处理模式。\n\n支持的输入组合：\n- 文生视频提示词：仅包含一个 `text` 项。\n- 图生视频提示词：`text` 加一张首帧或尾帧图片，或者加首帧和尾帧各一张。\n- 多模态参考提示词：`text` 加参考图片、参考视频和参考音频的组合。\n\n图生视频与多模态参考互斥，不能在同一次请求中混用帧图片和参考媒体。\n\n**输入媒体限制**（请求体总大小 ≤ 64 MB，大文件请用公网 URL，勿用 Base64）：\n\n**图片 image_url**：\n| 项 | 限制 |\n|:---|:---|\n| 格式 | JPG、JPEG、PNG、WEBP、HEIC、HEIF |\n| 单文件大小 | ≤ 30 MB |\n| 宽高范围 | [256, 5760] px |\n| 长宽比（宽/高） | [0.4, 2.5] |\n| 数量 | 首帧 ≤ 1、尾帧 ≤ 1、参考图 ≤ 9 |\n\n**视频 video_url**（仅多模态参考场景）：\n| 项 | 限制 |\n|:---|:---|\n| 容器 / 格式 | MP4（.mp4）、MOV（.mov） |\n| 编码 | 视频 H.264/AVC、H.265/HEVC；音频 AAC、MP3 |\n| 单文件大小 | ≤ 50 MB |\n| 个数 | ≤ 3 |\n| 单段时长 | [2, 15] s；总时长 ≤ 15 s |\n| 宽高范围 | [256, 5760] px |\n| 长宽比（宽/高） | [0.4, 2.5] |\n| 帧率 | [23.976, 60] |\n\n**音频 audio_url**（仅多模态参考场景）：\n| 项 | 限制 |\n|:---|:---|\n| 格式 | WAV、MP3 |\n| 单文件大小 | ≤ 15 MB |\n| 个数 | ≤ 3 |\n| 单段时长 | [2, 15] s；总时长 ≤ 15 s |\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MiniMaxH3ContextIRSubmitRequest"
              },
              "examples": {
                "textToVideo": {
                  "summary": "文生视频提示词",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "一只橘猫在阳光下伸懒腰，毛发闪闪发光"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 6,
                      "ratio": "16:9"
                    }
                  }
                },
                "firstFrame": {
                  "summary": "首帧图生视频提示词",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "让图片中的场景动起来，微风轻拂"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/scene.jpg"
                          },
                          "role": "first_frame"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 8,
                      "ratio": "16:9"
                    }
                  }
                },
                "firstAndLastFrame": {
                  "summary": "首尾帧图生视频提示词",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "帮我生成这个水墨画的渐变视频"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/start.jpg"
                          },
                          "role": "first_frame"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/end.jpg"
                          },
                          "role": "last_frame"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 10,
                      "ratio": "16:9"
                    }
                  }
                },
                "referenceImageAndAudio": {
                  "summary": "多模态参考提示词（图片+音频）",
                  "value": {
                    "model": "minimax-h3-context-ir",
                    "input": {
                      "content": [
                        {
                          "type": "text",
                          "text": "参考图片风格和背景音乐，生成一个科幻风格的场景"
                        },
                        {
                          "type": "image_url",
                          "image_url": {
                            "url": "https://example.com/style.jpg"
                          },
                          "role": "reference_image"
                        },
                        {
                          "type": "audio_url",
                          "audio_url": {
                            "url": "https://example.com/bgm.mp3"
                          },
                          "role": "reference_audio"
                        }
                      ]
                    },
                    "parameters": {
                      "duration": 10,
                      "ratio": "9:16"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "任务提交成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRSubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "已提交任务",
                    "value": {
                      "output": {
                        "task_id": "426586401755526",
                        "task_status": "Pending",
                        "submit_time": 1785702855
                      },
                      "request_id": "req_xxxxxxxxxxxxx"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数或输入组合无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/MiniMaxH3ContextIRParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/MiniMaxH3ContextIRParamError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "MiniMax-H3-Context-IR"
        ],
        "operationId": "getMiniMaxH3ContextIRTaskStatus",
        "summary": "MiniMax-H3-Context-IR 提示词增强任务状态",
        "description": "查询异步任务状态。任务成功后，`output.result.prompt` 中会包含增强后的视频提示词。",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "由 `/v1/tasks/submit` 返回的异步任务标识符。",
            "schema": {
              "type": "string"
            },
            "example": "426586401755526"
          }
        ],
        "responses": {
          "200": {
            "description": "任务状态响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRStatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "成功任务",
                    "value": {
                      "output": {
                        "task_id": "426586401755526",
                        "task_status": "Success",
                        "submit_time": 1785702855,
                        "finish_time": 1785702884,
                        "result": {
                          "prompt": "integrated_multimodal_description: [Shot 1] Cinematic, wide shot with a slow push in...\noverall_soundscape: Deep, resonant low-frequency...\nnon_diegetic_music: Symphonic orchestral score..."
                        }
                      },
                      "request_id": "req_def456"
                    }
                  },
                  "failure": {
                    "summary": "失败任务",
                    "value": {
                      "output": {
                        "task_id": "426586401755526",
                        "task_status": "Failure",
                        "submit_time": 1785702855,
                        "finish_time": 1785705540,
                        "error_message": "任务失败原因"
                      },
                      "request_id": "req_def456"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "任务标识或请求参数无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                },
                "examples": {
                  "paramError": {
                    "$ref": "#/components/examples/MiniMaxH3ContextIRParamError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "请在请求头中携带 `Authorization: Bearer {your_api_key}`。"
      }
    },
    "schemas": {
      "MiniMaxH3ContextIRSubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "minimax-h3-context-ir",
            "description": "模型名称。此文档固定为 `minimax-h3-context-ir`。"
          },
          "input": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRInput"
          },
          "parameters": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRParameters"
          }
        }
      },
      "MiniMaxH3ContextIRInput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "content"
        ],
        "properties": {
          "content": {
            "type": "array",
            "minItems": 1,
            "description": "多模态输入数组。必须且只能包含一个非空 `text` 项。\n\n支持的内容类型：\n- `text`: 文本描述（必须且只能有一个）\n- `image_url`: 图片 URL（首帧、尾帧或参考图片）\n- `video_url`: 视频 URL（参考视频）\n- `audio_url`: 音频 URL（参考音频）\n\n图片角色：`first_frame`、`last_frame`、`reference_image`。首帧和尾帧各最多 1 张。\n视频角色：`reference_video`。\n音频角色：`reference_audio`。\n\n首尾帧与多模态参考互斥，不能在同一次请求中混用。\n",
            "items": {
              "oneOf": [
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRTextContent"
                },
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRImageContent"
                },
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRVideoContent"
                },
                {
                  "$ref": "#/components/schemas/MiniMaxH3ContextIRAudioContent"
                }
              ]
            }
          }
        }
      },
      "MiniMaxH3ContextIRTextContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "text"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "text"
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 7000,
            "description": "文本提示词（prompt），必填：所有场景都需包含一个非空 text，描述期望生成的视频。\n按字符数计算长度，单个 text 最多 7000 个字符。\n"
          }
        }
      },
      "MiniMaxH3ContextIRImageContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "image_url"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "image_url"
          },
          "image_url": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRURLObject"
          },
          "role": {
            "type": "string",
            "description": "图片角色。",
            "enum": [
              "first_frame",
              "last_frame",
              "reference_image"
            ]
          }
        },
        "description": "图片仅支持公网 HTTP/HTTPS URL，不支持 Base64。\n"
      },
      "MiniMaxH3ContextIRVideoContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "video_url",
          "role"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "video_url"
          },
          "video_url": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRURLObject"
          },
          "role": {
            "type": "string",
            "const": "reference_video"
          }
        },
        "description": "仅用于多模态参考。支持公网 URL 指向的视频文件。\n"
      },
      "MiniMaxH3ContextIRAudioContent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "type",
          "audio_url",
          "role"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "audio_url"
          },
          "audio_url": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRURLObject"
          },
          "role": {
            "type": "string",
            "const": "reference_audio"
          }
        },
        "description": "仅用于多模态参考。支持公网 URL 指向的音频文件。\n"
      },
      "MiniMaxH3ContextIRURLObject": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://",
            "description": "可由 MiniMax 服务访问的公网 HTTP/HTTPS URL；不支持 Base64 或 data URL。"
          }
        }
      },
      "MiniMaxH3ContextIRParameters": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "duration"
        ],
        "properties": {
          "duration": {
            "type": "integer",
            "minimum": 4,
            "maximum": 15,
            "description": "目标视频时长（秒），必选，整数。\n可用值：4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15\n"
          },
          "ratio": {
            "type": "string",
            "default": "adaptive",
            "enum": [
              "adaptive",
              "21:9",
              "16:9",
              "4:3",
              "1:1",
              "3:4",
              "9:16"
            ],
            "description": "目标视频的宽高比，默认 adaptive。\n\n**文生视频**（content 仅含 text）：ratio 必填，且不能为 adaptive；可用值 21:9、16:9、4:3、1:1、3:4、9:16。\n\n**图生视频**（content 含 first_frame / last_frame 图片）：宽高比由输入图片决定，ratio 恒为 adaptive；传入其他合理值不会报错，但会被忽略并按 adaptive 处理。\n\n**多模态参考**（content 含 reference_image / reference_video / reference_audio）：ratio 可选，默认 adaptive；也可显式指定上述任一具体比例。\n"
          },
          "callback_url": {
            "type": "string",
            "format": "uri",
            "description": "状态变更回调地址（可选）。"
          }
        }
      },
      "MiniMaxH3ContextIRSubmitResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "task_id",
              "task_status",
              "submit_time"
            ],
            "properties": {
              "task_id": {
                "type": "string",
                "description": "异步任务唯一标识。"
              },
              "task_status": {
                "type": "string",
                "description": "任务状态。",
                "enum": [
                  "Pending"
                ]
              },
              "submit_time": {
                "type": "integer",
                "format": "int64",
                "description": "任务提交时间戳（Unix 时间戳，秒级）。"
              }
            }
          },
          "request_id": {
            "type": "string",
            "description": "唯一请求标识。"
          }
        }
      },
      "MiniMaxH3ContextIRStatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRStatusOutput"
          },
          "request_id": {
            "type": "string",
            "description": "唯一请求标识。"
          }
        }
      },
      "MiniMaxH3ContextIRStatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "异步任务唯一标识。"
          },
          "task_status": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRTaskStatus"
          },
          "result": {
            "type": "object",
            "description": "任务成功时返回的结果。",
            "properties": {
              "prompt": {
                "type": "string",
                "description": "增强后的视频提示词，包含以下段落：\n- `integrated_multimodal_description`: 镜头描述、画面构图、动作设计、光影效果\n- `overall_soundscape`: 环境音效、氛围音效描述\n- `non_diegetic_music`: 配乐风格、情绪描述\n"
              }
            }
          },
          "submit_time": {
            "type": "integer",
            "format": "int64",
            "description": "任务提交时间戳（Unix 时间戳，秒级）。"
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "任务完成时间戳（Unix 时间戳，秒级）。"
          },
          "error_message": {
            "type": "string",
            "description": "任务失败时返回的错误信息。"
          }
        }
      },
      "MiniMaxH3ContextIRTaskStatus": {
        "type": "string",
        "description": "异步任务状态。",
        "enum": [
          "Pending",
          "Running",
          "Success",
          "Failure"
        ]
      },
      "MiniMaxH3ContextIRErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/MiniMaxH3ContextIRErrorObject"
          }
        }
      },
      "MiniMaxH3ContextIRErrorObject": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "message",
          "type"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "错误信息。"
          },
          "type": {
            "type": "string",
            "description": "错误类型。"
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "错误码。"
          },
          "param": {
            "type": [
              "string",
              "null"
            ],
            "description": "相关请求参数，如有。"
          }
        }
      }
    },
    "examples": {
      "MiniMaxH3ContextIRParamError": {
        "summary": "参数错误",
        "value": {
          "error": {
            "message": "input.content 中必须且只能包含一个非空 text 项",
            "type": "invalid_request_error",
            "code": "param_error",
            "param": "input.content"
          }
        }
      }
    }
  }
}
```
