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

# MiniMax-H3-Max Video Generation

>  - MiniMax Video Generation V2 fast model with asynchronous task submission
- Supports text-to-video and image-to-video with first, last, or first-and-last frames
- Supports 768P / 480P, durations from 5 to 15 seconds, with audio
- Does not support 2K, middle frames, or multimodal reference generation 

<Info>
  **Model selection:** Use `MiniMax-H3-Max` when speed matters and you only need text-to-video or first/last-frame control. For 2K, middle frames, reference images, reference videos, or reference audio, use [MiniMax-H3](/en/api-reference/videos/minimax-h3/generation).
</Info>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "MiniMax-H3-Max",
      "prompt": "A detective in a trench coat turns around on a neon-lit street in the rain. The camera slowly pushes in as reflections shimmer on the pavement.",
      "duration": 5,
      "resolution": "768P",
      "aspect_ratio": "16:9"
    }'
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api.apimart.ai/v1/videos/generations",
      headers={
          "Authorization": "Bearer <token>",
          "Content-Type": "application/json",
      },
      json={
          "model": "MiniMax-H3-Max",
          "prompt": "A detective turns around on a neon-lit street in the rain.",
          "duration": 5,
          "resolution": "768P",
          "aspect_ratio": "16:9",
      },
  )

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://api.apimart.ai/v1/videos/generations", {
    method: "POST",
    headers: {
      Authorization: "Bearer <token>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      model: "MiniMax-H3-Max",
      prompt: "A detective turns around on a neon-lit street in the rain.",
      duration: 5,
      resolution: "768P",
      aspect_ratio: "16:9",
    }),
  });

  console.log(await response.json());
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "status": "submitted",
        "task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "Invalid request parameters",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "Authentication failed. Check your API key.",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "Insufficient account balance",
      "type": "payment_required"
    }
  }
  ```
</ResponseExample>

## Authentication

<ParamField header="Authorization" type="string" required>
  All endpoints require Bearer Token authentication. Get your key from the [API Key page](https://apimart.ai/keys).

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## Choose the right model

| Capability            | `MiniMax-H3`                | `MiniMax-H3-Max`                |
| --------------------- | --------------------------- | ------------------------------- |
| Resolution            | `2K` / `768P`; default `2K` | `768P` / `480P`; default `768P` |
| Duration              | 4–15 seconds                | 5–15 seconds                    |
| Text-to-video         | Supported                   | Supported                       |
| First / last frames   | Supported                   | Supported                       |
| Middle frames         | Supported                   | Not supported                   |
| Multimodal references | Images, video, and audio    | Not supported                   |
| Input image charge    | First 5 images are free     | Free                            |

<Warning>
  `MiniMax-H3-Max` does not support 2K and its output cannot be used as the source for [Regeneration](/en/api-reference/videos/minimax-h3/regeneration). Use `MiniMax-H3` when you need either capability.
</Warning>

## Generation modes

The request fields determine the mode automatically; do not send a `mode` field.

| Mode                 | Trigger                                                                             | Behavior                                      |
| -------------------- | ----------------------------------------------------------------------------------- | --------------------------------------------- |
| Text-to-video (T2V)  | Only `prompt` and common fields                                                     | Generates from text                           |
| Image-to-video (I2V) | `first_frame_image` / `last_frame_image`, or equivalent roles in `image_with_roles` | Controls the first frame, last frame, or both |

<Warning>
  This model does not support `image_urls`, `video_urls`, `audio_urls`, or `image_with_roles[].role = "reference_image"`. Any reference-media field returns HTTP 400 synchronously; no task is created or charged.
</Warning>

## Request parameters

<ParamField body="model" type="string" required>
  Fixed value: `MiniMax-H3-Max`

  Model IDs are case-insensitive; `minimax-h3-max` is also accepted.
</ParamField>

<ParamField body="prompt" type="string" required>
  A non-empty description of the video. Required in every mode.

  Maximum: `7000` characters.
</ParamField>

<ParamField body="duration" type="integer" default="5">
  Video duration in seconds.

  * Integer from `5` to `15`
  * Default: `5`
  * 4 seconds is not supported
</ParamField>

<ParamField body="resolution" type="string" default="768P">
  Output resolution:

  * `768P` (default)
  * `480P`

  <Warning>
    `2K`, `1440P`, and `2048P` are not supported. Invalid values return HTTP 400 and are not silently downgraded.
  </Warning>
</ParamField>

<ParamField body="aspect_ratio" type="string">
  Output aspect ratio. The aliases `size` and `ratio` are also accepted.

  Text-to-video values: `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`.

  * T2V without this field, or with `adaptive`: falls back to `16:9`
  * I2V: determined by the input image; this field is ignored
</ParamField>

<ParamField body="first_frame_image" type="string">
  Public image URL used as the video's first frame.
</ParamField>

<ParamField body="last_frame_image" type="string">
  Public image URL used as the video's last frame. It can be used alone or together with `first_frame_image`.
</ParamField>

<ParamField body="image_with_roles" type="object[]">
  Role-based image array that can replace `first_frame_image` and `last_frame_image`.

  <Expandable title="image_with_roles item">
    <ResponseField name="url" type="string" required>
      Public image URL
    </ResponseField>

    <ResponseField name="role" type="string" required>
      Supported roles:

      * `first_frame`; aliases include `first` and `start`
      * `last_frame`; aliases include `last`, `end_frame`, and `tail`
    </ResponseField>
  </Expandable>

  Each role accepts at most one image. `role` cannot be empty.
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  Whether to add an AIGC watermark. Alias: `aigc_watermark`.
</ParamField>

<ParamField body="webhook" type="string">
  Receives a notification when the task reaches a successful or failed terminal state.

  <Note>
    Use `webhook`, not MiniMax's `callback_url`. The gateway reserves `callback_url` for internal polling acceleration.
  </Note>
</ParamField>

## Unsupported parameters

The following values return HTTP 400 before task creation and billing:

| Parameter / value                             | Reason                                                         |
| --------------------------------------------- | -------------------------------------------------------------- |
| `image_urls`                                  | Treated as reference images, which this model does not support |
| `image_with_roles[].role = "reference_image"` | Only first and last frames are supported                       |
| `video_urls` / `video_url`                    | Reference video is not supported                               |
| `audio_urls` / `audio_url`                    | Reference audio is not supported                               |
| `resolution: "2K"`                            | Only `768P` and `480P` are supported                           |
| `duration: 4` or a value above `15`           | Only 5–15 seconds are supported                                |

<Tip>
  For reference media, 2K, middle frames, or a 4-second video, change `model` to `MiniMax-H3` and follow the [MiniMax-H3 guide](/en/api-reference/videos/minimax-h3/generation).
</Tip>

## Image limits

The total request body must be 64 MB or less. Use public URLs; Base64 is not supported.

| Item                          | Limit                                                |
| ----------------------------- | ---------------------------------------------------- |
| Formats                       | JPG / JPEG / PNG / WEBP / HEIC / HEIF                |
| Per file                      | ≤ 30 MB                                              |
| Width and height              | 256–5760 px                                          |
| Aspect ratio (width / height) | 0.4–2.5                                              |
| Count                         | Up to 1 first frame and 1 last frame; 2 images total |

Invalid images may fail during generation; failed tasks are refunded automatically.

## Examples

### First-frame image-to-video

```json theme={null}
{
  "model": "MiniMax-H3-Max",
  "prompt": "The camera slowly pushes in as steam rises and people move in the background.",
  "first_frame_image": "https://cdn.example.com/ramen.png",
  "duration": 5,
  "resolution": "480P"
}
```

### First-and-last-frame image-to-video

```json theme={null}
{
  "model": "MiniMax-H3-Max",
  "prompt": "The scene gradually transitions from morning to sunset.",
  "first_frame_image": "https://cdn.example.com/morning.png",
  "last_frame_image": "https://cdn.example.com/sunset.png",
  "duration": 8,
  "resolution": "768P"
}
```

## Query a task

Submission returns a `task_id`. Poll [Task Status](/en/api-reference/tasks/status) every 5–10 seconds; use a client timeout of 15 minutes.

```bash theme={null}
curl https://api.apimart.ai/v1/tasks/task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ \
  --header 'Authorization: Bearer <token>'
