> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.beatapi.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.beatapi.io/_mcp/server.

# MiniMax H3 Max Turbo

POST https://api.beatapi.io/v1/videos/tasks
Content-Type: application/json

通过文本或一两帧画面，生成 480P 或 768P 的 5 秒及以上视频，输入与 H3 Max 相同，价格为其一半。- 异步：创建调用返回任务 ID，任务成功后即可获得视频。
- 三种输入方式：仅文本、首帧、首尾帧。没有参考输入，也没有 `aspect_ratio`。
- 两档分辨率：480P 和 768P（默认），须使用大写。
- 按视频秒数计费，费率取决于所选分辨率；`duration` 最少 5 秒。失败的任务不收费。POST/v1/videos/tasks试一试在调试窗口里打开本模型，填入你的 BeatAPI API 密钥即可创建任务。调用是真实的，费用从你自己的余额中扣除。## 模型 ID五个 MiniMax H3 模型共用这个端点，但输入各不相同。下面的取值直接来自网关契约。| 模型 ID                      | `duration`（秒） | `resolution`            | 参考图片上限 | 参考视频上限 | 参考音频上限 | 适用场景                                                                          |
| -------------------------- | ------------- | ----------------------- | ------ | ------ | ------ | ----------------------------------------------------------------------------- |
| `minimax-h3`               | 4–15          | `768p`, `2K`            | 9      | 3      | 3      | 你已经在使用原始 ID。输入和价格与 `minimax-h3-fast` 相同。                                      |
| `minimax-h3-fast`          | 4–15          | `768p`, `2K`            | 9      | 3      | 3      | 需要 2K 输出，或需要带音频的参考组合以及最多 3 段参考视频。                                             |
| `minimax-h3-normal`        | 3–15          | `480p`, `768p`, `1080p` | 4      | 1      | —      | 价格最重要且可以接受更久的等待：渲染较慢，同分辨率下价格是 Fast 的一半，增加 480p、1080p 和 `seed`，但参考素材更少（不支持音频）。 |
| `minimax-h3-max`           | ≥ 5           | `480P`, `768P`          | —      | —      | —      | 从文本或一两帧画面出发，需要 480P 或 768P 和 `seed`；不接受参考输入，也没有 `aspect_ratio`。               |
| **`minimax-h3-max-turbo`** | ≥ 5           | `480P`, `768P`          | —      | —      | —      | 输入和分辨率与 `minimax-h3-max` 相同，挂牌价为其一半。                                          |## 接口与鉴权`POST https://api.beatapi.io/v1/videos/tasks`Authorization
string
必需你的 BeatAPI API 密钥，以 `Bearer <BEATAPI_API_KEY>` 形式发送。在[控制台](https://beatapi.io/dashboard)创建密钥。密钥只能保存在你的服务端，不要放进浏览器或移动端应用。请求体使用 JSON，并设置 `Content-Type: application/json`。`Idempotency-Key` 为可选：每个逻辑请求发送一个唯一值（最长 255 个字符），仅在重试完全相同的请求体时复用。24 小时内，用相同的键和请求体重试会再次返回第一次的响应，并带上 `Idempotent-Replayed: true`；相同的键搭配不同的请求体则返回 `409 idempotency_conflict`。非 2xx 的响应不会被保存，因此 400 或 402 之后的重试会重新执行。## 请求流程向接口 `POST` 下方的参数。返回 `201` 表示任务已被接受，其价格已从你的余额中预留；任务在后台运行。保存 `data.id`。调用 `GET /v1/tasks/{task_id}`，两次调用之间等待 `data.poll_after_seconds` 秒（图片 5 秒，视频 8 秒），直到 `status` 为 `succeeded` 或 `failed`。也可以为 `task.succeeded` 和 `task.failed` 注册 [Webhook](/webhooks)；仍需保留轮询作为兜底，因为因处理超时而终止的任务不会发送事件。状态为 `succeeded` 时，下载每个 `data.output.media[].url` 并保存你需要的文件；BeatAPI 不承诺结果链接的保留时长。状态为 `failed` 时，读取 `data.error_code` 和 `data.error_message`：预扣的金额已退回你的余额，`data.retryable` 表示再次发送相同请求是否可能成功。## 输入模式| 模式     | 必填输入                             | 说明                               |
| ------ | -------------------------------- | -------------------------------- |
| 文本生成视频 | `model`、`prompt`                 | 不要传 `images`。                    |
| 首帧     | `model`、`prompt`、`images`（1 个链接） | 视频从该图片开始。                        |
| 首尾帧    | `model`、`prompt`、`images`（2 个链接） | `images[0]` 是首帧，`images[1]` 是尾帧。 |## 请求参数model
string
必需要运行的模型。**取值**：`minimax-h3-max-turbo`**取值有误时**- 缺失：`"model" is required`
- 把图片模型发到了这个端点：`"model" nano-banana-2 is served by POST /v1/images/tasks, not this endpoint`prompt
string
必需镜头中发生的内容：动作、表情、运镜和风格。**长度**：1–5000 个字符- 长度按字符计算（一个中日韩字符算一个）。
- 使用帧时，请描述视频如何从一帧过渡到另一帧，或首帧之后什么在运动。**取值有误时**- 缺失：`"prompt" is required`
- 为空或超过上限：`"prompt" has an unsupported length`images
string[]
可选一个首帧，或一个首帧加一个尾帧。**数量**：1–2  \
每一项都必须是公网 `https://` 链接。本地文件请先[上传](/quick-guide#upload-an-input-file)（`POST /v1/files`），再传入返回的 `data.url`。- 一个链接：视频从这张图片开始。两个链接：`images[0]` 是首帧，`images[1]` 是尾帧。
- 该模型不接受参考图片（传 `reference_images` 会被拒绝）。**取值有误时**- 超过两个链接：`"images" accepts at most 2 items`
- 不是 https\:// 链接：`"images[0]" must be a public HTTPS URL`duration
integer
可选默认值: 5视频长度，单位为秒，须为不小于 5 的整数。**默认值**：`5`  \
**范围**：≥ 5- 不传则使用 `5`。
- 价格随该值变化（见计费）。**取值有误时**- 小于 5 秒，或不是整数：`"duration" is outside its supported range`resolution
string
可选默认值: 768P输出分辨率。768P 每秒的价格高于 480P。**可选值**：`480P`, `768P`  \
**默认值**：`768P`- 仅限大写：`768p` 会被拒绝。
- 这里不提供 1080P 和 2K；`minimax-h3-normal` 提供 1080p，`minimax-h3-fast` 提供 2K。**取值有误时**- 值不在列表中（例如 `768p`、`1080P` 或 `2K`）：`"resolution" must be one of: [480P 768P]`seed
integer
可选用于固定生成的随机种子。不传则使用随机种子。**范围**：≥ 0- 不小于 0 的整数。**取值有误时**- 为负数或不是整数：`"seed" is outside its supported range`## 输入素材限制网关会在创建任务之前读取每一项输入，超出这些限制的输入会被拒绝，并返回点名该输入的 `400 bad_request`。不扣费。| 素材 | 创建任务前检查的限制                          |
| -- | ----------------------------------- |
| 图片 | 宽和高均为 256–5760 像素；宽高比（宽 ÷ 高）0.4–2.5 |- 该模型只接受图片，因此只有图片一行适用；视频和音频两行为 H3 各模型共用，在这里不适用。
- 图片按你发送的顺序检查。限制按边长、宽高比的顺序检查。报错信息会按列表名和位置指出对应输入，位置与字段报错一样从 0 开始计数：`images[0] is 200x200 pixels; this model takes images 256 to 5760 pixels on each side.`
- 只有当链接所在主机返回 HTTP 4xx 错误或返回空文件时，才会在创建时被拒绝，例如 `images[1] could not be downloaded: the URL returned HTTP 404.`；输入的其他问题会在提交之后才显现，并导致任务失败（全额退款）。
- 手头只有本地文件？请用 `POST /v1/files` 上传，并传入返回的 `data.url`。## 本模型不接受的字段传入下列字段会在扣费之前被拒绝，而不是被忽略：- `aspect_ratio`、`reference_images`、`reference_videos`、`reference_audios`、`generate_audio`、`watermark`、`quality`、`sound`，以及其他视频模型的任何字段 → `field "aspect_ratio" is not supported by model minimax-h3-max-turbo`（其中是你传入的字段名）。
- 其他任何未知字段 → `unknown field: <name>`。需要参考输入请使用 `minimax-h3-fast`（图片、视频和音频）或 `minimax-h3-normal`（图片和一段视频）。## 请求示例```bash title="cURL"
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "minimax-h3-max-turbo",
  "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
  "duration": 5,
  "resolution": "768P"
}'
``````python title="Python"
import os
import requests

response = requests.post(
    "https://api.beatapi.io/v1/videos/tasks",
    headers={"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}"},
    json={
      "model": "minimax-h3-max-turbo",
      "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
      "duration": 5,
      "resolution": "768P"
    },
    timeout=60,
)
body = response.json()
if not response.ok:
    raise RuntimeError(f"{response.status_code} {body['error']['code']}: {body['error']['message']}")
task = body["data"]
print(task["id"], task["status"])
``````javascript title="JavaScript"
const response = await fetch('https://api.beatapi.io/v1/videos/tasks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.BEATAPI_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "model": "minimax-h3-max-turbo",
    "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
    "duration": 5,
    "resolution": "768P"
  }),
});
const body = await response.json();
if (!response.ok) throw new Error(`${response.status} ${body.error.code}: ${body.error.message}`);
console.log(body.data.id, body.data.status);
```### 文本生成视频一段 5 秒的 768P 视频。```bash
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "minimax-h3-max-turbo",
  "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
  "duration": 5,
  "resolution": "768P"
}'
```### 首帧视频从该图片开始。```bash
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "minimax-h3-max-turbo",
  "prompt": "The performer turns toward the camera as neon light sweeps across the stage",
  "images": [
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "duration": 5,
  "resolution": "768P"
}'
```### 首尾帧视频从第一张图片过渡到第二张，输出 480P，并固定 seed。```bash
curl --request POST \
  --url https://api.beatapi.io/v1/videos/tasks \
  --header "Authorization: Bearer $BEATAPI_API_KEY" \
  --header 'Content-Type: application/json' \
  --data '{
  "model": "minimax-h3-max-turbo",
  "prompt": "The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot",
  "images": [
    "https://media.beatapi.io/samples/smart-bottle.png",
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "duration": 6,
  "resolution": "480P",
  "seed": 42
}'
```## 响应### 创建任务（201）任务对象。任务成功之前 `output` 为 `null`。标注“运行中”的字段会在任务结束后消失。```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "minimax-h3-max-turbo",
    "capability_version": 1,
    "media_type": "video",
    "model": "minimax-h3-max-turbo",
    "status": "queued",
    "stage": "queued",
    "created_at": 1791993600,
    "updated_at": 1791993600,
    "completed_at": null,
    "poll_after_seconds": 8,
    "output": null,
    "usage": {
      "credits_reserved": 0.2,
      "credits_settled": 0,
      "credits_refunded": 0,
      "credits_charged": 0.2,
      "billable_duration_seconds": 5
    },
    "request_id": "req_5f0c2a9e4b7d4e31",
    "error_code": null,
    "error_message": null
  }
}
```| 字段                                     | 类型                | 说明                                                                        |
| -------------------------------------- | ----------------- | ------------------------------------------------------------------------- |
| `data.id`                              | `string`          | 任务 ID：`task_` 后接 32 位字母和数字。用于轮询以及匹配 Webhook 事件。                           |
| `data.object`                          | `string`          | 固定为 `task`。                                                               |
| `data.task_kind`                       | `string`          | `image` 或 `video`。                                                        |
| `data.capability_id`                   | `string`          | 你发送的模型 ID。                                                                |
| `data.capability_version`              | `integer`         | 模型的契约版本，当前为 `1`。                                                          |
| `data.media_type`                      | `string`          | `image` 或 `video`。                                                        |
| `data.model`                           | `string`          | 你发送的模型 ID（与 `capability_id` 相同）。                                          |
| `data.status`                          | `string`          | `queued`、`processing`、`succeeded` 或 `failed`。只有后两个是终态。                    |
| `data.stage`                           | `string`          | 与 `status` 相同；为旧版客户端保留。                                                   |
| `data.created_at`                      | `integer`         | 任务创建时间，Unix 秒。                                                            |
| `data.updated_at`                      | `integer`         | 最后一次变更时间，Unix 秒。                                                          |
| `data.completed_at`                    | `integer \| null` | 任务结束时间，Unix 秒；运行中为 `null`。                                                |
| `data.poll_after_seconds`              | `integer`         | 运行中：下一次轮询前需要等待的秒数（图片 5，视频 8）。                                             |
| `data.typical_seconds`                 | `object`          | 运行中且近期样本足够时出现：在最近的 `window` 内，根据 `samples` 个任务统计的完成时间 `p50` 和 `p90`，单位为秒。 |
| `data.output`                          | `object \| null`  | 任务结果；`status` 为 `succeeded` 之前为 `null`。见下方输出字段。                           |
| `data.usage.credits_reserved`          | `number`          | 创建任务时从你的余额中预扣的美元金额。                                                       |
| `data.usage.credits_charged`           | `number`          | 该任务的费用（美元）；失败的任务为 `0`。                                                    |
| `data.usage.credits_settled`           | `number`          | 最终结算扣除的美元金额；任务成功时设置，否则为 `0`。                                              |
| `data.usage.credits_refunded`          | `number`          | 退回你余额的美元金额；失败的任务在退款记录完成后等于预扣金额。                                           |
| `data.usage.billable_duration_seconds` | `integer`         | 仅视频：计价所依据的秒数。模型未上报时长时不出现。                                                 |
| `data.request_id`                      | `string`          | 请求 ID。联系支持时请附上。                                                           |
| `data.error_code`                      | `string \| null`  | 失败码；任务未失败时为 `null`。                                                       |
| `data.error_message`                   | `string \| null`  | 出了什么问题以及该改什么；任务未失败时为 `null`。                                              |### 任务完成`GET /v1/tasks/{task_id}` 返回 HTTP 200 和 `status: "succeeded"`，结果在 `data.output` 中。```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "minimax-h3-max-turbo",
    "capability_version": 1,
    "media_type": "video",
    "model": "minimax-h3-max-turbo",
    "status": "succeeded",
    "stage": "succeeded",
    "created_at": 1791993600,
    "updated_at": 1791993690,
    "completed_at": 1791993690,
    "output": {
      "media": [
        {
          "type": "video",
          "url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4",
          "mime_type": "video/mp4"
        }
      ],
      "r2_url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4"
    },
    "usage": {
      "credits_reserved": 0.2,
      "credits_settled": 0.2,
      "credits_refunded": 0,
      "credits_charged": 0.2,
      "billable_duration_seconds": 5
    },
    "request_id": "req_5f0c2a9e4b7d4e31",
    "error_code": null,
    "error_message": null
  }
}
```#### 输出字段| 字段                         | 类型         | 说明                                  |
| -------------------------- | ---------- | ----------------------------------- |
| `output.media`             | `object[]` | 生成的文件；该模型为一段视频。                     |
| `output.media[].type`      | `string`   | 始终为 `video`。                        |
| `output.media[].url`       | `string`   | 已存储视频的 HTTPS 链接。请下载并自行保存；不承诺保留期限。   |
| `output.media[].mime_type` | `string`   | 文件类型，例如 `video/mp4`。                |
| `output.r2_url`            | `string`   | 再次给出的视频 URL，供旧版客户端使用。请改为读取 `media`。 |### 任务失败失败的任务在 `GET /v1/tasks/{task_id}` 上仍然是 HTTP 200：失败信息在响应体里。预扣金额会全额退回，因此不会扣费。```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "minimax-h3-max-turbo",
    "capability_version": 1,
    "media_type": "video",
    "model": "minimax-h3-max-turbo",
    "status": "failed",
    "stage": "failed",
    "created_at": 1791993600,
    "updated_at": 1791993690,
    "completed_at": 1791993690,
    "output": null,
    "usage": {
      "credits_reserved": 0.2,
      "credits_settled": 0,
      "credits_refunded": 0.2,
      "credits_charged": 0,
      "billable_duration_seconds": 5
    },
    "retryable": true,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "error_code": "processing_failed",
    "error_message": "The task failed during processing on our side. Retry; a failed task is refunded."
  }
}
```| 字段                   | 类型        | 说明                                                                                                                                                                          |
| -------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `data.error_code`    | `string`  | `bad_request` 和 `content_policy_violation`（需修改请求）之一，或 `processing_unavailable`、`processing_timeout`、`processing_failed` 和 `result_transfer_failed`（稍后重试）之一。见[错误码](/errors)。 |
| `data.error_message` | `string`  | 一句话，指出问题和处理方式。                                                                                                                                                              |
| `data.retryable`     | `boolean` | 仅在任务失败时出现：为 `true` 表示再次发送相同请求可能成功。                                                                                                                                          |
| `data.usage`         | `object`  | 退款记录完成后（通常就在任务失败的那一刻）：`credits_charged` 和 `credits_settled` 为 `0`；`credits_refunded` 等于 `credits_reserved`。                                                                 |## 完整示例创建任务，按服务端给出的轮询提示等待，然后打印结果链接。请在环境变量中设置 `BEATAPI_API_KEY` 并安装 `requests`。```python
import os
import time
import uuid

