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

# MiniMax H3 API

> MiniMax H3 2k video generation API with text-to-video, image-to-video, and reference-to-video workflows

## Overview

MiniMax H3 generates 2k videos from prompts, first-frame or first-and-last-frame images, and multimodal reference inputs. Use this page when you are ready to call the API after trying the model in the APIXO playground.

| Capability            | Value                                                                                |
| --------------------- | ------------------------------------------------------------------------------------ |
| Model ID              | `minimax-h3`                                                                         |
| Modes                 | `text-to-video`, `image-to-video`, `reference-to-video`                              |
| Prompt                | Required non-empty string, up to 4,000 characters                                    |
| Output resolution     | Fixed `2k`                                                                           |
| Output duration       | Any integer from `5` through `15` seconds; defaults to `5`                           |
| Aspect ratios         | `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16` for text-to-video and reference-to-video |
| Image-to-video images | 1-2 image URLs; the second image is the optional last frame                          |
| Reference inputs      | Up to 9 image URLs, 3 video URLs, and 3 audio URLs for reference-to-video            |
| Result format         | MP4 URL array in `resultJson.resultUrls`                                             |

## Endpoint and authentication

Base URL:

```text theme={null}
https://api.apixo.ai/api/v1
```

| Method | Endpoint                                 | Purpose                               |
| ------ | ---------------------------------------- | ------------------------------------- |
| `POST` | `/generateTask/minimax-h3`               | Submit a generation task              |
| `GET`  | `/statusTask/minimax-h3?taskId={taskId}` | Poll task status and retrieve results |

All requests require your APIXO API key:

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

Submit requests also require:

```http theme={null}
Content-Type: application/json
```

## Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a `taskId`.

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/minimax-h3" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic product reveal with smooth camera movement and premium studio lighting",
      "aspect_ratio": "16:9",
      "resolution": "2k",
      "duration": 8
    }
  }'
```

Successful response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

Save the `taskId`; you need it to poll for the final result.

## Poll for result

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/minimax-h3?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

Processing response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
```

Success response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965790929,
    "costTime": 180000
  }
}
```

Failed response:

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "UPSTREAM_ERROR",
    "failMsg": "Generation failed",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
```

Parse `resultJson` after `state` becomes `success`:

```javascript theme={null}
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;
```

## Request body

### Text-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a cinematic night street in Tokyo with rain reflections and slow camera movement",
    "aspect_ratio": "16:9",
    "resolution": "2k",
    "duration": 10
  }
}
```

### Image-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "animate this portrait with subtle head movement and cinematic lighting",
    "image_urls": [
      "https://example.com/first-frame.png",
      "https://example.com/last-frame.png"
    ],
    "resolution": "2k",
    "duration": 8
  }
}
```

