> ## 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.

# Seedance 1.5 Pro API：位元組跳動的影片生成模型

> 用於文字到影片、影像到影片和影片擴展工作流程的位元組跳動影片生成 API

## 概覽

若要繼續現有鏡頭，請使用 [影片擴充請求](#video-extend)。將 `input.mode` 設為 `video-extend`，在 `video_urls` 中提供原始剪輯作為單一項目，並在 `prompt` 中描述接下來的內容。此範例包含 `duration`、`resolution` 與 `sound` 切換設定。

如果您要開啟和關閉 **影像** 而不是影片剪輯，請從 [圖生影片](#image-to-video) 開始，並依序傳送影格。

| 功能 | 值 |
| - | - |
| 模型 ID | `seedance-1-5-pro` |
| 模式 | `text-to-video`, `image-to-video`, `video-extend` |
| 提示詞長度 | 3 至 2500 個字元 |
| 參考圖片 | 1-2 個 `image-to-video` 的 URL；第二張影像用作結束影格 |
| 來源影片 | 正是 1 公開影片 URL 為 `video-extend` |
| 縱橫比 | `auto`、`1:1`、`3:4`、`4:3`、`9:16`、`16:9`、`21:9` 用於 `text-to-video` 和 `image-to-video` |
| 可用解析度 | `480p`, `720p`, `1080p` |
| 長度 | 4-12 秒；使用 `4`、`8` 或 `12` 進行可預測的層匹配 |
| 音訊 | 必需的 `sound` 切換 |
| 輸出 | 生成或擴展的影片 URL 位於 `resultJson.resultUrls` |

## 端點與身分驗證

API 基底網址：

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

| 方法 | 端點 | 用途 |
| - | - | - |
| `POST` | `/generateTask/seedance-1-5-pro` | 送出生成任務 |
| `GET` | `/statusTask/seedance-1-5-pro?taskId={taskId}` | 查詢任務狀態並取得結果 |

每個請求都必須附上 APIXO API 金鑰：

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

送出任務時，還需設定以下請求標頭：

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

## 非同步請求範例

以下範例提交一個最簡單的文字生成影片任務，回應中會傳回 `taskId`。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedance-1-5-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a calm seaside sunrise with gentle camera dolly movement",
      "resolution": "720p",
      "duration": 8,
      "sound": false,
      "aspect_ratio": "auto",
      "camera_fixed": false,
      "seed": 123456,
      "watermark": false
    }
  }'
```

成功回應：

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

請保留 `taskId`，後續輪詢結果時會用到。

## 輪詢結果

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

任務處理中的回應範例：

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

成功回應：

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

任務失敗時的回應範例：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "SensitiveContent",
    "failMsg": "Content was rejected by safety checks, please adjust the prompt",
    "createTime": 1767965610929,
    "completeTime": 1767965620132,
    "costTime": 9203
  }
}
```

等 `state` 變為 `success` 後，再解析 `resultJson`：

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

## 請求體

### 文生影片

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a clean product showcase on a neutral background, subtle lighting shifts, steady camera",
    "resolution": "720p",
    "duration": 8,
    "sound": false,
    "aspect_ratio": "auto",
    "camera_fixed": true,
    "seed": 123456,
    "watermark": false
  }
}
```

### 圖生影片

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "animate this landscape with moving clouds and soft wind",
    "image_urls": [
      "https://example.com/start-frame.jpg",
      "https://example.com/end-frame.jpg"
    ],
    "resolution": "480p",
    "duration": 4,
    "sound": true,
    "aspect_ratio": "1:1",
    "camera_fixed": false,
    "seed": 123456,
    "watermark": false
  }
}
```