import requests

API = "https://api.beatapi.io"
HEADERS = {"Authorization": f"Bearer {os.environ['BEATAPI_API_KEY']}"}


def create_task(body: dict) -> dict:
    # One Idempotency-Key per logical request: a retry with the same key cannot create a second task.
    headers = {**HEADERS, "Idempotency-Key": str(uuid.uuid4())}
    for attempt in range(3):
        response = requests.post(f"{API}/v1/videos/tasks", headers=headers, json=body, timeout=60)
        if response.status_code in (429, 503) and attempt < 2:
            time.sleep(int(response.headers.get("Retry-After", 10)))
            continue
        break
    try:
        payload = response.json()
    except ValueError:  # an edge error page is not JSON
        response.raise_for_status()
        raise
    if not response.ok:
        error = payload["error"]
        raise RuntimeError(f"{response.status_code} {error['code']}: {error['message']} (request_id={error.get('request_id')})")
    return payload["data"]


def wait_for_task(task_id: str, timeout_seconds: int = 1800) -> dict:
    deadline = time.monotonic() + timeout_seconds
    while time.monotonic() < deadline:
        response = requests.get(f"{API}/v1/tasks/{task_id}", headers=HEADERS, timeout=30)
        if response.status_code == 429 or response.status_code >= 500:
            time.sleep(int(response.headers.get("Retry-After", 10)))
            continue
        response.raise_for_status()
        task = response.json()["data"]
        if task["status"] in ("succeeded", "failed"):
            return task
        time.sleep(task.get("poll_after_seconds", 5))
    raise TimeoutError(f"task {task_id} is still running; keep polling later")