### Reference-to-video

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "reference-to-video",
    "prompt": "create a polished product launch video using the visual references and camera motion",
    "image_urls": [
      "https://example.com/ref-01.png",
      "https://example.com/ref-02.png",
      "https://example.com/ref-03.png",
      "https://example.com/ref-04.png",
      "https://example.com/ref-05.png",
      "https://example.com/ref-06.png"
    ],
    "video_urls": [
      "https://example.com/motion-reference.mp4"
    ],
    "audio_urls": [
      "https://example.com/voice-reference.mp3"
    ],
    "aspect_ratio": "16:9",
    "resolution": "2k",
    "duration": 8
  }
}
```

## Parameters

<ParamField body="request_type" type="string" default="async">
  Result delivery mode. Omit this field or use `async` for polling with `statusTask`, or use `callback` for webhook delivery.
</ParamField>

<ParamField body="callback_url" type="string">
  Required when `request_type` is `callback`. Must be a public HTTPS URL that can receive the final task payload. See [Webhooks](/docs/api-reference/webhooks).
</ParamField>

<ParamField body="input" type="object" required>
  MiniMax H3 input parameters.

  <Expandable title="properties">
    <ParamField body="mode" type="string" required>
      Generation mode. Supported values: `text-to-video`, `image-to-video`, `reference-to-video`.
    </ParamField>

    <ParamField body="prompt" type="string" required>
      Text prompt describing the desired video. The backend trims whitespace, rejects empty prompts, and allows up to 4,000 characters.
    </ParamField>

    <ParamField body="resolution" type="string" default="2k">
      Output resolution. Only `2k` is supported.
    </ParamField>

    <ParamField body="duration" type="integer|string" default="5">
      Output duration in seconds. Supports integers from `5` through `15`, including numeric strings such as `"8"`.
    </ParamField>

    <ParamField body="aspect_ratio" type="string" default="16:9">
      Output aspect ratio for `text-to-video` and `reference-to-video`. Supported values: `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`. Image-to-video ignores this field.
    </ParamField>

    <ParamField body="image_urls" type="string[]">
      Image URLs. Required for `image-to-video` with 1-2 images, where `image_urls[0]` is the first frame and `image_urls[1]` is the optional last frame. Optional for `reference-to-video` with up to 9 images.
    </ParamField>

    <ParamField body="video_urls" type="string[]">
      Reference video URLs for `reference-to-video`. Supports up to 3 URLs when provided. Each video must be 2-15 seconds, and total reference video duration cannot exceed 15 seconds.
    </ParamField>

    <ParamField body="audio_urls" type="string[]">
      Reference audio URLs for `reference-to-video`. Supports up to 3 URLs when provided. Each audio file must be 2-15 seconds, and total reference audio duration cannot exceed 15 seconds. Audio cannot be used alone.
    </ParamField>
  </Expandable>
</ParamField>

| Mode                 | Required media                        | Optional media                           | Billing note                                                                                                                |
| -------------------- | ------------------------------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `text-to-video`      | None                                  | None                                     | Output duration is billed per second.                                                                                       |
| `image-to-video`     | `image_urls` with 1-2 images          | None                                     | Output duration is billed per second.                                                                                       |
| `reference-to-video` | At least one image or video reference | `image_urls`, `video_urls`, `audio_urls` | Output duration and reference video seconds are billed per second; reference images after the first 5 are billed per image. |

<Tip>
  In `reference-to-video`, image, video, and audio arrays do not need to have matching counts. For example, 6 images with no video or audio is valid.
</Tip>

<Tip>
  Audio-only reference-to-video requests are rejected. If you provide `audio_urls`, include at least one `image_urls` or `video_urls` reference.
</Tip>

<Tip>
  Use public, directly accessible URLs for all reference media. Video and audio durations are checked before the task is submitted.
</Tip>

## Response format

### Submit task response

`POST /generateTask/minimax-h3` returns a task ID when the task is accepted:

<ResponseField name="code" type="integer">
  API status code. `200` means the task was accepted.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable status message.
</ResponseField>

<ResponseField name="data.taskId" type="string">
  Unique task identifier used with the status endpoint.
</ResponseField>

### Status response fields

<ResponseField name="taskId" type="string">
  Unique task identifier.
</ResponseField>

<ResponseField name="state" type="string">
  Current task state: `processing`, `success`, or `failed`.
</ResponseField>

<ResponseField name="resultJson" type="string">
  JSON string containing generated video URLs in `resultUrls`. Present when `state` is `success`.
</ResponseField>

<ResponseField name="failCode" type="string">
  Machine-readable failure code. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="failMsg" type="string">
  Human-readable failure message. Present when `state` is `failed`.
</ResponseField>

<ResponseField name="createTime" type="integer">
  Task creation timestamp in Unix milliseconds.
</ResponseField>

<ResponseField name="completeTime" type="integer">
  Task completion timestamp in Unix milliseconds. Present after completion.
</ResponseField>

<ResponseField name="costTime" type="integer">
  Processing duration in milliseconds. Present after completion when timing data is available.
</ResponseField>

## Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/minimax-h3" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "reference-to-video",
      "prompt": "create an 8-second cinematic product video using these visual references",
      "image_urls": [
        "https://example.com/ref-01.png",
        "https://example.com/ref-02.png"
      ],
      "aspect_ratio": "16:9",
      "resolution": "2k",
      "duration": 8
    }
  }'
```

The callback payload uses the same top-level shape as status polling with `code`, `message`, and `data`. Successful callbacks include the final `state` and `resultJson`. See [Webhooks](/docs/api-reference/webhooks) for delivery requirements and retry behavior.

## Billing

MiniMax H3 is billed per output second, with additional charges for reference videos and extra reference images in `reference-to-video`.

| Item                               | APIXO price        | Billing rule                             |
| ---------------------------------- | ------------------ | ---------------------------------------- |
| Output video                       | `$0.13 / second`   | `duration * $0.13`                       |
| Reference video input              | `$0.13 / second`   | Total actual seconds across `video_urls` |
| Reference images after the first 5 | `$0.04 / image`    | `max(0, image_urls.length - 5) * $0.04`  |
| Reference audio input              | No separate charge | Audio is validated as reference material |

Formula for `text-to-video` and `image-to-video`:

```text theme={null}
total cost = output duration * $0.13
```

Formula for `reference-to-video`:

```text theme={null}
total cost = (output duration + total reference video seconds) * $0.13
           + max(0, reference image count - 5) * $0.04
```

Examples:

| Request                                                           | Example charge                      |
| ----------------------------------------------------------------- | ----------------------------------- |
| 8-second output, 6 reference images, no reference video           | `(8 * $0.13) + (1 * $0.04) = $1.08` |
| 8-second output, one 15-second reference video, 1 reference image | `(8 + 15) * $0.13 = $2.99`          |

