---
title: &quot;透過 RunAPI 在 Hermes Agent 中使用 Hailuo — 影片 API 指南&quot;
url: &quot;https://runapi.ai/zh-TW/hermes-hailuo.md&quot;
canonical: &quot;https://runapi.ai/zh-TW/hermes-hailuo&quot;
locale: &quot;zh-TW&quot;
model: &quot;hailuo&quot;
---

# 在 Hermes Agent 中使用 Hailuo。

Hailuo 是 MiniMax 的影片生成模型，可產出原生 1080p 畫面並精準模擬物理效果，共有 6 種變體 — Hailuo 02 與 2.3，各具備文生影片與圖生影片端點，分 pro 與 standard 兩個方案。Hermes Agent 透過 RunAPI 的 custom:runapi provider 呼叫 — 與你設定聊天時相同的 key 和 base URL。

## API example

```bash
curl -X POST https://runapi.ai/api/v1/hailuo/text_to_video \
  -H &quot;Authorization: Bearer $RUNAPI_API_KEY&quot; \
  -H &quot;Content-Type: application/json&quot; \
  -d &#39;{
    &quot;model&quot;: &quot;hailuo-02-text-to-video-pro&quot;,
    &quot;prompt&quot;: &quot;A glass marble rolls across a wooden desk, catches the edge, and falls in slow motion. Camera follows the marble. Soft window light, shallow depth of field.&quot;
  }&#39;

```

### Response

```json
{
  &quot;task_id&quot;: &quot;tsk_abc123&quot;,
  &quot;status&quot;: &quot;pending&quot;,
  &quot;model&quot;: &quot;hailuo-02-text-to-video-pro&quot;
}

```

## How it works

1. **設定 RunAPI** — 設定 RUNAPI_API_KEY 環境變數。如果你已在 Hermes Agent 中將 RunAPI 新增為 custom:runapi provider 用於聊天，同一把 key 和 base_url 即可用於影片生成 — 無需額外設定。
2. **呼叫 Hailuo text_to_video 或 image_to_video** — 向 /api/v1/hailuo/text_to_video 發送 POST 請求，將 model 設為 hailuo-02-text-to-video-pro 並附上描述場景的 prompt。若要以圖片為錨點生成影片，使用 image_to_video 端點並傳入 first_frame_image_url 以保留來源主體。
3. **輪詢結果** — 端點會立即回傳 task_id。輪詢任務狀態端點，直到狀態變為 completed，再從回應中取得生成的影片 URL。pro 方案的典型處理時間在兩分鐘以內。

## Parameters

| Parameter | Type | Description |
|-----------|------|-------------|
| `model` | `string` | 必填。可選值：hailuo-02-text-to-video-pro、hailuo-02-text-to-video-standard、hailuo-02-image-to-video-pro、hailuo-02-image-to-video-standard、hailuo-2.3-image-to-video-pro、hailuo-2.3-image-to-video-standard。 |
| `prompt` | `string` | 必填。影片場景、鏡頭運動與燈光的文字描述。 |
| `first_frame_image_url` | `string` | image_to_video 端點必填。作為第一幀的來源圖片 URL。 |
| `last_frame_image_url` | `string` | 選填。作為最後一幀的圖片 URL。僅適用於 Hailuo 02 image-to-video。 |
| `duration_seconds` | `integer` | 選填。影片長度（秒）。可選值：6 或 10。standard 預設為 10，pro 固定。 |
| `output_resolution` | `string` | 選填。輸出解析度。02 standard 可選 512p 或 768p；2.3 變體可選 768p 或 1080p。 |
| `callback_url` | `string` | 選填。任務完成時接收 POST 通知的 Webhook URL。 |

## FAQ

### 我可以在 Hermes Agent 中使用 Hailuo 嗎？

可以。在 Hermes Agent 中將 RunAPI 設定為 custom:runapi provider，然後用 Hailuo model slug 呼叫 text_to_video 或 image_to_video 端點。你用於聊天的同一把 RUNAPI_API_KEY 也能處理影片生成。

### Hailuo 02 與 Hailuo 2.3 有什麼差別？

Hailuo 02 同時支援文生影片與圖生影片，具備首幀與末幀控制。Hailuo 2.3 僅支援圖生影片，但新增了改進的身體動態、微表情，以及動漫與插畫專用渲染風格。

### standard 方案的時長計費如何運作？

Standard 方案的價格隨 duration_seconds 而變。文生影片 standard 6 秒片段 30 美分、10 秒片段 50 美分。圖生影片 standard 的價格還受 output_resolution 影響 — 6 秒 512p 片段起價 12 美分。

### Hermes Agent 會自動處理非同步輪詢嗎？

不會。Hailuo 是非同步的 — API 會立即回傳 task_id。你的 Hermes Agent 工作流程需要自行輪詢任務狀態端點或提供 callback_url。典型生成時間為 60-120 秒。

### 我可以同時控制 Hailuo 影片的首幀與末幀嗎？

僅限 Hailuo 02 image-to-video 端點。同時傳入 first_frame_image_url 與 last_frame_image_url 以定義起始與結束幀。Hailuo 2.3 image-to-video 僅接受 first_frame_image_url。


## Links

- [Hermes Agent 設定指南 →](https://runapi.ai/zh-TW/hermes-agent)
- [Hailuo 模型 →](https://runapi.ai/zh-TW/models/hailuo)
- [Model catalog](https://runapi.ai/zh-TW/models)
- [API docs](https://runapi.ai/zh-TW/docs)