task = create_task({
  "model": "minimax-h3-max-turbo",
  "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
  "duration": 5,
  "resolution": "768P"
})
print("created", task["id"])
task = wait_for_task(task["id"])
if task["status"] == "failed":
    raise SystemExit(f"{task['error_code']}: {task['error_message']}")
for item in task["output"]["media"]:
    print(item["url"])
```## 计费- 按视频秒数计费：请求的 `duration` 乘以所选分辨率的费率，480P 约为每秒 $0.025，768P 约为每秒 $0.04。下方挂牌价按 8 秒计算。
- 同分辨率下是 `minimax-h3-max` 的一半。
- 帧数和 `seed` 不会改变价格。
- 价格在创建任务时预留；任务上的 `usage.billable_duration_seconds` 显示实际计费的秒数。
- 失败的任务（包括提交后被内容审核拒绝的）会全额退款。当前牌价，与[价格页](https://beatapi.io/pricing)一致。享有协商折扣的账户实付更低；任务的 `data.usage` 始终显示实际扣费金额。| 选项         | 牌价（美元） |
| ---------- | ------ |
| 8 秒 · 480P | \$0.2  |
| 8 秒 · 768P | \$0.32 |## 常见错误| 错误或现象                                                                     | 原因                                                                                                     | 处理方式                                                     |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------ | -------------------------------------------------------- |
| 400 `"resolution" must be one of: [480P 768P]`                            | 传了小写（`768p`），或 `1080P` / `2K`：该模型只有两档，且须使用大写。                                                          | 传 `480P` 或 `768P`。                                       |
| 400 `"duration" is outside its supported range`                           | 小于 5、不是整数，或以字符串形式传入。                                                                                   | 传入 5 或更大的整数。                                             |
| 400 `field "aspect_ratio" is not supported by model minimax-h3-max-turbo` | 该模型没有 `aspect_ratio` 字段（`reference_images`、`reference_videos`、`reference_audios`、`generate_audio` 同理）。 | 删除该字段。需要参考输入请使用 `minimax-h3-fast` 或 `minimax-h3-normal`。 |
| 400 `"images" accepts at most 2 items`                                    | 超过了一个首帧加一个尾帧。                                                                                          | 传一张或两张图片。                                                |
| 400 `"seed" is outside its supported range`                               | seed 为负数或小数。                                                                                           | 传不小于 0 的整数，或不传 `seed`。                                   |
| 任务 `failed`，原因为 `content_policy_violation`                                | 提示词、某个输入或结果被内容审核拒绝。                                                                                    | 修改提示词或输入。原样重试仍会失败；不会收费。                                  |
| 402 `insufficient_credits`                                                | 余额低于该请求预留的价格。                                                                                          | 充值，或降低 `duration` 或 `resolution`。                        |## HTTP 错误速查任务生成之前的错误会以非 2xx 响应返回，不扣费。请根据 `error.code` 或 `error.retryable` 判断处理方式；`message` 会指出问题所在。完整列表和重试策略见[错误码](/errors)。```json
{
  "error": {
    "code": "bad_request",
    "message": "\"prompt\" is required",
    "retryable": false,
    "request_id": "req_5f0c2a9e4b7d4e31"
  }
}
```| HTTP 状态码 | `error.code`                                                                                  | 处理方式                                                   |
| -------- | --------------------------------------------------------------------------------------------- | ------------------------------------------------------ |
| 400      | `bad_request`, `content_policy_violation`                                                     | 修改请求；message 会点名出错的字段。不要原样重试。                          |
| 401      | `missing_api_key`, `invalid_api_key`（旧版客户端可能看到 `unauthorized`）                                | 以 `Authorization: Bearer <key>` 发送有效的密钥。               |
| 402      | `insufficient_credits`                                                                        | 充值，或提高密钥的额度，然后重新发送。                                    |
| 403      | `forbidden`                                                                                   | 该密钥或账户不能使用此模型（例如免费额度只覆盖部分模型）。不要原样重试。                   |
| 404      | `not_found`                                                                                   | 在 `GET /v1/tasks/{task_id}` 上：该任务在此密钥所属账户下不存在。请检查 ID。  |
| 409      | `idempotency_conflict`                                                                        | 换一个新的 `Idempotency-Key`，或等待使用该键的第一个请求完成。               |
| 429      | `rate_limit_exceeded`                                                                         | 等待 `Retry-After` 秒（也见 `error.retry_after_seconds`）后重试。 |
| 500      | `internal_error`                                                                              | 退避重试；若持续出现，请带上 `request_id` 联系支持。                      |
| 503      | `processing_unavailable`, `processing_timeout`, `processing_failed`, `result_transfer_failed` | 未扣费。使用指数退避重试。                                          |

Reference: https://docs.beatapi.io/api-reference/video-api/minimax-h3-max-turbo

## Authentication

- `Authorization` header (bearer token, required) — Send your API key as `Authorization: Bearer <BEATAPI_API_KEY>`.

## Servers

- `https://api.beatapi.io` (Direct, default)
- `https://api.beatapi.io` (API)