### 影片擴充

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "video-extend",
    "prompt": "continue the same shot with a gentle smile and then a smooth ride-away",
    "video_urls": [
      "https://example.com/source.mp4"
    ],
    "resolution": "720p",
    "duration": 8,
    "sound": true,
    "camera_fixed": true,
    "seed": 123456,
    "watermark": false
  }
}
```

## 參數

**request\_type** `string` *required* (default: async)

取得結果的方式。選擇 `async` 時，透過 `statusTask` 輪詢結果；選擇 `callback` 時，透過 Webhook 接收結果。

**callback\_url** `string`

當 `request_type` 為 `callback` 時必填。請提供可從網際網路存取的 HTTPS 網址，以接收任務的最終結果。詳見 [Webhook](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)。

**input** `object` *required*

Seedance 1.5 Pro 的輸入參數。

**屬性**

**mode** `string`

生成模式。支援的值：`text-to-video`、`image-to-video`、`video-extend`。如果省略，APIXO 會推論：當存在 `image_urls` 時為 `image-to-video`，否則為 `text-to-video`。擴展源影片時，必須明確設定 `video-extend`。

**prompt** `string` *required*

描述所需影片或續集的文字提示。修剪後支援 3 至 2500 個字元。

**image\_urls** `string[]`

參考影像 URL。`image-to-video` 模式必填。支援 1 至 2 個 URL；當提供兩個時，第一個為起始影格，第二個為結束影格。

**video\_urls** `string[]`

需用於 [`video-extend`](#video-extend)。僅傳遞一個公開影片 URL 至陣列，並在 `prompt` 中描述下一個動作。`text-to-video` 與 [`image-to-video`](#image-to-video) 模式時，應省略 `video_urls`。開場與結束影格的影像請透過 `image_urls` 傳遞。

**resolution** `string` *required*

輸出影片分辨率。支援的值：`480p`、`720p`、`1080p`。

**duration** `integer` *required*

影片時長（以秒為單位）。接受從`4`到`12`的整數值；後端也接受數字字串。使用 `4`、`8` 或 `12` 進行可預測的層匹配。

**sound** `boolean` *required*

是否隨影片生成音訊。使用 `true` 產生聲音，或使用 `false` 產生無聲影片。

**aspect\_ratio** `string` (default: 1:1)

`text-to-video` 和 `image-to-video` 的輸出縱橫比。支援的值：`auto`、`1:1`、`3:4`、`4:3`、`9:16`、`16:9`、`21:9`。

**camera\_fixed** `boolean`

設定 `true` 以請求穩定的攝影機視圖。對於`video-extend`，當省略時，後端預設該欄位為`true`。

**seed** `integer`

選填的隨機種子可在重試和重複運行中獲得更可重複的結果。

**watermark** `boolean`

支援時是否在輸出影片中保留產生浮水印。

**nsfw\_checker** `boolean` (default: false)

對此請求啟用內容安全過濾。預設為`false`；提供時必須是布林值。

> [!TIP]
>
> 為保持相容性，仍接受舊版 `fixed_lens`，但新整合應使用 `camera_fixed`。

## 回應格式

### 送出任務時的回應

任務受理後，`POST /generateTask/seedance-1-5-pro` 會傳回任務 ID：

**code** `integer`

API 狀態碼。`200` 表示任務已受理。

**message** `string`

狀態說明。

**data.taskId** `string`

任務的唯一 ID，用於查詢任務狀態。

### 狀態回應欄位

**taskId** `string`

任務的唯一識別碼。

**state** `string`

目前的任務狀態，可能的值為 `pending`、`processing`、`success`、`failed`。

**resultJson** `string`

包含產生或擴充影片 URL 的 JSON 字串。當 `state` 為 `success` 時會存在。

**failCode** `string`

供程式判讀的錯誤碼，僅在 `state` 為 `failed` 時傳回。

**failMsg** `string`

失敗原因說明，僅在 `state` 為 `failed` 時傳回。

**createTime** `integer`

任務建立時的 Unix 時間戳記，單位為毫秒。

**completeTime** `integer`

任務完成時的 Unix 時間戳記，單位為毫秒。任務完成後才會傳回。

**costTime** `integer`

處理時間，以毫秒為單位。任務完成且有這項資料時傳回。

## Webhook 回呼模式

若希望後端自動收到最終結果，可使用回呼模式，無須輪詢。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedance-1-5-pro" \
  -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": "video-extend",
      "prompt": "continue the same scene with a smooth smile, then leave the frame naturally",
      "video_urls": [
        "https://example.com/source.mp4"
      ],
      "resolution": "720p",
      "duration": 8,
      "sound": true,
      "camera_fixed": true,
      "seed": 123456,
      "watermark": false
    }
  }'
```

