> ## 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.

# Create video generation task

> Creates an asynchronous video generation task: text-to-video, image-to-video (first frame / last frame / both) or multimodal reference-to-video. Returns a `task_id`; poll the query endpoint for the result. Invalid parameters return 400 without creating or charging a task; failed tasks are not charged.



## OpenAPI

````yaml /openapi/en/minimax-h3.json post /v2/video_generation
openapi: 3.1.0
info:
  description: >-
    MiniMax H3 video generation: create generation, regeneration (768P → 2K) and
    H3 Context IR tasks, and query their results.
  title: MiniMax H3 Video API
  version: v2
servers:
  - url: https://api.dreamto.ai
security:
  - bearerAuth: []
tags:
  - name: MiniMax H3
paths:
  /v2/video_generation:
    post:
      tags:
        - MiniMax H3
      summary: Create video generation task
      description: >-
        Creates an asynchronous video generation task: text-to-video,
        image-to-video (first frame / last frame / both) or multimodal
        reference-to-video. Returns a `task_id`; poll the query endpoint for the
        result. Invalid parameters return 400 without creating or charging a
        task; failed tasks are not charged.
      operationId: minimaxCreateVideoGeneration
      requestBody:
        content:
          application/json:
            examples:
              Text to video:
                description: Prompt only; `ratio` is required and cannot be `adaptive`.
                summary: Text to video
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: >-
                        Epic space-opera teaser: a captain stands alone at a
                        vast observation window as the last fleet jumps away in
                        a blinding flash, the bridge shaking.
                  resolution: 2K
                  duration: 5
                  ratio: '16:9'
              Image to video (first frame):
                description: The image is the first frame; the ratio follows the image.
                summary: Image to video (first frame)
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: Slow push-in as steam rises from the ramen bowl.
                    - type: image_url
                      image_url:
                        url: https://your-cdn.example.com/first-frame.jpg
                      role: first_frame
                  resolution: 768P
                  duration: 5
                  ratio: adaptive
              First and last frame:
                description: Transition from the first frame to the last frame.
                summary: First and last frame
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: >-
                        The character walks from the window to the door; the
                        camera follows.
                    - type: image_url
                      image_url:
                        url: https://your-cdn.example.com/first-frame.jpg
                      role: first_frame
                    - type: image_url
                      image_url:
                        url: https://your-cdn.example.com/last-frame.jpg
                      role: last_frame
                  resolution: 768P
                  duration: 6
                  ratio: adaptive
              Multimodal reference:
                description: >-
                  Follow the motion of a reference video and the voice of a
                  reference audio.
                summary: Multimodal reference
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: >-
                        The character says: Follow the wind, live free. Voice
                        follows audio 1.
                    - type: video_url
                      video_url:
                        url: https://your-cdn.example.com/reference.mp4
                      role: reference_video
                    - type: audio_url
                      audio_url:
                        url: https://your-cdn.example.com/voice.mp3
                      role: reference_audio
                  resolution: 2K
                  duration: 5
                  ratio: adaptive
              Reference images:
                description: >-
                  Keep characters and scenes consistent with up to 9 reference
                  images.
                summary: Reference images
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: The girl from image 1 runs down the street from image 2.
                    - type: image_url
                      image_url:
                        url: https://your-cdn.example.com/girl.png
                      role: reference_image
                    - type: image_url
                      image_url:
                        url: https://your-cdn.example.com/street.png
                      role: reference_image
                  resolution: 768P
                  duration: 8
                  ratio: '16:9'
            schema:
              $ref: '#/components/schemas/MiniMaxV2VideoGenerationRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              examples:
                example:
                  value:
                    task_id: task_7Rk2mQ9vXc4LpT8nWb3sYh6dZf1aGe5J
              schema:
                $ref: '#/components/schemas/MiniMaxV2CreateTaskResponse'
          description: Task created.
          headers:
            X-Request-Id:
              description: Request ID. Include it when contacting support.
              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: Invalid parameters, or an invalid task 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: Missing or invalid 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: Insufficient balance.
        '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: The input contains sensitive content.
        '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: Rate limited; retry later.
        '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: Server error; retry later.
        '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: Overloaded; retry later.