## Request

### Headers

- `Idempotency-Key` (string, optional) — 请求体使用 JSON，并设置 `Content-Type: application/json`。`Idempotency-Key` 为可选：每个逻辑请求发送一个唯一值（最长 255 个字符），仅在重试完全相同的请求体时复用。24 小时内，用相同的键和请求体重试会再次返回第一次的响应，并带上 `Idempotent-Replayed: true`；相同的键搭配不同的请求体则返回 `409 idempotency_conflict`。非 2xx 的响应不会被保存，因此 400 或 402 之后的重试会重新执行。

### Body (application/json)

This endpoint expects a MinimaxH3MaxTurboVideoRequest.

- `model` (enum, required) — 要运行的模型。 **取值**：`minimax-h3-max-turbo` **取值有误时** - 缺失：`"model" is required` - 把图片模型发到了这个端点：`"model" nano-banana-2 is served by POST /v1/images/tasks, not this endpoint`
  - Allowed values: `minimax-h3-max-turbo`
- `prompt` (string, required) — 镜头中发生的内容：动作、表情、运镜和风格。 **长度**：1–5000 个字符 - 长度按字符计算（一个中日韩字符算一个）。 - 使用帧时，请描述视频如何从一帧过渡到另一帧，或首帧之后什么在运动。 **取值有误时** - 缺失：`"prompt" is required` - 为空或超过上限：`"prompt" has an unsupported length`
- `duration` (integer, optional, default: 5) — 视频长度，单位为秒，须为不小于 5 的整数。 **默认值**：`5` **范围**：≥ 5 - 不传则使用 `5`。 - 价格随该值变化（见计费）。 **取值有误时** - 小于 5 秒，或不是整数：`"duration" is outside its supported range`
- `images` (list of string, optional) — 一个首帧，或一个首帧加一个尾帧。 **数量**：1–2 每一项都必须是公网 `https://` 链接。本地文件请先[上传](/quick-guide#upload-an-input-file)（`POST /v1/files`），再传入返回的 `data.url`。 - 一个链接：视频从这张图片开始。两个链接：`images[0]` 是首帧，`images[1]` 是尾帧。 - 该模型不接受参考图片（传 `reference_images` 会被拒绝）。 **取值有误时** - 超过两个链接：`"images" accepts at most 2 items` - 不是 https:// 链接：`"images[0]" must be a public HTTPS URL`
- `resolution` (enum, optional, default: 768P) — 输出分辨率。768P 每秒的价格高于 480P。 **可选值**：`480P`, `768P` **默认值**：`768P` - 仅限大写：`768p` 会被拒绝。 - 这里不提供 1080P 和 2K；`minimax-h3-normal` 提供 1080p，`minimax-h3-fast` 提供 2K。 **取值有误时** - 值不在列表中（例如 `768p`、`1080P` 或 `2K`）：`"resolution" must be one of: [480P 768P]`
  - Allowed values: `480P`, `768P`
- `seed` (integer, optional) — 用于固定生成的随机种子。不传则使用随机种子。 **范围**：≥ 0 - 不小于 0 的整数。 **取值有误时** - 为负数或不是整数：`"seed" is outside its supported range`

## Response

### 201

任务对象。任务成功之前 `output` 为 `null`。标注“运行中”的字段会在任务结束后消失。

- `map from string to any`

## Errors

### 400 Bad Request Error

`bad_request`, `content_policy_violation` 修改请求；message 会点名出错的字段。不要原样重试。

- `map from string to any`

### 401 Unauthorized Error

`missing_api_key`, `invalid_api_key`（旧版客户端可能看到 `unauthorized`） 以 `Authorization: Bearer <key>` 发送有效的密钥。

- `map from string to any`

### 402 Payment Required Error

`insufficient_credits` 充值，或提高密钥的额度，然后重新发送。

- `map from string to any`

### 403 Forbidden Error

`forbidden` 该密钥或账户不能使用此模型（例如免费额度只覆盖部分模型）。不要原样重试。

- `map from string to any`

### 409 Conflict Error

`idempotency_conflict` 换一个新的 `Idempotency-Key`，或等待使用该键的第一个请求完成。

- `map from string to any`

### 429 Too Many Requests Error

`rate_limit_exceeded` 等待 `Retry-After` 秒（也见 `error.retry_after_seconds`）后重试。

- `map from string to any`

### 500 Internal Server Error

`internal_error` 退避重试；若持续出现，请带上 `request_id` 联系支持。

- `map from string to any`

### 503 Service Unavailable Error

`processing_unavailable`, `processing_timeout`, `processing_failed`, `result_transfer_failed` 未扣费。使用指数退避重试。

- `map from string to any`

## Examples

### 文本生成视频

**Request**

```json
{
  "model": "minimax-h3-max-turbo",
  "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
  "duration": 5,
  "resolution": "768P"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "minimax-h3-max-turbo",
    "capability_version": 1,
    "completed_at": null,
    "created_at": 1791993600,
    "error_code": null,
    "error_message": null,
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "media_type": "video",
    "model": "minimax-h3-max-turbo",
    "object": "task",
    "output": null,
    "poll_after_seconds": 8,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1791993600,
    "usage": {
      "billable_duration_seconds": 5,
      "credits_charged": 0.2,
      "credits_refunded": 0,
      "credits_reserved": 0.2,
      "credits_settled": 0
    }
  }
}
```

**SDK Code**

```python 文本生成视频
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "model": "minimax-h3-max-turbo",
    "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
    "duration": 5,
    "resolution": "768P"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript 文本生成视频
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"minimax-h3-max-turbo","prompt":"A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys","duration":5,"resolution":"768P"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 文本生成视频
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys\",\n  \"duration\": 5,\n  \"resolution\": \"768P\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 文本生成视频
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys\",\n  \"duration\": 5,\n  \"resolution\": \"768P\"\n}"

response = http.request(request)
puts response.read_body
```

```java 文本生成视频
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys\",\n  \"duration\": 5,\n  \"resolution\": \"768P\"\n}")
  .asString();
```

```php 文本生成视频
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "model": "minimax-h3-max-turbo",
  "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
  "duration": 5,
  "resolution": "768P"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 文本生成视频
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys\",\n  \"duration\": 5,\n  \"resolution\": \"768P\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 文本生成视频
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "minimax-h3-max-turbo",
  "prompt": "A slow cinematic push through a misty mountain village at dawn, smoke rising from the chimneys",
  "duration": 5,
  "resolution": "768P"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### 首帧

**Request**

```json
{
  "model": "minimax-h3-max-turbo",
  "prompt": "The performer turns toward the camera as neon light sweeps across the stage",
  "duration": 5,
  "images": [
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "768P"
}
```

**Response**

```json
{
  "data": {
    "capability_id": "minimax-h3-max-turbo",
    "capability_version": 1,
    "completed_at": null,
    "created_at": 1791993600,
    "error_code": null,
    "error_message": null,
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "media_type": "video",
    "model": "minimax-h3-max-turbo",
    "object": "task",
    "output": null,
    "poll_after_seconds": 8,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1791993600
  }
}
```

**SDK Code**

```python 首帧
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "model": "minimax-h3-max-turbo",
    "prompt": "The performer turns toward the camera as neon light sweeps across the stage",
    "duration": 5,
    "images": ["https://media.beatapi.io/samples/neon-singer.png"],
    "resolution": "768P"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript 首帧
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"minimax-h3-max-turbo","prompt":"The performer turns toward the camera as neon light sweeps across the stage","duration":5,"images":["https://media.beatapi.io/samples/neon-singer.png"],"resolution":"768P"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 首帧
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The performer turns toward the camera as neon light sweeps across the stage\",\n  \"duration\": 5,\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"768P\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 首帧
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The performer turns toward the camera as neon light sweeps across the stage\",\n  \"duration\": 5,\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"768P\"\n}"

response = http.request(request)
puts response.read_body
```

```java 首帧
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The performer turns toward the camera as neon light sweeps across the stage\",\n  \"duration\": 5,\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"768P\"\n}")
  .asString();
```

```php 首帧
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "model": "minimax-h3-max-turbo",
  "prompt": "The performer turns toward the camera as neon light sweeps across the stage",
  "duration": 5,
  "images": [
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "768P"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 首帧
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The performer turns toward the camera as neon light sweeps across the stage\",\n  \"duration\": 5,\n  \"images\": [\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"768P\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 首帧
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "minimax-h3-max-turbo",
  "prompt": "The performer turns toward the camera as neon light sweeps across the stage",
  "duration": 5,
  "images": ["https://media.beatapi.io/samples/neon-singer.png"],
  "resolution": "768P"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### 首尾帧

**Request**

```json
{
  "model": "minimax-h3-max-turbo",
  "prompt": "The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot",
  "duration": 6,
  "images": [
    "https://media.beatapi.io/samples/smart-bottle.png",
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "480P",
  "seed": 42
}
```

**Response**

```json
{
  "data": {
    "capability_id": "minimax-h3-max-turbo",
    "capability_version": 1,
    "completed_at": null,
    "created_at": 1791993600,
    "error_code": null,
    "error_message": null,
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "media_type": "video",
    "model": "minimax-h3-max-turbo",
    "object": "task",
    "output": null,
    "poll_after_seconds": 8,
    "request_id": "req_5f0c2a9e4b7d4e31",
    "stage": "queued",
    "status": "queued",
    "task_kind": "video",
    "updated_at": 1791993600
  }
}
```

**SDK Code**

```python 首尾帧
import requests

url = "https://api.beatapi.io/v1/videos/tasks"

payload = {
    "model": "minimax-h3-max-turbo",
    "prompt": "The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot",
    "duration": 6,
    "images": ["https://media.beatapi.io/samples/smart-bottle.png", "https://media.beatapi.io/samples/neon-singer.png"],
    "resolution": "480P",
    "seed": 42
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript 首尾帧
const url = 'https://api.beatapi.io/v1/videos/tasks';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"model":"minimax-h3-max-turbo","prompt":"The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot","duration":6,"images":["https://media.beatapi.io/samples/smart-bottle.png","https://media.beatapi.io/samples/neon-singer.png"],"resolution":"480P","seed":42}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go 首尾帧
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.beatapi.io/v1/videos/tasks"

	payload := strings.NewReader("{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot\",\n  \"duration\": 6,\n  \"images\": [\n    \"https://media.beatapi.io/samples/smart-bottle.png\",\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"480P\",\n  \"seed\": 42\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby 首尾帧
require 'uri'
require 'net/http'

url = URI("https://api.beatapi.io/v1/videos/tasks")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot\",\n  \"duration\": 6,\n  \"images\": [\n    \"https://media.beatapi.io/samples/smart-bottle.png\",\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"480P\",\n  \"seed\": 42\n}"

response = http.request(request)
puts response.read_body
```

```java 首尾帧
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.beatapi.io/v1/videos/tasks")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot\",\n  \"duration\": 6,\n  \"images\": [\n    \"https://media.beatapi.io/samples/smart-bottle.png\",\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"480P\",\n  \"seed\": 42\n}")
  .asString();
```

```php 首尾帧
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.beatapi.io/v1/videos/tasks', [
  'body' => '{
  "model": "minimax-h3-max-turbo",
  "prompt": "The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot",
  "duration": 6,
  "images": [
    "https://media.beatapi.io/samples/smart-bottle.png",
    "https://media.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "480P",
  "seed": 42
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp 首尾帧
using RestSharp;

var client = new RestClient("https://api.beatapi.io/v1/videos/tasks");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"model\": \"minimax-h3-max-turbo\",\n  \"prompt\": \"The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot\",\n  \"duration\": 6,\n  \"images\": [\n    \"https://media.beatapi.io/samples/smart-bottle.png\",\n    \"https://media.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"480P\",\n  \"seed\": 42\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 首尾帧
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "minimax-h3-max-turbo",
  "prompt": "The camera moves smoothly from the bottle on the table to the singer on a neon stage in one continuous shot",
  "duration": 6,
  "images": ["https://media.beatapi.io/samples/smart-bottle.png", "https://media.beatapi.io/samples/neon-singer.png"],
  "resolution": "480P",
  "seed": 42
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.beatapi.io/v1/videos/tasks")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```