# MiniMax H3 Lite — /videos/generations

MiniMax H3 Lite video API: the accelerated MiniMax H3 (fewer sampling steps), faster and cheaper. 480P / 768P, 4–15 seconds and 8 aspect ratios, native sound always on; text-to-video and up to 5 reference images (references only, never a first frame). Async jobs billed per second; failures are not billed.

**Endpoint:** `POST https://kovapi.com/v1/videos/generations`

## Quick start

Three steps: submit a job, poll it, take the video link. Replace YOUR_API_KEY with your key and the commands below run as they are.

**Step 1 · Submit (returns a job id at once, HTTP 202)**

```
curl https://kovapi.com/v1/videos/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "minimax-h3-lite", "prompt": "Steam rising from a coffee cup, light rain outside the window, the camera slowly circling", "duration": 5, "resolution": "768P", "size": "16:9"}'
```

Response (HTTP 202)

```
{
  "id": "img_5c2e8f1a9b3d7e6f0a4c8b2d",
  "object": "video.generation.job",
  "status": "queued",
  "created": 1791281400,
  "model": "minimax-h3-lite"
}
```

**Step 2 · Poll every 5–10 seconds until `status` is `succeeded` or `failed`**

```
curl https://kovapi.com/v1/videos/jobs/img_5c2e8f1a9b3d7e6f0a4c8b2d \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Response when it succeeds

```
{
  "id": "img_5c2e8f1a9b3d7e6f0a4c8b2d",
  "object": "video.generation.job",
  "status": "succeeded",
  "created": 1791281400,
  "model": "minimax-h3-lite",
  "data": [
    {"url": "https://img.kovapi.com/i/8c1f0e5d2b7a49e3a6d0c4f1b9e2a7d5.mp4"}
  ],
  "usage": {"clips": 1, "model": "minimax-h3-lite"}
}
```

**Step 3 · `data[0].url` is the clip (MP4). It is kept for 7 days; download it to your own storage to keep it longer.**

**Complete example (Python: submit, wait, save to disk)**

```
import time
import requests

BASE = "https://kovapi.com/v1"
HEADERS = {"Authorization": "Bearer YOUR_API_KEY"}

# 1. submit
job = requests.post(f"{BASE}/videos/generations", headers=HEADERS, json={
    "model": "minimax-h3-lite",
    "prompt": "Steam rising from a coffee cup, light rain outside the window, the camera slowly circling",
    "duration": 5,
    "resolution": "768P",
    "size": "16:9",
}).json()
if "error" in job:
    raise SystemExit(job["error"]["message"])

# 2. poll every 10 seconds, for up to an hour
deadline = time.time() + 3600
while job["status"] not in ("succeeded", "failed") and time.time() < deadline:
    time.sleep(10)
    job = requests.get(f"{BASE}/videos/jobs/{job['id']}", headers=HEADERS).json()

# 3. download the video
if job["status"] == "succeeded":
    url = job["data"][0]["url"]
    with open("minimax-h3-lite.mp4", "wb") as f:
        f.write(requests.get(url).content)
    print("saved", url)
elif job["status"] == "failed":
    print("failed:", job["error"]["code"], job["error"]["message"])
else:
    print("still", job["status"], job["id"])
```

While queued, the poll also returns `queue_position` (jobs ahead of yours) and `eta_seconds` (expected wait). If your time limit passes, do not resubmit: the job is still there, so keep polling the same id later.

## Authentication
```
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

## At a glance

| Duration | 4–15 s |
| --- | --- |
| Resolution | 480P / 768P |
| Aspect ratio | 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9 |
| Reference images | up to 5 · all used as references, never a first frame |
| Reference videos | not supported |
| Reference audio | not supported |
| Sound | always on; cannot be switched off (`audio: false` is refused) |
| Prompt length | up to 5,000 characters (any script counts the same) |
| Billing | per second: the rate × the seconds you order |

## Request parameters

The JSON body of `POST /v1/videos/generations`:

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| model | string | Yes | The model id: `minimax-h3-lite`. |
| prompt | string | Yes | What happens in the clip: picture, camera and motion. Up to 5,000 characters (any script counts the same). |
| duration | integer | No | Length in seconds: any integer from 4 to 15; 5 when omitted. Alias `seconds`. |
| resolution | string | No | Resolution: 480P / 768P; 768P when omitted. Keep the P (`720` without it is refused). |
| size | string | No | Aspect ratio: 16:9 / 9:16 / 1:1 / 4:3 / 3:4 / 3:2 / 2:3 / 21:9; 16:9 when omitted. Alias `aspect_ratio`. |
| images | array | No | Reference images, up to 5: the people or settings in them appear in the clip, never as a first frame. A single image may go in `image`. `image_role: first_frame` is refused (use minimax-h3 for a first frame). |
| audio | boolean | No | Every clip comes with sound and it cannot be switched off; `false` is refused (400), so leave it out. |
| callback_url | string | No | Where to push the result when the job ends; see Webhooks below. |
| n | integer | No | Each job makes one clip; leave it out. A value above 1 still makes one clip, but n clips are held at submit and the extra is returned when the job ends. |

Other fields (`seed`, `negative_prompt`, `fps`, `watermark` and the like) are not passed on and do not change the price; results are always MP4, returned as a `url`.

## Price

Billed per second: cost = the per-second rate of the chosen resolution × the seconds you order. That amount is held at submit, settled as is on success and refunded in full on failure. 1 credit = $0.005.

