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

# 创建视频再生成任务

> 把 MiniMax-H3 768P 视频再生成为 2K。可按任务 Id（`source_task_id`）或按源视频（`content` 中的 `base_video`）提交，二者必须且只能提供其一。返回的 `task_id` 用查询任务接口查询，`task_type` 为 `regeneration`。



## OpenAPI

````yaml /openapi/zh/minimax-h3.json post /v2/video_regeneration
openapi: 3.1.0
info:
  description: MiniMax H3 视频生成：创建视频生成、视频再生成（768P → 2K）和 H3 Context IR 任务，并查询任务结果。
  title: MiniMax H3 视频生成 API
  version: v2
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: MiniMax H3
paths:
  /v2/video_regeneration:
    post:
      tags:
        - MiniMax H3
      summary: 创建视频再生成任务
      description: >-
        把 MiniMax-H3 768P 视频再生成为 2K。可按任务 Id（`source_task_id`）或按源视频（`content` 中的
        `base_video`）提交，二者必须且只能提供其一。返回的 `task_id` 用查询任务接口查询，`task_type` 为
        `regeneration`。
      operationId: minimaxCreateVideoRegeneration
      requestBody:
        content:
          application/json:
            examples:
              按任务 Id 再生成:
                description: 用 7 天内成功的 768P 生成任务的 `task_id`。
                summary: 按任务 Id 再生成
                value:
                  model: MiniMax-H3
                  source_task_id: task_7Rk2mQ9vXc4LpT8nWb3sYh6dZf1aGe5J
                  resolution: 2K
              按源视频再生成:
                description: 提交源视频及生成它时的最终提示词。
                summary: 按源视频再生成
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: <生成源视频时使用的最终提示词>
                    - type: video_url
                      video_url:
                        url: https://your-cdn.example.com/h3-768p.mp4
                      role: base_video
                  resolution: 2K
              按源视频再生成（图生）:
                description: 源视频由图生视频得到时，同时提交首帧图片。
                summary: 按源视频再生成（图生）
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: <生成源视频时使用的最终提示词>
                    - type: image_url
                      image_url:
                        url: https://your-cdn.example.com/first-frame.jpg
                      role: first_frame
                    - type: video_url
                      video_url:
                        url: https://your-cdn.example.com/h3-768p.mp4
                      role: base_video
                  resolution: 2K
            schema:
              $ref: '#/components/schemas/MiniMaxV2VideoRegenerationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                example:
                  value:
                    task_id: task_7Rk2mQ9vXc4LpT8nWb3sYh6dZf1aGe5J
              schema:
                $ref: '#/components/schemas/MiniMaxV2CreateTaskResponse'
          description: 任务已创建。
          headers:
            X-Request-Id:
              description: 请求 Id，联系支持时请提供。
              schema:
                type: string
        '400':
          content:
            application/json:
              examples:
                example:
                  value:
                    type: error
                    error:
                      type: bad_request_error
                      message: >-
                        invalid params, content must include a non-empty text
                        item (prompt is required) (2013)
                      http_code: '400'
                    request_id: 20261205112532258615475826d9d6AbCdEfGh
              schema:
                $ref: '#/components/schemas/MiniMaxV2ErrorResponse'
          description: 参数错误，或任务 Id 无效。
        '401':
          content:
            application/json:
              examples:
                example:
                  value:
                    type: error
                    error:
                      type: authorized_error
                      message: >-
                        login fail: Please carry the API secret key in the
                        'Authorization' field of the request header (1004)
                      http_code: '401'
                    request_id: 20261205112532258615475826d9d6AbCdEfGh
              schema:
                $ref: '#/components/schemas/MiniMaxV2ErrorResponse'
          description: 缺少或无效的 API Key。
        '402':
          content:
            application/json:
              examples:
                example:
                  value:
                    type: error
                    error:
                      type: insufficient_balance_error
                      message: insufficient balance (1008)
                      http_code: '402'
                    request_id: 20261205112532258615475826d9d6AbCdEfGh
              schema:
                $ref: '#/components/schemas/MiniMaxV2ErrorResponse'
          description: 账户余额不足。
        '422':
          content:
            application/json:
              examples:
                example:
                  value:
                    type: error
                    error:
                      type: unprocessable_entity_error
                      message: video description contains sensitive content (1026)
                      http_code: '422'
                    request_id: 20261205112532258615475826d9d6AbCdEfGh
              schema:
                $ref: '#/components/schemas/MiniMaxV2ErrorResponse'
          description: 输入内容不合规。
        '429':
          content:
            application/json:
              examples:
                example:
                  value:
                    type: error
                    error:
                      type: rate_limit_error
                      message: rate limit, please retry later (1002)
                      http_code: '429'
                    request_id: 20261205112532258615475826d9d6AbCdEfGh
              schema:
                $ref: '#/components/schemas/MiniMaxV2ErrorResponse'
          description: 触发限流，稍后重试。
        '500':
          content:
            application/json:
              examples:
                example:
                  value:
                    type: error
                    error:
                      type: server_error
                      message: internal error (1000)
                      http_code: '500'
                    request_id: 20261205112532258615475826d9d6AbCdEfGh
              schema:
                $ref: '#/components/schemas/MiniMaxV2ErrorResponse'
          description: 服务端错误，稍后重试。
        '529':
          content:
            application/json:
              examples:
                example:
                  value:
                    type: error
                    error:
                      type: overloaded_error
                      message: the service is overloaded, please retry later (1000)
                      http_code: '529'
                    request_id: 20261205112532258615475826d9d6AbCdEfGh
              schema:
                $ref: '#/components/schemas/MiniMaxV2ErrorResponse'
          description: 服务繁忙，稍后重试。
