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

# Doubao Seedance 2.5

> MixRouteを通じたDoubao Seedance 2.5の動画生成。テキストからの動画生成と画像からの動画生成の例を紹介します。

Doubao Seedance 2.5はByteDanceの動画モデルです。完全なルートID`doubao-seedance-2-5-260628`を使用してください。バージョンの接尾辞もIDの一部です。

全フィールドの定義：[Doubao API](/ja/api-reference/endpoint/doubao)。

## モデルのパラメータと制限

| 設定 | 値 |
| - | - |
| `model` | `doubao-seedance-2-5-260628` |
| 入力モード | テキスト、最初のフレームの画像、最初と最後のフレームの画像、またはマルチモーダル参照。 |
| `metadata.content` | 必須の入力配列。テキストのみを入力として生成する場合はテキスト項目を含め、promptと整合する内容にしてください。 |
| `metadata.duration` | 4～30秒、または-1。-1は長さを自動的に選択します。 |
| `metadata.resolution` | `480p`、`720p`、`1080p`。デフォルトは720pです。 |
| `metadata.ratio` | `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`, `adaptive` |
| 音声 | `metadata.generate_audio`のデフォルトはtrue。falseにすると無音の動画を生成します。 |
| 形式 | `metadata.output_format`: `mp4`（デフォルト）、`mov` |
| フレームレート | 24 fps |

* `model`、`prompt`、`asset`はルートに配置し、プロバイダーのフィールドはすべて`metadata`内に配置します。メディア入力の例では`asset=true`を設定してください。
* フレームのロールと`reference_*`のロールは別の入力モードです。組み合わせないでください。
* ratioのデフォルトはadaptiveです。最初のフレーム、最初/最後のフレーム、編集、延長の各モードではadaptiveが必要です。編集にはduration=-1と4〜30秒のソース動画が必要です。
* マルチモーダル参照では、画像を最大30枚、動画を最大10本、音声クリップを最大10件使用できます。音声のみの参照にも対応しています。

## 例

呼び出し前に`MIXROUTE_API_KEY`を設定し、画像・動画・音声のプレースホルダーを、アクセス可能なソースメディアに置き換えてください。

### テキストから動画を生成

```bash theme={null}
curl --request POST "https://api.mixroute.ai/v1/video/generations" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "doubao-seedance-2-5-260628",
  "prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
  "asset": false,
  "metadata": {
    "content": [
      {
        "type": "text",
        "text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
      }
    ],
    "duration": 4,
    "resolution": "480p",
    "ratio": "1:1",
    "generate_audio": false,
    "watermark": false
  }
}'
```

### Python

```python theme={null}
import json
import os
import requests

payload = json.loads(r'''
{
  "model": "doubao-seedance-2-5-260628",
  "prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
  "asset": false,
  "metadata": {
    "content": [
      {
        "type": "text",
        "text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
      }
    ],
    "duration": 4,
    "resolution": "480p",
    "ratio": "1:1",
    "generate_audio": false,
    "watermark": false
  }
}
''')
response = requests.post(
    "https://api.mixroute.ai/v1/video/generations",
    headers={"Authorization": "Bearer " + os.environ["MIXROUTE_API_KEY"]},
    json=payload,
    timeout=60,
)
response.raise_for_status()
result = response.json()
if result.get("code") not in (None, 0, 200, "0", "200", "success"):
    raise RuntimeError(result.get("message") or result)
print(result)
```

### 最初のフレーム画像

```bash theme={null}
curl --request POST "https://api.mixroute.ai/v1/video/generations" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "model": "doubao-seedance-2-5-260628",
  "prompt": "A ceramic mug slowly rotates on a white tabletop in soft daylight.",
  "asset": true,
  "metadata": {
    "content": [
      {
        "type": "text",
        "text": "A ceramic mug slowly rotates on a white tabletop in soft daylight."
      },
      {
        "type": "image_url",
        "image_url": {
          "url": "https://example.com/first-frame.png"
        },
        "role": "first_frame"
      }
    ],
    "duration": 4,
    "resolution": "480p",
    "ratio": "adaptive",
    "generate_audio": false,
    "watermark": false
  }
}'
```

## タスクの結果

送信したMixRouteのタスクIDを保持し、[動画タスクの照会](/ja/api-reference/endpoint/query-video-task)を使用してください。正常終了のステータスになってから動画URLを取得してください。送信しただけでは生成が完了したことにはなりません。


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