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

# MiniMax H3

> MiniMax H3 video generation parameters, multimodal inputs, and output settings.

`MiniMax-H3` supports text-to-video, frame-based image-to-video, and multimodal reference generation. Keep `model` and `prompt` at the root and place the provider's content and output controls in `metadata`.

`POST https://api.mixroute.ai/v1/video/generations`

## Request Parameters

| Field                   | Type      | Required    | Description                                                                                                                                                                                                                                                                 |
| ----------------------- | --------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `model`                 | string    | Yes         | Use the case-sensitive MixRoute model ID `MiniMax-H3`.                                                                                                                                                                                                                      |
| `prompt`                | string    | Yes         | MixRoute prompt, consistent with the text in `metadata.content`.                                                                                                                                                                                                            |
| `metadata`              | object    | Yes         | Container for the required provider fields below.                                                                                                                                                                                                                           |
| `metadata.content`      | object\[] | Yes         | Multimodal input list. Every request must contain at least one nonempty `text` item. Text-only generation uses one text item; image/video/audio inputs must follow the mode rules below.                                                                                    |
| `metadata.resolution`   | string    | Yes         | Output resolution: `768P` or `2K`, with exact capitalization. Supply an explicit value.                                                                                                                                                                                     |
| `metadata.duration`     | integer   | Yes         | Output duration in whole seconds, from 4 through 15 inclusive. Supply an explicit value.                                                                                                                                                                                    |
| `metadata.ratio`        | string    | Conditional | Values: `adaptive`, `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`. Default `adaptive` except that text-only generation must explicitly choose a concrete ratio. Frame-based generation always uses the input image ratio.                                                     |
| `metadata.callback_url` | string    | No          | Callback URL for task-status changes. The first request carries `challenge`, which must be returned unchanged within 3 seconds. Subsequent POST notifications use the provider task-query schema, with statuses `queued`, `running`, `succeeded`, `failed`, or `cancelled`. |

## Content Items

| Field                              | Type   | Required    | Description                                                                                                                                                                                                                      |
| ---------------------------------- | ------ | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `metadata.content[].type`          | string | Yes         | `text`, `image_url`, `video_url`, or `audio_url`.                                                                                                                                                                                |
| `metadata.content[].text`          | string | Conditional | Required for text items; nonempty, at most 7000 characters per item.                                                                                                                                                             |
| `metadata.content[].image_url.url` | string | Conditional | Required for image items. Public URL, accessible `mm_file://{file_id}`, or `data:image/<format>;base64,...` with lowercase format.                                                                                               |
| `metadata.content[].video_url.url` | string | Conditional | Required for video references. Public URL, accessible `mm_file://{file_id}`, or `data:video/mp4;base64,...`.                                                                                                                     |
| `metadata.content[].audio_url.url` | string | Conditional | Required for audio references. Public URL, accessible `mm_file://{file_id}`, or `data:audio/<format>;base64,...` with lowercase format.                                                                                          |
| `metadata.content[].role`          | string | Conditional | Use `first_frame` or `last_frame` for frame-based generation; a single image without a role defaults to first frame. Reference inputs use `reference_image`, `reference_video`, or `reference_audio`, matching the content type. |

## Input Modes

| Mode                  | `metadata.content`                                   | `metadata.ratio`                                                     |
| --------------------- | ---------------------------------------------------- | -------------------------------------------------------------------- |
| Text-to-video         | `text`                                               | Required concrete ratio; `adaptive` is not allowed.                  |
| First frame           | `text` + `image_url` (`first_frame`)                 | Always `adaptive`; another valid ratio is ignored.                   |
| Last frame            | `text` + `image_url` (`last_frame`)                  | Always `adaptive`, matching the image.                               |
| First and last frames | `text` + 2 `image_url` (`first_frame`, `last_frame`) | Always `adaptive`; another valid ratio is ignored.                   |
| Reference-to-video    | `text` + `reference_*`                               | Optional; defaults to `adaptive`. A concrete ratio may be specified. |

Frame roles and reference roles are mutually exclusive. Provider file IDs must be accessible to the upstream account; they are not MixRoute task IDs. This page covers `MiniMax-H3`, not other H3 variants.

## Media Limits

