> ## 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 LoRA API

> MiniMax H3 LoRA 480p and 768p video generation API with text-to-video, image-to-video, and reference-to-video workflows

## Overview

MiniMax H3 LoRA generates 480p or 768p 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-LoRA`                                                                            |
| Modes                 | `text-to-video`, `image-to-video`, `reference-to-video`                                      |
| Prompt                | Required non-empty string, up to 4,000 characters                                            |
| Output resolution     | `480p` or `768p`; defaults to `480p`                                                         |
| 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`, `9:21` 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                    |
| Reference video limit | `video_urls` are supported only when `resolution` is `480p`                                  |
| Result format         | MP4 URL array in `resultJson.resultUrls`                                                     |

<Note>
  `minimax-h3-LoRA` is the public model name. It does not accept custom LoRA configuration parameters.
</Note>

## Endpoint and authentication

Base URL:

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

| Method | Endpoint                                      | Purpose                               |
| ------ | --------------------------------------------- | ------------------------------------- |
| `POST` | `/generateTask/minimax-h3-LoRA`               | Submit a generation task              |
| `GET`  | `/statusTask/minimax-h3-LoRA?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-LoRA" \
  -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": "768p",
      "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-LoRA?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": "768p",
    "duration": 10,
    "seed": -1
  }
}
```

### 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": "480p",
    "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/product.png",
      "https://example.com/brand-style.png"
    ],
    "video_urls": [
      "https://example.com/motion-reference.mp4"
    ],
    "audio_urls": [
      "https://example.com/voice-reference.mp3"
    ],
    "aspect_ratio": "16:9",
    "resolution": "480p",
    "duration": 8
  }
}
```

## Parameters

<ParamField body="request_type" type="string" default="async">
  Result delivery mode. Supported values: `async`, `callback`. 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 LoRA 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="480p">
      Output resolution. Supported values are `480p` and `768p`. Defaults to `480p`.
    </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"`. Decimal values are rejected.
    </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`, `9:21`. 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. Reference-to-video requires at least one `image_urls` or `video_urls` reference.
    </ParamField>

    <ParamField body="video_urls" type="string[]">
      Reference video URLs for `reference-to-video`. Supports up to 3 URLs when provided, only with `resolution` set to `480p`. Each video must be greater than 0 seconds and no more than 15 seconds, total reference video duration cannot exceed 15 seconds, and reference video seconds are billed at `$0.04` per second.
    </ParamField>

    <ParamField body="audio_urls" type="string[]">
      Reference audio URLs for `reference-to-video`. Supports up to 3 URLs when provided. Audio cannot be used alone and is billed per URL.
    </ParamField>

    <ParamField body="seed" type="integer|string">
      Optional whole-number seed for reproducible output. Numeric strings are accepted; decimal values are rejected.
    </ParamField>
  </Expandable>
</ParamField>

| Mode                 | Required media                        | Optional media                           | Billing note                                                                                                |
| -------------------- | ------------------------------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| `text-to-video`      | None                                  | None                                     | Output duration is billed per second by selected resolution.                                                |
| `image-to-video`     | `image_urls` with 1-2 images          | None                                     | Output duration is billed per second by selected resolution.                                                |
| `reference-to-video` | At least one image or video reference | `image_urls`, `video_urls`, `audio_urls` | Output duration, reference images, reference audio URLs, and reference video seconds are billed separately. |

<Tip>
  In `reference-to-video`, image, video, and audio arrays do not need to have matching counts.
</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. Reference videos are checked before the task is submitted.
</Tip>

## Response format

### Submit task response

`POST /generateTask/minimax-h3-LoRA` 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-LoRA" \
  -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": "480p",
      "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 LoRA is billed per output second by selected resolution. `reference-to-video` also bills reference images, reference audio URLs, and reference video seconds.

| Item                  | APIXO price         | Billing rule                                                       |
| --------------------- | ------------------- | ------------------------------------------------------------------ |
| Output video, `480p`  | `$0.04 / second`    | `duration * $0.04`                                                 |
| Output video, `768p`  | `$0.08 / second`    | `duration * $0.08`                                                 |
| Reference image input | `$0.02 / image`     | `image_urls.length * $0.02`                                        |
| Reference audio input | `$0.02 / audio URL` | `audio_urls.length * $0.02`                                        |
| Reference video input | `$0.04 / second`    | Total actual seconds across `video_urls`; only available at `480p` |

Use `output_rate = $0.04` when `resolution` is `480p`, and `output_rate = $0.08` when `resolution` is `768p`.

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

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

Formula for `reference-to-video`:

```text theme={null}
total cost = output duration * output_rate
           + reference image count * $0.02
           + reference audio URL count * $0.02
           + total reference video seconds * $0.04
```

Examples:

| Request                                                                                             | Example charge                                                  |
| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
| 10-second `768p` text-to-video output                                                               | `10 * $0.08 = $0.80`                                            |
| 8-second `480p` output, 2 reference images, 1 reference audio URL, and 4 seconds of reference video | `(8 * $0.04) + (2 * $0.02) + (1 * $0.02) + (4 * $0.04) = $0.54` |

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

## Latency and polling

MiniMax H3 LoRA tasks are long-running video jobs. Actual latency may vary by prompt complexity, duration, resolution, 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 `480p`.                                                                                                   |
| Unsupported `resolution`                                                        | Request fails before task creation. Supported values are `480p` and `768p`.                                           |
| 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-to-video with `video_urls` and `resolution` other than `480p`         | Request fails before task creation.                                                                                   |
| Reference video duration is 0 seconds, over 15 seconds, or cannot be determined | Request fails before task creation.                                                                                   |
| Total reference video duration over 15 seconds                                  | Request fails before task creation.                                                                                   |
| `seed` is a decimal value                                                       | Request fails before task creation.                                                                                   |
| Custom LoRA configuration fields                                                | Not supported by this model contract.                                                                                 |

### 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 LoRA in the APIXO Playground](https://apixo.ai/models/minimax-h3-LoRA)
* [Pricing](https://apixo.ai/pricing)
