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

# MiniMax-H3

> MiniMax H3 multimodal video generation and task query API.

MiniMax-H3 provides asynchronous multimodal video generation. Create a task with `POST /v2/video_generation`, then query it with `GET /v2/query/video_generation/{task_id}`.

<Tabs sync={false}>
  <Tab title="Create video generation task">
    ## Create task

    `POST /v2/video_generation`

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request POST \
        --url https://www.anyfast.ai/v2/video_generation \
        --header 'Authorization: Bearer YOUR_API_KEY' \
        --header 'Content-Type: application/json' \
        --data '{
          "model": "MiniMax-H3",
          "content": [
            {
              "type": "text",
              "text": "史诗级太空歌剧院线预告：女舰长独自站在巨大观景窗前，最后一支舰队正在集结并跃迁离去。"
            }
          ],
          "resolution": "2K",
          "duration": 5,
          "ratio": "16:9"
        }'
      ```

      ```json 200 theme={null}
      {
        "task_id": "424010985738629"
      }
      ```
    </div>

    ## Request headers

    <ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>
    <ParamField header="Content-Type" type="string" default="application/json" required>Request body format.</ParamField>

    ## Request parameters

    <ParamField body="model" type="string" required>Use `MiniMax-H3`.</ParamField>
    <ParamField body="content" type="object[]" required>Multimodal content parts. Each item uses `text`, `image_url`, `video_url`, or `audio_url`.</ParamField>
    <ParamField body="content[].type" type="string" required>Content type: `text`, `image_url`, `video_url`, or `audio_url`.</ParamField>
    <ParamField body="content[].text" type="string">Text prompt. A text part is required for video generation.</ParamField>
    <ParamField body="content[].role" type="string">Media role such as `first_frame`, `last_frame`, `reference_image`, `reference_video`, or `reference_audio`.</ParamField>
    <ParamField body="content[].image_url.url" type="string">Public image URL. Base64 is not supported.</ParamField>
    <ParamField body="content[].video_url.url" type="string">Public video URL for multimodal reference input.</ParamField>
    <ParamField body="content[].audio_url.url" type="string">Public audio URL for multimodal reference input.</ParamField>
    <ParamField body="resolution" type="string" required>Currently `2K`.</ParamField>
    <ParamField body="duration" type="integer" required>Video duration in seconds, from 4 to 15.</ParamField>
    <ParamField body="ratio" type="string">`adaptive`, `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, or `9:16`. Text-to-video requires an explicit ratio.</ParamField>
    <ParamField body="callback_url" type="string">Optional callback URL for task status updates.</ParamField>
    <ParamField body="aigc_watermark" type="boolean" default="false">Whether to add an AIGC watermark.</ParamField>

    ### Content rules

    * Text-to-video accepts one text part.
    * Image-to-video accepts a first frame, last frame, or both. Use `first_frame` and `last_frame` roles when supplying both.
    * Reference-to-video can combine reference images, video, and audio, but must include at least one reference image or video; audio alone is not sufficient.
    * First/last-frame roles cannot be mixed with reference-media roles.
    * The total request body is limited to 64 MB. Images support JPG, JPEG, PNG, WEBP, HEIC, and HEIF; each image is limited to 30 MB.
    * Reference videos support MP4/MOV, H.264/H.265, and AAC/MP3 audio; each is limited to 50 MB and 2-15 seconds. Reference audio supports WAV/MP3 and is limited to 15 MB and 2-15 seconds.

    ## Response

    <ResponseField name="task_id" type="string">Video generation task ID. Use it with the query endpoint.</ResponseField>
  </Tab>

  <Tab title="Query video generation task">
    ## Query task

    `GET /v2/query/video_generation/{task_id}`

    <div className="kling-api-example-panel happyhorse-api-example-panel">
      ```bash cURL theme={null}
      curl --request GET \
        --url https://www.anyfast.ai/v2/query/video_generation/TASK_ID \
        --header 'Authorization: Bearer YOUR_API_KEY'
      ```

      ```json 200 theme={null}
      {
        "task": {
          "id": "424010985738629",
          "model": "MiniMax-H3",
          "status": "succeeded",
          "created_at": 1785125529,
          "updated_at": 1785125946,
          "content": {
            "url": "https://cdn.hailuoai.com/example/video.mp4"
          },
          "resolution": "2K",
          "duration": 5,
          "usage": {
            "total_seconds": 5,
            "input_seconds": 0,
            "output_seconds": 5,
            "image_count": 0
          },
          "ratio": "16:9",
          "task_type": "generation"
        }
      }
      ```
    </div>

    ## Request headers

    <ParamField header="Authorization" type="string" required>Bearer authentication in the form `Bearer YOUR_API_KEY`.</ParamField>

    ## Path parameters

    <ParamField path="task_id" type="string" required>Video generation task ID returned by the create endpoint.</ParamField>

    ## Response fields

    <ResponseField name="task" type="object">Queried video generation task.</ResponseField>
    <ResponseField name="task.id" type="string">Task ID.</ResponseField>
    <ResponseField name="task.model" type="string">Model used for the task.</ResponseField>
    <ResponseField name="task.status" type="string">Task status: `queued`, `running`, `succeeded`, `failed`, or `expired`.</ResponseField>
    <ResponseField name="task.created_at" type="integer">Task creation time as a Unix timestamp.</ResponseField>
    <ResponseField name="task.updated_at" type="integer">Task update time as a Unix timestamp.</ResponseField>
    <ResponseField name="task.content.url" type="string">Generated video URL when the task succeeds.</ResponseField>
    <ResponseField name="task.resolution" type="string">Output resolution.</ResponseField>
    <ResponseField name="task.duration" type="integer">Output duration in seconds.</ResponseField>
    <ResponseField name="task.usage" type="object">Usage metrics for the task.</ResponseField>
    <ResponseField name="task.usage.total_seconds" type="number">Total billed or processed seconds.</ResponseField>
    <ResponseField name="task.usage.input_seconds" type="number">Input media duration in seconds.</ResponseField>
    <ResponseField name="task.usage.output_seconds" type="number">Output video duration in seconds.</ResponseField>
    <ResponseField name="task.usage.image_count" type="integer">Number of input images.</ResponseField>
    <ResponseField name="task.ratio" type="string">Output aspect ratio.</ResponseField>
    <ResponseField name="task.task_type" type="string">Task type, such as `generation`.</ResponseField>
  </Tab>
</Tabs>

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