For current route and market comparison pricing, see [Pricing](https://apixo.ai/pricing).

## Latency and polling

MiniMax H3 tasks are long-running 2k video jobs. Actual latency may vary by prompt complexity, duration, reference media accessibility, route queue load, and provider-side processing time.

| Workload                                              | Typical generation time             | Recommended first poll      | Poll interval |
| ----------------------------------------------------- | ----------------------------------- | --------------------------- | ------------- |
| Text-to-video or image-to-video                       | Varies by prompt and duration       | 60s after task creation     | 10s-15s       |
| Reference-to-video with image, video, or audio inputs | Often longer than simple generation | 60s-90s after task creation | 10s-15s       |

<Tip>
  For production workloads, use callback mode to avoid frequent polling while video tasks run.
</Tip>

Result URLs are temporary. Download and store important outputs promptly after task completion.

Rate limits and concurrency can vary by account, API key, and route. If you receive `429`, slow down requests and retry with backoff. For account-level details, see [System APIs](/docs/api-reference/system).

## Errors and troubleshooting

### HTTP errors

| Code  | Meaning                                                                                                                                                               | What to do                                       |
| ----- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| `400` | Invalid request body, missing `input`, unsupported `mode`, missing `prompt`, invalid `resolution`, invalid `duration`, invalid `aspect_ratio`, or invalid media array | Fix the request before retrying                  |
| `401` | Missing or invalid API key                                                                                                                                            | Check the `Authorization` header                 |
| `402` | Insufficient balance or quota                                                                                                                                         | Add balance or switch account/key                |
| `403` | Key or route cannot access the model                                                                                                                                  | Check permissions and route strategy             |
| `404` | Task not found when polling                                                                                                                                           | Check the `taskId`                               |
| `429` | Rate limit or concurrency limit reached                                                                                                                               | Retry with exponential backoff                   |
| `500` | Server error or unknown task failure                                                                                                                                  | Retry with backoff                               |
| `502` | Upstream error                                                                                                                                                        | Retry with backoff                               |
| `504` | Upstream timeout                                                                                                                                                      | Retry or use callback mode for long-running jobs |

### Validation notes

| Condition                                                                        | Backend behavior                                                                                                      |
| -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------- |
| Missing `input`                                                                  | Request fails before task creation.                                                                                   |
| Missing, non-string, or empty `prompt`                                           | Request fails before task creation.                                                                                   |
| Prompt over 4,000 characters                                                     | Request fails before task creation.                                                                                   |
| Missing `mode`                                                                   | Request fails before task creation.                                                                                   |
| Unsupported `mode`                                                               | Request fails before task creation. Supported values are `text-to-video`, `image-to-video`, and `reference-to-video`. |
| Missing `resolution`                                                             | Defaults to `2k`.                                                                                                     |
| Unsupported `resolution`                                                         | Request fails before task creation. Only `2k` is supported.                                                           |
| Missing `duration`                                                               | Defaults to `5`.                                                                                                      |
| `duration` outside `5` through `15` or a decimal value                           | Request fails before task creation.                                                                                   |
| Missing `aspect_ratio` in text-to-video or reference-to-video                    | Defaults to `16:9`.                                                                                                   |
| Unsupported `aspect_ratio`                                                       | Request fails before task creation.                                                                                   |
| Image-to-video without `image_urls`                                              | Request fails before task creation.                                                                                   |
| Image-to-video with more than 2 images                                           | Request fails before task creation.                                                                                   |
| Reference-to-video without both `image_urls` and `video_urls`                    | Request fails before task creation, even if `audio_urls` is present.                                                  |
| Reference-to-video with more than 9 images, 3 videos, or 3 audio files           | Request fails before task creation.                                                                                   |
| Reference video or audio shorter than 2 seconds or longer than 15 seconds        | Request fails before task creation.                                                                                   |
| Total reference video duration or total reference audio duration over 15 seconds | Request fails before task creation.                                                                                   |

### Task failure codes

`failCode` is generated from APIXO's mapped provider error. Common values include:

| Fail code              | Meaning                                                      | What to do                                              |
| ---------------------- | ------------------------------------------------------------ | ------------------------------------------------------- |
| `SensitiveContent`     | Prompt or input/output content was rejected by safety checks | Change the prompt or reference media                    |
| `PromptInvalid`        | Prompt was invalid or rejected by the provider               | Rewrite the prompt and retry                            |
| `ImageFormatIncorrect` | Reference image format could not be processed                | Use a public, direct image URL in a common image format |
| `RateLimited`          | Provider-side rate limit was reached                         | Retry with exponential backoff                          |
| `Timeout`              | Provider-side timeout                                        | Retry later or use callback mode                        |
| `Unknown error`        | The provider returned an unmapped failure                    | Retry with backoff or contact support with the `taskId` |

See [Error Codes](/docs/api-reference/errors) for the full error reference.

## Related links

* [Generation API Overview](/docs/models)
* [Video Models](/docs/models/video)
* [Generate Task](/docs/api-reference/generate-task)
* [Status Task](/docs/api-reference/status-task)
* [Webhooks](/docs/api-reference/webhooks)
* [Error Codes](/docs/api-reference/errors)
* [Parameter Specification](/docs/api-reference/parameters)
* [Routing Strategies](/docs/concepts/routing-strategies)
* [Try MiniMax H3 in the APIXO Playground](https://apixo.ai/models/minimax-h3)
* [Pricing](https://apixo.ai/pricing)
