> ## 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-Lite video generation

> Generate video from text, a first frame, first and last frames, or multimodal references. Outputs are 480P or 768P and 4 to 15 seconds long.

```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-Lite",
    "prompt": "The camera moves through a neon-lit street at night as rain runs down a car window.",
    "resolution": "768P",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
```

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

```json 400 theme={null}
{
  "error": {
    "code": 400,
    "message": "MiniMax-H3-Lite only supports resolution = 480P or 768P",
    "type": "invalid_request_error"
  }
}
```

**Authorization** `string` *required*

Use `Bearer <token>` with your API key in place of `<token>`.

**model** `string` *required*

Use the model ID `MiniMax-H3-Lite`.

**prompt** `string` *required*

A non-empty video prompt of up to 7,000 characters.

**duration** `integer` (default: 5)

Output duration in whole seconds from 4 to 15.

**resolution** `string` (default: 768P)

Accepts `480P` and `768P`, case-insensitively. The strings `480` and `768` also work.

**aspect\_ratio** `string`

Output aspect ratio. You can also pass it as `size` or `ratio`.

* Text-to-video and multimodal reference generation accept `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, and `9:16`. The default is `16:9`. Passing `adaptive` or `auto` returns HTTP 400.
* First-frame and first-and-last-frame generation follow the input frame aspect ratio. Omit the field or pass `adaptive`. Other valid values leave the input frame ratio in effect.

**first\_frame\_image** `string`

Public HTTP(S) URL of the first frame. The platform also accepts and stores a Data URI for this field.

**last\_frame\_image** `string`

Public HTTP(S) URL of the last frame. Provide a first frame whenever you use a last frame.

**image\_with\_roles** `object[]`

Assign each image a first-frame, last-frame, or reference role. Provide at most one first frame and one last frame.

**image\_with\_roles**

**url** `string` *required*

Public HTTP(S) URL of the image.

**role** `string`

`first_frame` / `last_frame` / `reference_image`

**image\_urls** `string[]`

Public HTTP(S) URLs of reference images. You can provide up to 9 reference images across this field and `image_with_roles`. All images in this array are references. To control the first or last frame, use frame fields or assign frame roles.

**video\_urls** `string[]`

Public HTTP(S) URLs of up to 3 reference videos, each 2 to 15 seconds long and at most 15 seconds combined. For one video, you can use the string field `video_url`.

**audio\_urls** `string[]`

Public HTTP(S) URLs of up to 3 reference audio clips, each 2 to 15 seconds long and at most 15 seconds combined. Include at least one reference image or video. For one clip, you can use the string field `audio_url`.

**watermark** `boolean` (default: false)

Whether to add an AIGC watermark. You can also pass it through `metadata.aigc_watermark`.

**webhook** `string`

Callback URL for task success or failure notifications.

## Input media requirements

Media URLs must be directly accessible over the public internet. Dimension limits apply to both width and height. Aspect ratio means width divided by height.

| Media | Format and codec | File size limit | Dimensions, aspect ratio, and frame rate |
| - | - | - | - |
| Image | JPG / JPEG / PNG / WEBP / HEIC / HEIF | ≤ 30 MB | 256–5760 px, 0.4–2.5 |
| Reference video | MP4 / MOV (H.264 / H.265, AAC / MP3) | ≤ 50 MB | 256–5760 px, 0.4–2.5, 23.976–60 fps |
| Reference audio | WAV / MP3 | ≤ 15 MB | — |

## Request examples

### First frame

```json theme={null}
{
  "model": "MiniMax-H3-Lite",
  "prompt": "The camera slowly moves forward as morning light fills the room.",
  "first_frame_image": "https://example.com/first.png",
  "resolution": "480P",
  "duration": 4
}
```

### First and last frames

```json theme={null}
{
  "model": "MiniMax-H3-Lite",
  "prompt": "The scene transitions from morning to night as the lights inside come on.",
  "image_with_roles": [
    {
      "url": "https://example.com/first.png",
      "role": "first_frame"
    },
    {
      "url": "https://example.com/last.png",
      "role": "last_frame"
    }
  ],
  "resolution": "768P",
  "duration": 5
}
```

### Multimodal reference generation

```json theme={null}
{
  "model": "MiniMax-H3-Lite",
  "prompt": "Use the character from the reference image, follow the motion in the reference video, and deliver the dialogue in the reference voice.",
  "image_urls": [
    "https://example.com/character.png"
  ],
  "video_urls": [
    "https://example.com/motion.mp4"
  ],
  "audio_urls": [
    "https://example.com/voice.mp3"
  ],
  "resolution": "768P",
  "duration": 5,
  "aspect_ratio": "16:9"
}
```

## Check task status

After submission, read the task ID from `data[0].task_id`. Poll [the task status endpoint](https://docs.apimart.ai/en/api-reference/tasks/status.md) every 5 to 10 seconds with a suggested client timeout of 15 minutes.

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

When `data.status` is `completed`, read the video links from the `data.result.videos[0].url` array. When the status is `failed`, check `data.error.message`.

The final charge is reported in `data.cost`.

## Billing

Charges depend on the output resolution and the input media. See the [model pricing endpoint](https://api.apimart.ai/api/pricing/model?model=MiniMax-H3-Lite) for the rates that apply to your account.

* The same per-second rate applies to output and reference videos at the selected resolution. For example, a 5-second output with 6 seconds of reference video is billed for 11 seconds.
* First frames, last frames, and reference images count toward the same allowance. The first 5 images are free, and each additional image incurs a charge.
* Reference audio is free.

The charge is reserved at submission and automatically refunded in full if generation fails.

## Common parameter errors

These cases return HTTP 400 at submission and incur no charge.

* The resolution or duration is out of range. Use `480P` or `768P` and set `duration` to an integer from 4 to 15.
* A last frame was sent alone, frame images were mixed with reference media, or reference audio was sent alone. Pair a last frame with a first frame and reference audio with an image or a video reference.
* A reference media count or reference video duration exceeds its limit. Check the limits for each media type and trim reference videos as needed.
* The service could not read a reference video duration. Check that its URL is publicly reachable and the video file is valid.

If you receive `model_not_found`, check that the model ID is exactly `MiniMax-H3-Lite`.


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