| Resolution | Credits / s | USD / s | A 5-second clip |
| --- | --- | --- | --- |
| 480P | 1 | $0.005 | $0.025 |
| 768P | 2.5 | $0.0125 | $0.0625 |

## Reference material

- Every image is a reference (up to 5): its people or settings appear anywhere in the clip; none is used as a first frame, and `image_role: first_frame` is refused.

- No reference audio or video; use reference mode on minimax-h3 for those. Every clip comes with sound.

- Reference images: JPG / PNG / WEBP (no GIF), up to 16 MB each; each must be 256–5760 px on both sides with an aspect ratio between 0.4 and 2.5. One that does not fit is refused with a 400 at submit (`reference_image_dimensions` for the size), not charged.

- Each image is a public image URL, a `data:` URI or base64, up to 16 MB; send several as an array in `images`. We store the images before the job is queued; one that cannot be read is refused with 400, `message` says which, and nothing is charged.

- Reference files we store and the results are both kept for 7 days.

**Reference images: put the people in them into the clip**

```
curl https://kovapi.com/v1/videos/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "minimax-h3-lite", "prompt": "The girl from the reference image walks into a rainy street at night and looks back with a smile", "images": ["https://example.com/girl.png"], "duration": 5, "resolution": "768P", "size": "9:16"}'
```

The images are references: their people and settings appear in the clip, but none is the first frame. For a first or first + last frame use minimax-h3.

## Job status and fields

`GET /v1/videos/jobs/{id}` reports these statuses; every field is described in [Async jobs](https://docs.kovapi.com/en/guide/async-jobs#fields). Poll every 5–10 seconds, or let a webhook (below) push the result. Polling is free, and any key of the same account can read the job.

| Status | Meaning |
| --- | --- |
| queued | Waiting in line. Carries `queue_position` (jobs ahead of yours) and `eta_seconds` (expected wait). |
| processing | Rendering. |
| succeeded | Done. The result is in `data[0].url`, the billing detail in `usage`. |
| failed | Failed. The reason is in `error`; the credits held for the job are refunded in full. |

- `processing` can go back to `queued`, for example while the service is busy, while a finished clip is fetched again, or after a restart. If a job cannot be finished, the gateway may render it again automatically; however many retries it takes, a job is charged once.

- One account runs up to 50 jobs at a time; further jobs wait in submission order, and a job that has not started after 15 minutes fails and is refunded in full. Job records are kept for 3 days and video links for 7 days.

## How long it takes

Usually 2–3 minutes; longer clips and busy hours take longer.

## Errors and refunds

An error at submit comes back at once as HTTP 4xx / 5xx: no job is created and nothing is charged. A failure after the job was accepted is reported by the job endpoint, and the hold is refunded in full. Every code is listed under [Error codes](https://docs.kovapi.com/en/guide/errors).

### Errors at submit

| HTTP | code | Cause | What to do |
| --- | --- | --- | --- |
| 400 | invalid_request | A parameter is not valid: the duration, resolution, ratio or number of references is outside this model's range, the prompt is too long, a reference image or video cannot be read, `audio: false` was sent to a model whose clips always have sound, and so on. `message` says which. | Fix what `message` says and submit again. |
| 400 | invalid_callback_url | `callback_url` is not a public http(s) address, or is longer than 2000 characters. | Use an address that can be reached from the internet. |
| 400 | model_not_found | The model id is misspelled, `model` is missing, or the model cannot be used on this endpoint (a chat model on the image endpoint, for example). | Use a model id from `GET /v1/models` or the [API reference](https://docs.kovapi.com/en/api). |
| 401 | invalid_api_key | The key does not exist, was deleted or is disabled, or the account is disabled. | Check the key on the API Keys page of the console. |
| 402 | insufficient_quota | Not enough balance to hold this request. The gateway holds the highest possible cost of the request first, so a burst of concurrent calls can trigger it too. | After a burst, wait a few seconds and retry; otherwise top up. |
| 429 | rate_limit_exceeded | Over the requests-per-minute limit set on this key (counted over the last 60 seconds). No `Retry-After` header. | Wait a few seconds and retry, or raise the key's limit in the console. |
| 503 | model_maintenance | The model is under maintenance and takes no requests; no other model answers in its place meanwhile. | Retry when maintenance ends; see [Status](https://kovapi.com/en/status). |
| 503 | service_unavailable | A temporary failure on our side, such as storing a reference file. No job was created and nothing was charged. | Retry shortly. |

### Failed jobs (`status` `failed`)

| code | When you see it | What to do |
| --- | --- | --- |
| upstream_error | No clip this time: the content did not pass review, the service was busy, the job waited 15 minutes without starting, and so on; `message` says why. | Submitting again usually works. |

Branch on `code`, not on the text of `message`. Treat any `code` you do not recognise (or a missing one) as `upstream_error`: resubmitting usually works. Every failed job is refunded in full.

## Webhooks instead of polling

Add `callback_url` when you submit and the moment the job ends, success or failure, the gateway pushes exactly what the poll endpoint returns to that URL, signed and retried on failure. You can also set an account-wide address under Settings → Webhook in the console. [Webhook docs →](https://docs.kovapi.com/en/webhooks)

```
curl https://kovapi.com/v1/videos/generations \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model": "minimax-h3-lite", "prompt": "Steam rising from a coffee cup, light rain outside the window, the camera slowly circling", "duration": 5, "resolution": "768P", "size": "16:9", "callback_url": "https://your-domain.com/webhook"}'
```