components:
  schemas:
    MiniMaxV2VideoGenerationRequest:
      additionalProperties: false
      description: Request body of a video generation task.
      properties:
        model:
          default: MiniMax-H3
          description: |-
            Model name. Must be `MiniMax-H3`.

            **Allowed values:**
            - `MiniMax-H3`: MiniMax H3 flagship model.
          enum:
            - MiniMax-H3
          type: string
        content:
          description: >-
            Input items. Must include a non-empty `text` item (the prompt);
            images, videos and audio are told apart by `role`. Frame roles
            (`first_frame` / `last_frame`) cannot be combined with reference
            roles (`reference_image` / `reference_video` / `reference_audio`).
          items:
            $ref: '#/components/schemas/MiniMaxV2ContentItem'
          minItems: 1
          type: array
        resolution:
          description: |-
            Output resolution.

            **Allowed values:**
            - `768P`: 768P.
            - `2K`: 2K.
          enum:
            - 768P
            - 2K
          type: string
        duration:
          description: Video duration in seconds, an integer from `4` to `15`.
          format: int64
          maximum: 15
          minimum: 4
          type: integer
        ratio:
          default: adaptive
          description: >-
            Aspect ratio. Required for text-to-video and cannot be `adaptive`;
            image-to-video always follows the input image (other values are
            ignored); multimodal reference defaults to `adaptive`.


            **Allowed values:**

            - `adaptive`: Adaptive: image-to-video follows the input image,
            reference-to-video is decided by the model. Not available for
            text-to-video.

            - `21:9`: 21:9 ultra-wide.

            - `16:9`: 16:9 landscape.

            - `4:3`: 4:3 landscape.

            - `1:1`: 1:1 square.

            - `3:4`: 3:4 portrait.

            - `9:16`: 9:16 portrait.
          enum:
            - adaptive
            - '21:9'
            - '16:9'
            - '4:3'
            - '1:1'
            - '3:4'
            - '9:16'
          type: string
        aigc_watermark:
          default: false
          description: Whether to add an AIGC watermark to the video. Defaults to `false`.
          type: boolean
        response_format:
          default: task
          description: |-
            Shape of the query response for this task. Defaults to `task`.

            **Allowed values:**
            - `task`: Task fields are nested under `task`.
            - `flat`: Task fields are at the top level.
          enum:
            - task
            - flat
          type: string
      required:
        - model
        - content
        - resolution
        - duration
      type: object
    MiniMaxV2CreateTaskResponse:
      additionalProperties: false
      description: Response of a successful create call.
      properties:
        task_id:
          description: Task ID, used to query the task.
          type: string
      required:
        - task_id
      type: object
    MiniMaxV2ErrorResponse:
      additionalProperties: false
      description: Error response. The HTTP status is the error code.
      properties:
        type:
          description: Always `error`.
          type: string
        error:
          $ref: '#/components/schemas/MiniMaxV2ErrorDetail'
          description: Error details.
        request_id:
          description: >-
            Request ID, equal to the `X-Request-Id` header. Include it when
            contacting support.
          type: string
      required:
        - type
        - error
        - request_id
      type: object
    MiniMaxV2ContentItem:
      additionalProperties: false
      description: 'One input: text, image, video or audio.'
      properties:
        type:
          description: |-
            Item type.

            **Allowed values:**
            - `text`: Text prompt in `text`.
            - `image_url`: Image in `image_url.url`.
            - `video_url`: Video in `video_url.url`.
            - `audio_url`: Audio in `audio_url.url`.
          enum:
            - text
            - image_url
            - video_url
            - audio_url
          type: string
        text:
          description: >-
            The prompt; required and non-empty when `type` is `text`. Up to 7000
            characters for generation and Context IR, 40000 for regeneration.
          type: string
        image_url:
          $ref: '#/components/schemas/MiniMaxV2MediaURL'
          description: >-
            The image; required when `type` is `image_url`. JPG / JPEG / PNG /
            WEBP / HEIC / HEIF, up to 30 MB, 256–5760 px per side, aspect ratio
            0.4–2.5.
        video_url:
          $ref: '#/components/schemas/MiniMaxV2MediaURL'
          description: >-
            The video; required when `type` is `video_url`. MP4 / MOV (H.264 or
            H.265), up to 50 MB, 2–15 s per clip and 15 s in total, 23.976–60
            fps.
        audio_url:
          $ref: '#/components/schemas/MiniMaxV2MediaURL'
          description: >-
            The audio; required when `type` is `audio_url`. WAV / MP3, up to 15
            MB, 2–15 s per clip and 15 s in total.
        role:
          description: >-
            What the item is used for. A single image without a role is treated
            as `first_frame`; with several images every image needs a role.
            `video_url` requires `reference_video`, `audio_url` requires
            `reference_audio`, and `text` takes no role.


            **Allowed values:**

            - `first_frame`: First-frame image (image-to-video), at most 1.

            - `last_frame`: Last-frame image, at most 1; pair with a first frame
            for first-and-last-frame generation.

            - `reference_image`: Reference image (multimodal reference), at most
            9.

            - `reference_video`: Reference video (multimodal reference), at most
            3.

            - `reference_audio`: Reference audio (multimodal reference), at most
            3.
          enum:
            - first_frame
            - last_frame
            - reference_image
            - reference_video
            - reference_audio
          type: string
      required:
        - type
      type: object
    MiniMaxV2ErrorDetail:
      additionalProperties: false
      description: Error details.
      properties:
        type:
          description: >-
            Error category.


            **Allowed values:**

            - `bad_request_error`: Invalid parameters (400).

            - `authorized_error`: Authentication failed (401 / 403).

            - `insufficient_balance_error`: Insufficient balance (402).

            - `unprocessable_entity_error`: Input contains sensitive content
            (422).

            - `rate_limit_error`: Rate limited (429); retry later.

            - `server_error`: Server error (500); retry later.

            - `overloaded_error`: Overloaded (529); retry later.
          enum:
            - bad_request_error
            - authorized_error
            - insufficient_balance_error
            - unprocessable_entity_error
            - rate_limit_error
            - server_error
            - overloaded_error
          type: string
        message:
          description: >-
            Error message; the trailing number in parentheses is the error code,
            e.g. `(2013)`.
          type: string
        http_code:
          description: HTTP status as a string.
          type: string
      required:
        - type
        - message
        - http_code
      type: object
    MiniMaxV2MediaURL:
      additionalProperties: false
      description: Media location.
      properties:
        url:
          description: >-
            A public `http(s)` URL or a `data:<type>;base64,<data>` URL
            (lowercase format). `mm_file://` is not supported. The whole request
            body is limited to 64 MB, so use public URLs for large files.
          minLength: 1
          type: string
      required:
        - url
      type: object
  securitySchemes:
    bearerAuth:
      description: >-
        Send your DreamTo API Key in the `Authorization: Bearer <API Key>`
        header.
      scheme: bearer
      type: http

````

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