```

| `status`     | Meaning                                                   |
| ------------ | --------------------------------------------------------- |
| `pending`    | Submitted or queued                                       |
| `processing` | Generating                                                |
| `completed`  | Video URL is in `result.videos[0].url`                    |
| `failed`     | Check `error.message`; the task is refunded automatically |

<Note>
  Generated video URLs typically expire after about 24 hours. Download and store the result promptly.
</Note>

## Pricing

Total cost equals the per-second rate multiplied by video duration. First and last frame images are free.

| Item         | Rate                  |
| ------------ | --------------------- |
| 768P video   | **\$0.075 / second**  |
| 480P video   | **\$0.0495 / second** |
| Input images | **Free**              |

The estimated amount is reserved at submission. Failed tasks receive a full automatic refund; the task response's `cost` field is authoritative.

## Errors

| Scenario                              | Result                  |
| ------------------------------------- | ----------------------- |
| Empty or over-7000-character `prompt` | 400; no task            |
| `duration` outside 5–15               | 400; no task            |
| Unsupported `resolution`              | 400; no task            |
| Any reference media                   | 400; no task            |
| Invalid or duplicate image role       | 400; no task            |
| Insufficient balance                  | 402                     |
| Content safety rejection              | 422                     |
| Rate limit                            | 429; retry with backoff |

Generation failures return `status = failed` with details in `error.message` and are refunded automatically.

## Response

<ResponseField name="code" type="integer">
  Response status code; 200 on success
</ResponseField>

<ResponseField name="data" type="array">
  Submission result containing the initial task status and task ID

  <Expandable title="Array item">
    <ResponseField name="status" type="string">
      Initially `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      Unique task identifier used to query progress and results
    </ResponseField>
  </Expandable>
</ResponseField>