當任務達到最終狀態時，回呼有效負載使用與狀態端點相同的統一回應形狀。請參閱 [Webhooks](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md) 以了解傳送要求和重試行為。

## 計費

新提交的非 LLM 請求按 **1 點 = `$0.001`** 計費。先依用量和加購項目計算總額，再套用帳戶折扣，最後將請求總額無條件進位至整數點數。若已約定固定單價，則保留該單價的精度，不再使用標準價或另行打折；最終點數仍須進位。詳見[積分換算與進位](https://apixo.ai/docs/zh-hant/pricing.md#credit-conversion-and-rounding)。

Seedance 1.5 Pro 按秒計費。所選的 `resolution`、`duration` 和 `sound` 值決定所有支援模式（包括 `video-extend`）的總成本。

| 解析度 | `sound` | 價格 |
| - | - | - |
| `480p` | `false` | `$0.011 / second` |
| `480p` | `true` | `$0.022 / second` |
| `720p` | `false` | `$0.024 / second` |
| `720p` | `true` | `$0.047 / second` |
| `1080p` | `false` | `$0.053 / second` |
| `1080p` | `true` | `$0.105 / second` |

總成本是每秒價格乘以計費持續時間。例如，`720p` 與 `sound: false` 持續 8 秒的成本為 `$0.192`。

最新的美元費率請見 [API 價目表](https://apixo.ai/pricing/api)。

## 耗時與輪詢

實際延遲可能會因提示複雜性、輸入媒體、模式、路由選擇和目前佇列負載而異。`video-extend` 包含來源剪輯分析和最終拼接，因此可能比直接生成文生影片或圖生影片需要更長的時間。

| 模式 | 長度 | 一般生成時間 | 建議首次查詢時間 | 輪詢間隔 |
| - | - | - | - | - |
| `text-to-video`, `image-to-video` | `4`秒 | 40s-60s | 任務建立 40 秒後 | 5s-10s |
| `text-to-video`, `image-to-video` | `8`秒 | 60s-90s | 任務建立 60 秒後 | 5s-10s |
| `text-to-video`, `image-to-video` | `12`秒 | 90s-120s | 任務建立 90 秒後 | 5s-10s |
| `video-extend` | `4`秒 | 45s-75s | 任務建立 45 秒後 | 5s-10s |
| `video-extend` | `8`秒 | 60s-110s | 任務建立 60 秒後 | 5s-10s |
| `video-extend` | `12`秒 | 90s-150s | 任務建立 90 秒後 | 5s-10s |

> [!TIP]
>
> 影片生成可能需要時間。對於生產工作負載，請使用回呼模式以避免頻繁輪詢。

請求頻率與並行數上限會依帳戶、API 金鑰和路由而異。收到 `429` 時，請降低請求頻率，並逐步拉長重試間隔。帳戶層級的限制請見[系統 API](https://apixo.ai/docs/zh-hant/api-reference/system.md)。

## 錯誤與排查

### HTTP 錯誤

| 代碼 | 含義 | 處理方式 |
| - | - | - |
| `400` | 請求主體無效、缺少必填欄位、模式不受支援、解析度不受支援、持續時間無效、來源 URL 陣列格式錯誤或提示/媒體被拒絕 | 修正請求後再試 |
| `401` | 缺少 API 金鑰，或金鑰無效 | 檢查 `Authorization` 請求標頭 |
| `402` | 餘額或配額不足 | 充值或更換帳號或金鑰 |
| `403` | 金鑰或路由無權訪問該模型 | 檢查權限和路由策略 |
| `429` | 已達到速率或並行限制 | 以指數退避方式重試 |
| `500` | 伺服器錯誤或未知任務失敗 | 重試並退避；如果重複出現，請聯絡支援人員 |
| `502` | 服務錯誤 | 逐步拉長間隔後重試 |
| `504` | 服務超時 | 重新嘗試；耗時較長的任務可改用回呼模式 |

### 任務失敗代碼

| 錯誤碼 | 含義 | 處理方式 |
| - | - | - |
| `MISSING_REQUIRED_PARAM` | 缺少必填欄位，例如 `prompt`、`video_urls`、`resolution`、`duration` 或 `sound` | 修正請求後再試 |
| `INVALID_PARAMETER` | 一個或多個欄位使用不支援的值或類型 | 檢查 `mode`、媒體 URL、`resolution`、`duration`、`sound`、`camera_fixed`、`seed` 和 `watermark` |
| `API_SERVICE_UNAVAILABLE` | 影片擴充處理或產生暫時不可用 | 稍後重試 |
| `PromptInvalid` | 提示被拒絕或格式錯誤 | 修改提示詞後再試一次 |
| `SensitiveContent` | 提示或產生的內容違反內容安全要求 | 更改提示或參考媒體 |
| `ImageFormatIncorrect` | 無法接受參考影像 | 使用公共 JPG、PNG 或 WebP 影像 URL |
| `RateLimited` | 請求頻率已達上限 | 稍後重試並退避 |
| `Timeout` | 工作流程未及時完成 | 重試、簡化提示或使用回呼方式 |
| `InsufficientBalance` | 產生服務暫時無法使用 | 稍後重試或聯絡支援人員 |
| `Unknown error` | 任務因不明原因失敗 | 重試或透過 `taskId` 聯繫支援人員 |

### 常見的驗證修復

| 問題現象 | 處理方式 |
| - | - |
| `mode` 被拒絕 | 使用`text-to-video`、`image-to-video`或`video-extend` |
| 圖生影片缺少 `image_urls` | 提供 1-2 公用影像 URL |
| video-extend 缺少 `video_urls` | 將`input.mode`設定為`video-extend`並提供準確的1個公共影片URL |
| `resolution` 被拒絕 | 使用`480p`、`720p`或`1080p` |
| `duration` 被拒絕 | 發送從 `4` 到 `12` 的整數 |
| `sound` 被拒絕 | 發送布林值：`true` 或 `false` |
| 提示長度錯誤 | 將修剪後的提示保持在 3-2500 個字元內 |

完整列表見[錯誤碼](https://apixo.ai/docs/zh-hant/api-reference/errors.md)。

## MCP 整合

[完整模型 Schema](https://apixo.ai/docs/models/schemas/video/seedance-1-5-pro.json) 中的 `mcp.result` 指定結果的解析方式，`mcp.attachments` 列出可繫結檔案的欄位。這些中繼資料供用戶端整合使用，無須當作生成參數提交。附件欄位為 `image_urls`, `video_urls`。請保留使用者指定的檔案順序。模型參數由 API 驗證。

## 相關連結

* [生成 API 總覽](https://apixo.ai/docs/zh-hant/models.md)
* [影片模型](https://apixo.ai/docs/zh-hant/models/video)
* [送出生成任務](https://apixo.ai/docs/zh-hant/api-reference/generate-task.md)
* [查詢任務狀態](https://apixo.ai/docs/zh-hant/api-reference/status-task.md)
* [Webhook](https://apixo.ai/docs/zh-hant/api-reference/webhooks.md)
* [錯誤碼](https://apixo.ai/docs/zh-hant/api-reference/errors.md)
* [參數規範](https://apixo.ai/docs/zh-hant/api-reference/parameters.md)
* [路由策略](https://apixo.ai/docs/zh-hant/concepts/routing-strategies.md)
* [在 APIXO Playground 嘗試 Seedance 1.5 Pro](https://apixo.ai/models/seedance-1-5-pro)
* [API定價](https://apixo.ai/pricing/api)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.