> ## 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 H3 Context IR task

> Analyzes the prompt and inputs and returns an enhanced structured video prompt; no video is generated. Query the returned `task_id`; on success read `content.prompt`.



## OpenAPI

````yaml /openapi/en/minimax-h3.json post /v2/h3_context_ir
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/h3_context_ir:
    post:
      tags:
        - MiniMax H3
      summary: Create H3 Context IR task
      description: >-
        Analyzes the prompt and inputs and returns an enhanced structured video
        prompt; no video is generated. Query the returned `task_id`; on success
        read `content.prompt`.
      operationId: minimaxCreateContextIR
      requestBody:
        content:
          application/json:
            examples:
              Context IR · text to video:
                description: Enhance a text-only prompt.
                summary: Context IR · text to video
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: >-
                        A ginger cat runs through puddles on a neon-lit street
                        at night.
                  duration: 5
                  ratio: '16:9'
              Context IR · image to video:
                description: Enhance a prompt together with a first-frame image.
                summary: Context IR · image to video
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: The character turns to face the camera.
                    - type: image_url
                      image_url:
                        url: https://your-cdn.example.com/first-frame.jpg
                      role: first_frame
                  duration: 5
                  ratio: adaptive
              Context IR · multimodal reference:
                description: Enhance a prompt with a reference video and audio.
                summary: Context IR · multimodal reference
                value:
                  model: MiniMax-H3
                  content:
                    - type: text
                      text: Follow the motion of video 1 and the voice of 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
                  duration: 5
            schema:
              $ref: '#/components/schemas/MiniMaxV2ContextIRRequest'
        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:
    MiniMaxV2ContextIRRequest:
      additionalProperties: false
      description: >-
        Request body of an H3 Context IR task, which analyzes the inputs and
        returns an enhanced structured prompt instead of a video.
      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 with exactly one non-empty `text` item; media rules are
            the same as for video generation.
          items:
            $ref: '#/components/schemas/MiniMaxV2ContentItem'
          minItems: 1
          type: array
        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
      required:
        - model
        - content
        - 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.