> ## 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 创建视频任务

> 使用文本、图片、视频或音频参考素材创建 MiniMax-H3 视频生成任务。

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


## OpenAPI

````yaml api-reference/model-api/minimax/openapi/minimax-h3/openapi.yaml POST /minimax/v2/video_generation
openapi: 3.1.0
info:
  title: MiniMax-H3 视频生成 API
  description: 通过 AnyFast 创建并查询 MiniMax-H3 多模态视频生成任务。
  version: 1.0.0
servers:
  - url: https://www.anyfast.com.cn
security:
  - bearerAuth: []
tags:
  - name: MiniMax-H3
    description: MiniMax-H3 视频生成任务
paths:
  /minimax/v2/video_generation:
    post:
      tags:
        - MiniMax-H3
      summary: 创建视频生成任务
      description: |
        创建异步 MiniMax-H3 视频生成任务。`content` 必须且只能包含一个非空文本项，
        并可按输入模式添加首尾帧或多模态参考素材。创建成功后使用返回的 `task_id` 查询结果。
      operationId: createMiniMaxH3VideoGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateVideoRequest'
            examples:
              textToVideo:
                summary: 文生视频
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: 电影感航拍镜头，清晨的云海缓慢掠过雪山，光线柔和
                  resolution: 768P
                  duration: 6
                  ratio: '16:9'
                  aigc_watermark: false
              imageToVideo:
                summary: 首帧图生视频
                value:
                  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
              multimodalReference:
                summary: 多模态参考生成
                value:
                  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
      responses:
        '200':
          description: 任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateVideoResponse'
              example:
                task_id: '1234567890'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/ServerError'
components:
  schemas:
    CreateVideoRequest:
      type: object
      required:
        - model
        - content
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - MiniMax-H3
          description: 模型 ID，固定为 `MiniMax-H3`。
          example: MiniMax-H3
        content:
          type: array
          minItems: 1
          maxItems: 12
          description: |
            提示词与媒体输入列表，合计最多 12 项。必须且只能包含一个非空 `text` 项。
            首帧/尾帧模式不能与参考图片、参考视频或参考音频模式混用。
          items:
            oneOf:
              - $ref: '#/components/schemas/TextContent'
              - $ref: '#/components/schemas/ImageContent'
              - $ref: '#/components/schemas/VideoContent'
              - $ref: '#/components/schemas/AudioContent'
        resolution:
          type: string
          enum:
            - 768P
            - 2K
          default: 768P
          description: 输出视频分辨率。
          example: 768P
        duration:
          type: integer
          minimum: 4
          maximum: 15
          default: 6
          description: 输出视频时长，单位为秒。
          example: 6
        ratio:
          type: string
          enum:
            - adaptive
            - '21:9'
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
          default: adaptive
          description: |
            输出宽高比。纯文本生成视频时不能使用 `adaptive`，必须指定明确比例；
            图生视频或参考素材模式可以使用 `adaptive`。
          example: '16:9'
        callback_url:
          type: string
          format: uri
          description: 接收任务状态通知的 HTTPS 回调地址。
          example: https://example.com/webhooks/minimax
        aigc_watermark:
          type: boolean
          default: false
          description: 是否在输出视频中添加 AIGC 水印。
          example: false
    CreateVideoResponse:
      type: object
      required:
        - task_id
      properties:
        task_id:
          type: string
          description: 视频生成任务 ID，用于后续查询。
          example: '1234567890'
    TextContent:
      type: object
      title: 文本提示词
      required:
        - type
        - text
      additionalProperties: false
      properties:
        type:
          type: string
          const: text
          description: 内容类型，固定为 `text`。
        text:
          type: string
          minLength: 1
          description: 视频生成提示词。`content` 中必须且只能有一个非空文本项。
          example: 一只猫在阳光充足的房间里弹钢琴
    ImageContent:
      type: object
      title: 图片输入
      required:
        - type
        - image_url
        - role
      additionalProperties: false
      properties:
        type:
          type: string
          const: image_url
          description: 内容类型，固定为 `image_url`。
        image_url:
          $ref: '#/components/schemas/MediaUrl'
        role:
          type: string
          enum:
            - first_frame
            - last_frame
            - reference_image
          description: |
            图片用途。首帧最多 1 张、尾帧最多 1 张、参考图片最多 9 张。
            首尾帧角色不能与参考角色混用。
          example: first_frame
    VideoContent:
      type: object
      title: 参考视频输入
      required:
        - type
        - video_url
        - role
      additionalProperties: false
      properties:
        type:
          type: string
          const: video_url
          description: 内容类型，固定为 `video_url`。
        video_url:
          $ref: '#/components/schemas/MediaUrl'
        role:
          type: string
          const: reference_video
          description: 视频用途，固定为 `reference_video`。最多 3 个，总时长不超过 15 秒。
    AudioContent:
      type: object
      title: 参考音频输入
      required:
        - type
        - audio_url
        - role
      additionalProperties: false
      properties:
        type:
          type: string
          const: audio_url
          description: 内容类型，固定为 `audio_url`。
        audio_url:
          $ref: '#/components/schemas/MediaUrl'
        role:
          type: string
          const: reference_audio
          description: 音频用途，固定为 `reference_audio`。最多 3 个，总时长不超过 15 秒。
    ErrorResponse:
      type: object
      properties:
        error:
          oneOf:
            - type: object
              properties:
                code:
                  oneOf:
                    - type: string
                    - type: integer
                message:
                  type: string
            - type: string
          description: 错误详情。
        message:
          type: string
          description: 错误信息。
    MediaUrl:
      type: object
      required:
        - url
      additionalProperties: false
      properties:
        url:
          type: string
          format: uri
          description: 可通过公网访问的媒体文件 URL。
          example: https://example.com/reference.jpg
  responses:
    BadRequest:
      description: 请求参数有误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: API Key 缺失或无效
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: 请求频率超限
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServerError:
      description: 服务端错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 使用 `Bearer YOUR_API_KEY` 格式传入 AnyFast API Key。

````