| Media           | Constraints                                                                                                                                                                                 |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Image           | JPG/JPEG/PNG/WebP/HEIC/HEIF; at most 30 MB each; dimensions 256-5760 px; aspect ratio 0.4-2.5. At most one first frame, one last frame, or nine reference images.                           |
| Reference video | MP4/MOV; H.264/H.265 video and AAC/MP3 audio. At most 50 MB each, three clips, 2-15 s per clip and at most 15 s total; dimensions 256-5760 px, ratio 0.4-2.5, and frame rate 23.976-60 fps. |
| Reference audio | WAV/MP3; at most 15 MB each, three clips, 2-15 s per clip and at most 15 s total.                                                                                                           |
| Request         | At most 64 MB including Base64 overhead. Prefer public URLs for large inputs.                                                                                                               |

## Examples

Set `MIXROUTE_API_KEY` before calling the API. Replace media placeholders with accessible inputs. Accepted requests create billable generation tasks; do not automatically resubmit after a submission timeout.

<Tabs>
  <Tab title="Text to video">
    ```bash theme={null}
    curl --location "https://api.mixroute.ai/v1/video/generations" \
      --header "Authorization: Bearer $MIXROUTE_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
      "model": "MiniMax-H3",
      "prompt": "A blue circle gently pulses on a clean white background.",
      "metadata": {
        "content": [
          {
            "type": "text",
            "text": "A blue circle gently pulses on a clean white background."
          }
        ],
        "resolution": "768P",
        "duration": 4,
        "ratio": "9:16"
      }
    }'
    ```
  </Tab>

  <Tab title="First and last frames">
    ```bash theme={null}
    curl --location "https://api.mixroute.ai/v1/video/generations" \
      --header "Authorization: Bearer $MIXROUTE_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
      "model": "MiniMax-H3",
      "prompt": "A professor is teaching a class in a classroom.",
      "metadata": {
        "content": [
          {
            "type": "text",
            "text": "A professor is teaching a class in a classroom."
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://static.freebeatfit.com/aiImageEdit/result/L001510027166320955392/1780060289776-1.png"
            },
            "role": "first_frame"
          },
          {
            "type": "image_url",
            "image_url": {
              "url": "https://static.freebeatfit.com/aiImageEdit/result/M1509975287180300288_0004_1780047826.png"
            },
            "role": "last_frame"
          }
        ],
        "resolution": "768P",
        "duration": 4,
        "ratio": "adaptive"
      }
    }'
    ```
  </Tab>

  <Tab title="Video and audio reference">
    ```bash theme={null}
    curl --location "https://api.mixroute.ai/v1/video/generations" \
      --header "Authorization: Bearer $MIXROUTE_API_KEY" \
      --header "Content-Type: application/json" \
      --data '{
      "model": "MiniMax-H3",
      "prompt": "Preserve the scene in the reference video and follow the reference audio.",
      "metadata": {
        "content": [
          {
            "type": "text",
            "text": "Preserve the scene in the reference video and follow the reference audio."
          },
          {
            "type": "video_url",
            "video_url": {
              "url": "https://example.com/reference.mp4"
            },
            "role": "reference_video"
          },
          {
            "type": "audio_url",
            "audio_url": {
              "url": "https://example.com/reference.mp3"
            },
            "role": "reference_audio"
          }
        ],
        "resolution": "2K",
        "duration": 4,
        "ratio": "adaptive"
      }
    }'
    ```
  </Tab>
</Tabs>

### Python

```python theme={null}
import json
import os
import requests

payload = json.loads(r'''
{
  "model": "MiniMax-H3",
  "prompt": "A blue circle gently pulses on a clean white background.",
  "metadata": {
    "content": [
      {
        "type": "text",
        "text": "A blue circle gently pulses on a clean white background."
      }
    ],
    "resolution": "768P",
    "duration": 4,
    "ratio": "9:16"
  }
}
''')
response = requests.post(
    "https://api.mixroute.ai/v1/video/generations",
    headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
    json=payload,
    timeout=60,
)
response.raise_for_status()
print(response.json())
```

## Task Results

Save the MixRoute task ID returned by submission and poll [Query Video Task](/en/api-reference/endpoint/query-video-task). A successful submission creates a task; read the result only after the task reaches a successful terminal state. Response envelopes and result locations vary by route.
