> ## Documentation Index
> Fetch the complete documentation index at: https://mixroute.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Doubao Seedance 2.5

> 透過 MixRoute 呼叫 Doubao Seedance 2.5，包含文字生成影片與圖片生成影片範例。

<link rel="alternate" hrefLang="en" href="https://mixroute.ai/docs/model-api/bytedance/doubao-seedance-2-5" />

<link rel="alternate" hrefLang="zh-Hans" href="https://mixroute.ai/docs/zh-hans/model-api/bytedance/doubao-seedance-2-5" />

<link rel="alternate" hrefLang="zh-Hant" href="https://mixroute.ai/docs/zh-hant/model-api/bytedance/doubao-seedance-2-5" />

<link rel="alternate" hrefLang="ja" href="https://mixroute.ai/docs/ja/model-api/bytedance/doubao-seedance-2-5" />

<link rel="alternate" hrefLang="x-default" href="https://mixroute.ai/docs/model-api/bytedance/doubao-seedance-2-5" />

Doubao Seedance 2.5 是 MixRoute 目前提供的字節跳動影片生成模型。

請在影片生成端點中使用完整模型 ID `doubao-seedance-2-5-260628`。結尾的 `260628` 是請求模型 ID 的一部分，不能省略。

<Tip>
  完整欄位與版本限制參見 [Seedance API](/docs/zh-hant/api-reference/endpoint/seedance)。包括比例與參考內容在內的所有控制項均置於 `metadata`，僅 `model`、`prompt`、`asset` 位於其外。
</Tip>

## 核心能力

* 文字生成影片 - 根據文字提示詞生成影片
* 圖片生成影片 - 使用首幀圖片或參考圖片生成影片
* 非同步任務 - 提交任務後輪詢取得結果
* 輸出控制 - 透過 `metadata` 設定時長、解析度、長寬比與浮水印選項

## 輸出規格

| 屬性 | 值 |
| - | - |
| 解析度 | 480p、720p、1080p |
| 長寬比 | 透過 `metadata.ratio` 設定 |
| 時長 | 透過 `metadata.duration` 設定；可用值取決於生成模式 |
| 結果 | 任務完成後返回 MP4 影片 URL |
| 呼叫方式 | 非同步任務 |

<Note>
  目前 MixRoute 路由為此模型接受 480p、720p 和 1080p。請勿將 Seedance 2.0 專用的 `4k` 設定直接用於 Seedance 2.5。
</Note>

## 呼叫流程

```text theme={null}
1. POST /v1/video/generations -> task_id
2. GET /v1/video/generations/{task_id} -> status
3. 任務成功後 -> 讀取影片 URL
```

## 請求範例

### 文字生成影片

<Tabs>
  <Tab title="cURL">
    ```bash theme={null}
    curl "https://api.mixroute.ai/v1/video/generations" \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-2-5-260628",
        "prompt": "日出時分，一列火車穿過雪谷，電影感跟拍鏡頭",
        "asset": false,
        "metadata": {
          "duration": 4,
          "resolution": "720p",
          "ratio": "16:9",
          "generate_audio": false,
          "watermark": false
        }
      }'
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    response = requests.post(
        "https://api.mixroute.ai/v1/video/generations",
        headers={"Authorization": "Bearer YOUR_API_KEY"},
        json={
            "model": "doubao-seedance-2-5-260628",
            "prompt": "日出時分，一列火車穿過雪谷，電影感跟拍鏡頭",
            "asset": False,
            "metadata": {
                "duration": 4,
                "resolution": "720p",
                "ratio": "16:9",
                "generate_audio": False,
                "watermark": False,
            },
        },
        timeout=60,
    )

    print(response.json())
    ```
  </Tab>
</Tabs>

### 圖片生成影片

```bash theme={null}
curl "https://api.mixroute.ai/v1/video/generations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "doubao-seedance-2-5-260628",
  "prompt": "鏡頭緩慢推進，晨光逐漸掠過畫面",
  "asset": true,
  "metadata": {
    "content": [
      {
        "type": "text",
        "text": "鏡頭緩慢推進，晨光逐漸掠過畫面"
      },
      {
        "type": "image_url",
        "image_url": {
          "url": "https://example.com/first-frame.png"
        },
        "role": "first_frame"
      }
    ],
    "duration": 4,
    "resolution": "720p",
    "ratio": "adaptive",
    "generate_audio": false,
    "watermark": false
  }
}'
```

## 參數

| 參數 | 類型 | 必填 | 說明 |
| - | - | - | - |
| `model` | string | 是 | 固定為 `doubao-seedance-2-5-260628`。 |
| `prompt` | string | 是 | 影片生成指令。 |
| `asset` | boolean | 是 | 純文字輸入設為 `false`；`metadata.content` 包含媒體時設為 `true`。 |
| `metadata` | object | 是 | 包含 Seedance 生成參數與參考內容。 |
| `metadata.content` | array | 否 | 圖片生成影片請求中的文字與圖片輸入項。 |
| `metadata.duration` | integer | 否 | 請求的影片時長，單位為秒。 |
| `metadata.resolution` | string | 否 | `480p`、`720p` 或 `1080p`。 |
| `metadata.ratio` | string | 否 | 輸出長寬比，例如 `16:9`、`9:16` 或 `1:1`。 |
| `metadata.generate_audio` | boolean | 否 | 所選生成模式開放時，請求生成同步音訊。 |
| `metadata.watermark` | boolean | 否 | 開啟後加入 AI 生成浮水印。 |

### 輸入模式

| 模式 | 輸入 |
| - | - |
| 文字生成影片 | `prompt` |
| 圖片生成影片 | `prompt` + `metadata.content[].image_url` |


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