components:
  schemas:
    MiniMaxV2VideoRegenerationRequest:
      additionalProperties: false
      description: >-
        创建视频再生成任务的请求体：把符合 MiniMax-H3 768P 输出规格的视频再生成为 2K。`source_task_id` 与
        `content` 必须且只能提供其一。
      properties:
        model:
          default: MiniMax-H3
          description: |-
            模型名称，固定为 `MiniMax-H3`。

            **可选值：**
            - `MiniMax-H3`：MiniMax H3 旗舰版。
          enum:
            - MiniMax-H3
          type: string
        source_task_id:
          description: >-
            按任务 Id 再生成：本账号 7 天内创建、状态为 `succeeded` 的 `/v2/video_generation` 任务
            `task_id`。不能与 `content` 同时传。
          type: string
        content:
          description: >-
            按源视频再生成：必须且只能有一个 `role` 为 `base_video` 的
            `video_url`（源视频），并原样提交生成该视频时的最终提示词和全部素材。源视频需有音轨、24 fps、宽高可被 32
            整除、像素面积 768×768 ~ 768×1344、总帧数 107 ~ 362。不能与 `source_task_id` 同时传。
          items:
            $ref: '#/components/schemas/MiniMaxV2RegenerationContentItem'
          type: array
        resolution:
          default: 2K
          description: |-
            输出分辨率，固定为 `2K`。

            **可选值：**
            - `2K`：2K。
          enum:
            - 2K
          type: string
        aigc_watermark:
          default: false
          description: 是否在视频中添加 AIGC 标识水印，默认 `false`。
          type: boolean
      required:
        - model
        - resolution
      type: object
    MiniMaxV2CreateTaskResponse:
      additionalProperties: false
      description: 创建成功的响应。
      properties:
        task_id:
          description: 任务 Id，用于查询任务。
          type: string
      required:
        - task_id
      type: object
    MiniMaxV2ErrorResponse:
      additionalProperties: false
      description: 错误响应。HTTP 状态码即错误码。
      properties:
        type:
          description: 固定为 `error`。
          type: string
        error:
          $ref: '#/components/schemas/MiniMaxV2ErrorDetail'
          description: 错误详情。
        request_id:
          description: 请求 Id，与响应头 `X-Request-Id` 相同，联系支持时请提供。
          type: string
      required:
        - type
        - error
        - request_id
      type: object
    MiniMaxV2RegenerationContentItem:
      additionalProperties: false
      description: 视频再生成的输入项，比普通输入项多一个 `base_video` 用途。
      properties:
        type:
          description: |-
            内容项类型。

            **可选值：**
            - `text`：文本提示词，填 `text`。
            - `image_url`：图片，填 `image_url.url`。
            - `video_url`：视频，填 `video_url.url`。
            - `audio_url`：音频，填 `audio_url.url`。
          enum:
            - text
            - image_url
            - video_url
            - audio_url
          type: string
        text:
          description: >-
            提示词，`type` 为 `text` 时必填且不能为空。生成与 Context IR 最多 7000 个字符，视频再生成最多
            40000 个字符。
          type: string
        image_url:
          $ref: '#/components/schemas/MiniMaxV2MediaURL'
          description: >-
            图片，`type` 为 `image_url` 时必填。支持 JPG / JPEG / PNG / WEBP / HEIC /
            HEIF，单张 ≤ 30 MB，宽高 256 ~ 5760 像素，宽高比 0.4 ~ 2.5。
        video_url:
          $ref: '#/components/schemas/MiniMaxV2MediaURL'
          description: >-
            视频，`type` 为 `video_url` 时必填。MP4 / MOV（H.264 或 H.265），单个 ≤ 50 MB，每段 2
            ~ 15 秒且总时长 ≤ 15 秒，帧率 23.976 ~ 60 fps。
        audio_url:
          $ref: '#/components/schemas/MiniMaxV2MediaURL'
          description: >-
            音频，`type` 为 `audio_url` 时必填。WAV / MP3，单个 ≤ 15 MB，每段 2 ~ 15 秒且总时长 ≤
            15 秒。
        role:
          description: |-
            素材用途。源视频必须为 `base_video`，其余与普通输入项相同。

            **可选值：**
            - `base_video`：再生成的源视频，必须且只能有 1 个。
            - `first_frame`：生成源视频时使用的首帧图片。
            - `last_frame`：生成源视频时使用的尾帧图片。
            - `reference_image`：生成源视频时使用的参考图片。
            - `reference_video`：生成源视频时使用的参考视频。
            - `reference_audio`：生成源视频时使用的参考音频。
          enum:
            - base_video
            - first_frame
            - last_frame
            - reference_image
            - reference_video
            - reference_audio
          type: string
      required:
        - type
      type: object
    MiniMaxV2ErrorDetail:
      additionalProperties: false
      description: 错误详情。
      properties:
        type:
          description: |-
            错误类别。

            **可选值：**
            - `bad_request_error`：参数错误（400）。
            - `authorized_error`：鉴权失败（401 / 403）。
            - `insufficient_balance_error`：余额不足（402）。
            - `unprocessable_entity_error`：输入内容不合规（422）。
            - `rate_limit_error`：触发限流（429），稍后重试。
            - `server_error`：服务端错误（500），稍后重试。
            - `overloaded_error`：服务繁忙（529），稍后重试。
          enum:
            - bad_request_error
            - authorized_error
            - insufficient_balance_error
            - unprocessable_entity_error
            - rate_limit_error
            - server_error
            - overloaded_error
          type: string
        message:
          description: 错误说明，末尾括号内为错误码，例如 `(2013)`。
          type: string
        http_code:
          description: HTTP 状态码（字符串）。
          type: string
      required:
        - type
        - message
        - http_code
      type: object
    MiniMaxV2MediaURL:
      additionalProperties: false
      description: 素材地址。
      properties:
        url:
          description: >-
            公网 `http(s)` 地址，或 `data:<类型>;base64,<数据>` 形式的 Base64（格式小写）。不支持
            `mm_file://`。请求体总大小 ≤ 64 MB，较大的文件请使用公网地址。
          minLength: 1
          type: string
      required:
        - url
      type: object
  securitySchemes:
    bearerAuth:
      description: '在请求头 `Authorization: Bearer <API Key>` 中携带 DreamTo API Key。'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.