> ## 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 動画生成

>  - MiniMax 動画生成 V2 の高速版、非同期でタスクを送信
- テキストから動画、先頭・末尾・先頭末尾フレーム指定の画像から動画に対応
- 768P / 480P、5～15 秒、音声付き動画に対応
- 2K、中間フレーム、マルチモーダル参照生成には非対応 

<Info>
  **モデル選択：** 速度を優先し、テキストから動画または先頭・末尾フレーム制御のみ必要な場合は `MiniMax-H3-Max` を使用します。2K、中間フレーム、参照画像・動画・音声が必要な場合は [MiniMax-H3](/ja/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": "雨のネオン街でトレンチコートの探偵が振り返る。カメラがゆっくり近づき、路面の反射が揺らめく。",
      "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": "雨のネオン街で探偵が振り返り、カメラがゆっくり近づく。",
          "duration": 5,
          "resolution": "768P",
          "aspect_ratio": "16:9",
      },
  )
  print(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": "リクエストパラメータが無効です",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "認証に失敗しました。API キーを確認してください。",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "アカウント残高が不足しています",
      "type": "payment_required"
    }
  }
  ```
</ResponseExample>

## 認証

<ParamField header="Authorization" type="string" required>
  すべてのエンドポイントで Bearer Token 認証が必要です。[API キーページ](https://apimart.ai/keys)でキーを取得してください。

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

## モデルの選択

| 機能          | `MiniMax-H3`          | `MiniMax-H3-Max`          |
| ----------- | --------------------- | ------------------------- |
| 解像度         | `2K` / `768P`、既定 `2K` | `768P` / `480P`、既定 `768P` |
| 長さ          | 4～15 秒                | 5～15 秒                    |
| テキストから動画    | 対応                    | 対応                        |
| 先頭 / 末尾フレーム | 対応                    | 対応                        |
| 中間フレーム      | 対応                    | 非対応                       |
| マルチモーダル参照   | 画像・動画・音声              | 非対応                       |
| 入力画像料金      | 最初の 5 枚は無料            | 無料                        |

<Warning>
  `MiniMax-H3-Max` は 2K に対応せず、出力を [Regeneration](/ja/api-reference/videos/minimax-h3/regeneration) の元タスクとして使用することもできません。
</Warning>

## 生成モード

リクエストフィールドからモードが自動判定されます。`mode` は送信しないでください。

| モード           | 条件                                                                     | 動作             |
| ------------- | ---------------------------------------------------------------------- | -------------- |
| テキストから動画（T2V） | `prompt` と共通フィールドのみ                                                    | テキストから生成       |
| 画像から動画（I2V）   | `first_frame_image` / `last_frame_image`、または `image_with_roles` の対応ロール | 先頭、末尾、または両方を制御 |

<Warning>
  このモデルは `image_urls`、`video_urls`、`audio_urls`、`image_with_roles[].role = "reference_image"` に対応しません。参照素材を渡すと同期的に HTTP 400 が返り、タスク作成・課金は行われません。
</Warning>

## リクエストパラメータ

<ParamField body="model" type="string" required>
  固定値：`MiniMax-H3-Max`。大文字小文字は区別されず、`minimax-h3-max` も使用できます。
</ParamField>

<ParamField body="prompt" type="string" required>
  空でない動画説明。すべてのモードで必須です。最大 `7000` 文字。
</ParamField>

<ParamField body="duration" type="integer" default="5">
  動画の長さ（秒）。`5`～`15` の整数、既定値 `5`。4 秒には対応しません。
</ParamField>

<ParamField body="resolution" type="string" default="768P">
  出力解像度：`768P`（既定）または `480P`。

  <Warning>
    `2K`、`1440P`、`2048P` は使用できません。不正な値は HTTP 400 になり、自動的なダウングレードは行われません。
  </Warning>
</ParamField>

<ParamField body="aspect_ratio" type="string">
  出力アスペクト比。`size` と `ratio` も使用できます。

  T2V の値：`21:9`、`16:9`、`4:3`、`1:1`、`3:4`、`9:16`。

  * T2V で省略または `adaptive`：`16:9` にフォールバック
  * I2V：入力画像から決まり、このフィールドは無視
</ParamField>

<ParamField body="first_frame_image" type="string">
  動画の先頭フレームに使う公開画像 URL。
</ParamField>

<ParamField body="last_frame_image" type="string">
  末尾フレームに使う公開画像 URL。単独でも `first_frame_image` と組み合わせても使用できます。
</ParamField>

<ParamField body="image_with_roles" type="object[]">
  `first_frame_image` / `last_frame_image` の代わりに使えるロール付き画像配列。

  <Expandable title="image_with_roles 要素">
    <ResponseField name="url" type="string" required>
      公開画像 URL
    </ResponseField>

    <ResponseField name="role" type="string" required>
      対応ロール：

      * `first_frame`（`first`、`start` も可）
      * `last_frame`（`last`、`end_frame`、`tail` も可）
    </ResponseField>
  </Expandable>

  各ロールは最大 1 枚。`role` は空にできません。
</ParamField>

<ParamField body="watermark" type="boolean" default="false">
  AIGC ウォーターマークを追加するかどうか。別名：`aigc_watermark`。
</ParamField>

<ParamField body="webhook" type="string">
  タスクが成功または失敗で終了したときに通知を受信します。

  <Note>
    MiniMax の `callback_url` ではなく `webhook` を使用してください。`callback_url` はゲートウェイ内部用です。
  </Note>
</ParamField>

## 非対応パラメータ

次の値はタスク作成・課金前に HTTP 400 を返します。

| パラメータ / 値                                     | 理由                         |
| --------------------------------------------- | -------------------------- |
| `image_urls`                                  | 参照画像として扱われますが、本モデルは参照画像非対応 |
| `image_with_roles[].role = "reference_image"` | 先頭・末尾フレームのみ対応              |
| `video_urls` / `video_url`                    | 参照動画非対応                    |
| `audio_urls` / `audio_url`                    | 参照音声非対応                    |
| `resolution: "2K"`                            | `768P` と `480P` のみ         |
| `duration: 4` または `15` 超                      | 5～15 秒のみ                   |

<Tip>
  参照素材、2K、中間フレーム、4 秒動画には [MiniMax-H3](/ja/api-reference/videos/minimax-h3/generation) を使用してください。
</Tip>

## 画像の制限

リクエスト本文全体は 64 MB 以下です。公開 URL を使用し、Base64 は使用しないでください。

| 項目     | 制限                                    |
| ------ | ------------------------------------- |
| 形式     | JPG / JPEG / PNG / WEBP / HEIC / HEIF |
| 1 ファイル | ≤ 30 MB                               |
| 幅・高さ   | 256～5760 px                           |
| アスペクト比 | 0.4～2.5                               |
| 枚数     | 先頭 1 枚、末尾 1 枚、合計最大 2 枚                |

## 例

### 先頭フレーム指定

```json theme={null}
{
  "model": "MiniMax-H3-Max",
  "prompt": "湯気が立ち、カメラがゆっくり近づく。",
  "first_frame_image": "https://cdn.example.com/ramen.png",
  "duration": 5,
  "resolution": "480P"
}
```

### 先頭・末尾フレーム指定

```json theme={null}
{
  "model": "MiniMax-H3-Max",
  "prompt": "朝から夕焼けへゆっくり移り変わる。",
  "first_frame_image": "https://cdn.example.com/morning.png",
  "last_frame_image": "https://cdn.example.com/sunset.png",
  "duration": 8,
  "resolution": "768P"
}
```

## タスクの照会

送信後に `task_id` が返ります。[タスク状態](/ja/api-reference/tasks/status)を 5～10 秒ごとに照会し、クライアントのタイムアウトは 15 分を推奨します。

| `status`     | 意味                              |
| ------------ | ------------------------------- |
| `pending`    | 送信済みまたは待機中                      |
| `processing` | 生成中                             |
| `completed`  | 動画 URL は `result.videos[0].url` |
| `failed`     | `error.message` を確認。自動返金        |

<Note>
  生成された動画 URL は通常約 24 時間で失効します。早めに保存してください。
</Note>

## 料金

総額 = 1 秒あたりの単価 × 動画時間。先頭・末尾画像は無料です。

| 項目      | 単価               |
| ------- | ---------------- |
| 768P 動画 | **\$0.075 / 秒**  |
| 480P 動画 | **\$0.0495 / 秒** |
| 入力画像    | **無料**           |

送信時に見積額を事前確保します。失敗タスクは全額自動返金され、最終金額はタスクの `cost` が基準です。

## エラー

| 場面                      | 結果             |
| ----------------------- | -------------- |
| 空または 7000 文字超の `prompt` | 400、タスクなし      |
| `duration` が 5～15 の範囲外  | 400、タスクなし      |
| 非対応の `resolution`       | 400、タスクなし      |
| 参照素材                    | 400、タスクなし      |
| 不正または重複した画像ロール          | 400、タスクなし      |
| 残高不足                    | 402            |
| コンテンツ安全性で拒否             | 422            |
| レート制限                   | 429、バックオフして再試行 |

生成中の失敗は `status = failed` と `error.message` を返し、自動返金されます。

## Response

<ResponseField name="code" type="integer">
  レスポンスコード。成功時は 200
</ResponseField>

<ResponseField name="data" type="array">
  初期状態とタスク ID を含む送信結果

  <Expandable title="配列要素">
    <ResponseField name="status" type="string">
      初期値は `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      進捗と結果の照会に使う一意の ID
    </ResponseField>
  </Expandable>
</ResponseField>
