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

# Seedance 2.5 Beta

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

Seedance 2.5 の固定価格ライン。テキストまたは参照素材から音声付きの動画を生成し、解像度ごとに動画 1 本あたり一定の料金で、長さは料金に影響しません。* 非同期：作成リクエストはタスク ID を返し、タスクが成功すると動画を取得できます。
* 入力は 2 通り：テキストのみ、または参照素材（画像・動画・音声）。先頭・末尾フレームには対応していません。
* 解像度ごとに動画 1 本あたりの固定価格で、長さは関係ありません。失敗したタスクは課金されません。
* 動画には常に生成された音声が付きます。無音のオプションはありません。> **情報:** Seedance 2.5 Beta は Seedance 2.5 の固定価格ラインです。解像度ごとに動画 1 本あたり一定の料金で、長さにかかわらず同じです。テキストと参照素材のみに対応し、常に音声付きで生成します。先頭・末尾フレーム、無音動画、秒単位の課金が必要な場合は公式版の `seedance-2.5` を使ってください。POST/v1/videos/tasks試してみるこのモデルをテスト画面で開きます。BeatAPI の API キーを入力するとタスクを作成できます。実際に呼び出され、ご自身の残高から課金されます。## エンドポイントと認証`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` は任意です。論理的に 1 件のリクエストごとに一意の値（255 文字以内）を送り、まったく同じボディを再試行するときだけ再利用してください。24 時間以内に同じキーと同じボディで再試行すると、最初のレスポンスが `Idempotent-Replayed: true` 付きで再度返されます。同じキーで異なるボディを送ると `409 idempotency_conflict` が返ります。2xx 以外のレスポンスは保存されないため、400 や 402 の後の再試行は改めて実行されます。## リクエストの流れ1) **タスクを作成する** 下記のパラメーターをエンドポイントに `POST` します。`201` が返れば、タスクが受け付けられ、料金が残高から仮確保されたことを意味します。処理はバックグラウンドで実行されます。`data.id` を保存してください。
2) **完了を待つ** `GET /v1/tasks/{task_id}` を呼び出し、`status` が `succeeded` または `failed` になるまで、呼び出しの間隔を `data.poll_after_seconds`（画像は 5 秒、動画は 8 秒）だけ空けてください。あるいは `task.succeeded` と `task.failed` の[Webhook](/webhooks)を登録することもできます。処理タイムアウトで停止したタスクはイベントを送信しないため、フォールバックとしてポーリングも続けてください。
3) **結果を保存する** `succeeded` の場合は、すべての `data.output.media[].url` をダウンロードし、必要なファイルを保存してください。結果 URL がいつまで利用できるかは保証されません。`failed` の場合は、`data.error_code` と `data.error_message` を確認してください。仮確保された金額は残高に戻されます。`data.retryable` は、同じリクエストをもう一度送れば成功する可能性があるかどうかを示します。## 入力モード| モード      | 必須の入力                                                                               | 備考                                   |
| -------- | ----------------------------------------------------------------------------------- | ------------------------------------ |
| テキストから動画 | `model`、`prompt`                                                                    | 素材の配列は送りません。                         |
| 参照素材     | `model`、`prompt`、および `reference_images`、`reference_videos`、`reference_audios` のいずれか | 参照音声には少なくとも 1 枚の参照画像か 1 本の参照動画が必要です。 |## リクエストパラメーター### `model``string` · 必須実行するモデルです。**値**：`seedance-2.5-beta`**値が正しくない場合**- 未指定：`"model" is required`### `prompt``string` · 必須動画の内容：被写体、動き、カメラワーク、スタイル、音。参照素材を使う場合は、それぞれの用途を書いてください。**長さ**：1–5000 文字- 素材は位置で指定します：`@image1` は `reference_images` の 1 番目、`@video1` は `reference_videos` の 1 番目、`@audio1` は `reference_audios` の 1 番目です。**値が正しくない場合**- 未指定：`"prompt" is required`### `reference_images``string[]` · 任意動画の内容、キャラクター、製品、スタイルを導く画像です。**要素数**：1–30  \
各要素は公開されている `https://` の URL です。ローカルファイルは先に [アップロード](/quick-guide#upload-an-input-file)（`POST /v1/files`）し、返された `data.url` を渡してください。- 画像はリストの順に使われます。プロンプトでは位置で指定してください。### `reference_audios``string[]` · 任意従う音楽、声、音です。**要素数**：1–10  \
各要素は公開されている `https://` の URL です。ローカルファイルは先に [アップロード](/quick-guide#upload-an-input-file)（`POST /v1/files`）し、返された `data.url` を渡してください。- 公開 HTTPS リンクの MP3 または WAV ファイルを送ってください。
- 少なくとも 1 枚の参照画像か 1 本の参照動画と一緒に送ってください。### `duration``integer` · 任意 · デフォルト: `5`動画の長さ（秒）、整数です。**デフォルト**：`5`  \
**範囲**：4–30- 省略すると `5` が送られます。
- 長さによって料金は変わりません。### `aspect_ratio``string` · 任意 · デフォルト: `16:9`動画の形（幅:高さ）です。**指定できる値**：`adaptive`, `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`  \
**デフォルト**：`16:9`- 省略時は `16:9` です。### `resolution``string` · 任意 · デフォルト: `720p`出力解像度です。料金は解像度で決まります。**指定できる値**：`480p`, `720p`, `1080p`, `4K`  \
**デフォルト**：`720p`### `generate_audio``boolean` · 任意 · デフォルト: `true`動画には常に生成された音声が付きます。省略するか `true` を送ってください。**デフォルト**：`true`**値が正しくない場合**- `false` を送った場合：`seedance-2.5-beta always generates audio; use seedance-2.5 for a silent video`### `reference_videos``string[]` · 任意動き、カメラワーク、内容を参照する動画です。**要素数**：1–10  \
各要素は公開されている `https://` の URL です。ローカルファイルは先に [アップロード](/quick-guide#upload-an-input-file)（`POST /v1/files`）し、返された `data.url` を渡してください。- 公開 HTTPS リンクの MP4 または MOV ファイルを送ってください。### `callback_url``string` · 任意タスクが成功または失敗したときに通知するアドレスです。公開 HTTPS URL で、スキーム・ホスト・ポートが有効な [Webhook エンドポイント](/webhooks)のいずれかと同じである必要があり、そのエンドポイントの `secret` で署名されます。**長さ**：≤ 2048 文字- 先に `POST /v1/webhooks` でエンドポイントを登録してください。BeatAPI は `task.succeeded` または `task.failed` を、アカウントの Webhook と同じ本文・ヘッダー・再試行規則で送ります。そのイベントを購読しているアカウントのエンドポイントにも届き、そのエンドポイントと同じアドレスなら通知は 1 回だけです。
- 署名エンドポイントが削除・停止された、または別のホストに変更された場合、このコールバックは無効になります。**値が正しくない場合**- 値が文字列ではない：`"callback_url" must be a string.`
- アドレスが 2048 文字を超える：`"callback_url" must be at most 2048 characters.`
- URL ではない、またはホストや `http`・`https` のスキームがない：`"callback_url" must be a valid https URL.`
- `http` を使っている、またはプライベートなど公開されていないアドレスを指している：`"callback_url" must be a public HTTPS URL.`
- スキーム・ホスト・ポートが同じ有効な Webhook エンドポイントがない：`"callback_url" must be on the host of one of your active webhook endpoints, whose secret signs it; register one with POST /v1/webhooks.`ゲートウェイはタスク作成前に、次の組み合わせも確認します。- `images` と参照メディアのフィールドは同時に使用できません。
- seedance-2.5 はこのモデルの公式版で、先頭・末尾フレーム、無音動画、秒単位の課金に対応します。こちらは長さにかかわらず、解像度ごとに動画 1 本あたりの固定価格です。
- テキストまたは参照素材のみです。先頭・末尾フレームはありません。
- 動画には常に音声が付きます。`generate_audio` に false は指定できません。
- `reference_audios` を送るときは、参照画像か参照動画が 1 件以上必要です。## 入力メディアの上限ゲートウェイはタスク作成前にすべての入力を読み取り、次の上限を超えるものは、その入力を示す `400 bad_request` で拒否します。課金はされません。| メディア | タスク作成前に確認される上限                                                                                                                       |
| ---- | ------------------------------------------------------------------------------------------------------------------------------------ |
| 画像   | 幅・高さとも 300～6000 px；アスペクト比（幅 ÷ 高さ）0.4～2.5；1 件あたり 30 MB 以下                                                                             |
| 動画   | 1 本あたり 2～30 秒；合計 30 秒以内；幅・高さとも 300～6000 px；アスペクト比（幅 ÷ 高さ）0.4～2.5；1 フレームあたり 407,696～8,295,044 ピクセル（幅 × 高さ）；24～60 FPS；1 件あたり 200 MB 以下 |
| 音声   | 1 本あたり 2～30 秒；合計 30 秒以内；1 件あたり 15 MB 以下                                                                                              |- ローカルのファイルは `POST /v1/files` でアップロードし、返された `data.url` を渡してください。## プロンプトの書き方ショットを説明してください：被写体、動き、カメラワーク、スタイル、音。参照素材を使う場合は、それぞれの用途を書き、位置で指定します：`@image1` は 1 枚目の参照画像、`@video1` は 1 本目の参照動画、`@audio1` は 1 本目の参照音声です。## リクエスト例```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": "seedance-2.5-beta",
  "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
  "duration": 5,
  "resolution": "720p",
  "aspect_ratio": "16:9"
}'
``````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": "seedance-2.5-beta",
      "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
      "duration": 5,
      "resolution": "720p",
      "aspect_ratio": "16:9"
    },
    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": "seedance-2.5-beta",
    "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }),
});
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 秒の横長動画です。```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": "seedance-2.5-beta",
  "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
  "duration": 5,
  "resolution": "720p",
  "aspect_ratio": "16:9"
}'
```### 参照画像と参照音声キャラクター画像と音楽に合わせたパフォーマンスです。```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": "seedance-2.5-beta",
  "prompt": "The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera",
  "reference_images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "reference_audios": [
    "https://cdn.beatapi.io/samples/neon-singer-preview.mp3"
  ],
  "duration": 8,
  "resolution": "720p",
  "aspect_ratio": "9:16"
}'
```## レスポンス### タスクの作成（201）タスクオブジェクトです。タスクが成功するまで `output` は `null` です。「実行中」と記載されたフィールドは、タスクの完了後に表示されなくなります。```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "seedance-2.5-beta",
    "capability_version": 1,
    "media_type": "video",
    "model": "seedance-2.5-beta",
    "status": "queued",
    "stage": "queued",
    "created_at": 1791993600,
    "updated_at": 1791993600,
    "completed_at": null,
    "poll_after_seconds": 8,
    "output": null,
    "usage": {
      "credits_reserved": 2.93,
      "credits_settled": 0,
      "credits_refunded": 0,
      "credits_charged": 2.93,
      "billable_duration_seconds": 5
    },
    "request_id": "202611260732156684925978268d9d6yOLdMCKV",
    "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` のいずれかです。最終状態は後ろの 2 つだけです。                          |
| `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`          | タスク作成時に残高から仮確保された金額（USD）です。                                                                   |
| `data.usage.credits_charged`           | `number`          | このタスクの料金（USD）です。失敗したタスクでは `0` です。                                                             |
| `data.usage.credits_settled`           | `number`          | 最終的に差し引かれた金額（USD）です。タスクが成功した時点で設定され、それ以外では `0` です。                                            |
| `data.usage.credits_refunded`          | `number`          | 残高に戻された金額（USD）です。失敗したタスクでは、返金が記録された時点で仮確保した金額と一致します。                                          |
| `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": "seedance-2.5-beta",
    "capability_version": 1,
    "media_type": "video",
    "model": "seedance-2.5-beta",
    "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"
        }
      ],
      "url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4",
      "r2_url": "https://media.beatapi.io/outputs/task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ/0.mp4"
    },
    "usage": {
      "credits_reserved": 2.93,
      "credits_settled": 2.93,
      "credits_refunded": 0,
      "credits_charged": 2.93,
      "billable_duration_seconds": 5
    },
    "request_id": "202611260732156684925978268d9d6yOLdMCKV",
    "error_code": null,
    "error_message": null
  }
}
```#### 出力フィールド| フィールド                      | 型          | 説明                                                                    |
| -------------------------- | ---------- | --------------------------------------------------------------------- |
| `output.media`             | `object[]` | 生成されたファイルです。このモデルでは動画 1 本です。                                          |
| `output.media[].type`      | `string`   | 常に `video` です。                                                        |
| `output.media[].url`       | `string`   | 保存された動画の HTTPS リンクです。ダウンロードして保管してください。保持期間は保証されません。                   |
| `output.media[].mime_type` | `string`   | `video/mp4` です。                                                       |
| `output.url`               | `string`   | メインの成果物である動画のリンクです。結果は `output.url` を読んでください。`media[]` にはすべての出力が並びます。 |
| `output.r2_url`            | `string`   | `output.url` の旧名で、値は同じです。`output.url` を読んでください。                       |### 失敗したタスク失敗したタスクも、`GET /v1/tasks/{task_id}` では HTTP 200 になります。失敗はボディに示されます。仮確保された金額は全額戻されるため、課金されません。```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "seedance-2.5-beta",
    "capability_version": 1,
    "media_type": "video",
    "model": "seedance-2.5-beta",
    "status": "failed",
    "stage": "failed",
    "created_at": 1791993600,
    "updated_at": 1791993690,
    "completed_at": 1791993690,
    "output": null,
    "usage": {
      "credits_reserved": 2.93,
      "credits_settled": 0,
      "credits_refunded": 2.93,
      "credits_charged": 0,
      "billable_duration_seconds": 5
    },
    "retryable": true,
    "request_id": "202611260732156684925978268d9d6yOLdMCKV",
    "error_code": "processing_failed",
    "error_message": "The task failed during processing on our side. Retry; a failed task is refunded.",
    "error": {
      "code": "processing_failed",
      "message": "The task failed during processing on our side. Retry; a failed task is refunded.",
      "retryable": true
    }
  }
}
```| フィールド                | 型         | 説明                                                                                                                                                                                                         |
| -------------------- | --------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `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.error`         | `object`  | 失敗したタスクにのみ含まれます。`code`、`message`、`retryable` を 1 つのオブジェクトにまとめたもので、値は `data.error_code`、`data.error_message`、`data.retryable` と同じです。                                                                        |
| `data.usage`         | `object`  | 返金が記録された時点（通常はタスクが失敗した瞬間）で、`credits_charged` と `credits_settled` は `0` になり、`credits_refunded` は `credits_reserved` と一致します。                                                                                 |## 完全なコード例タスクを作成し、サーバーが示すポーリング間隔で完了を待ち、結果の URL を出力します。環境変数に `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": "seedance-2.5-beta",
  "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
  "duration": 5,
  "resolution": "720p",
  "aspect_ratio": "16:9"
})
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"])
```## 課金- `resolution` ごとに動画 1 本あたりの固定価格で、指定した `duration` に関係しません。入力方法、`aspect_ratio`、参照素材の数でも料金は変わりません。
- 下の表は解像度ごとの動画 1 本の料金です。
- タスク作成時にこの料金が予約されます。`data.usage.billable_duration_seconds` は指定した長さを示しますが、料金には影響しません。
- 失敗したタスク（送信後にモデレーションで拒否されたものを含む）は全額返金されます。現在の定価です。[料金](https://beatapi.io/pricing)ページと同じ金額です。割引を個別に契約しているアカウントでは、より低い金額になります。実際に課金された金額は、タスクの `data.usage` で確認できます。| オプション                 | 定価（USD） |
| --------------------- | ------- |
| 動画 1 本 · 480p · 長さ不問  | \$1.45  |
| 動画 1 本 · 720p · 長さ不問  | \$2.93  |
| 動画 1 本 · 1080p · 長さ不問 | \$7.25  |
| 動画 1 本 · 4K · 長さ不問    | \$12.4  |## よくあるエラー| エラーまたは症状                                                                            | 原因                                                   | 対処                                                      |
| ----------------------------------------------------------------------------------- | ---------------------------------------------------- | ------------------------------------------------------- |
| 400 `seedance-2.5-beta always generates audio; use seedance-2.5 for a silent video` | `generate_audio` に `false` を送った。                     | `generate_audio` を省略するか、無音動画には `seedance-2.5` を使ってください。 |
| 400 `"images"` は受け付けられません                                                           | Beta には先頭・末尾フレームがありません。                              | 画像は `reference_images` に入れるか、`seedance-2.5` を使ってください。   |
| Task `failed` with `content_policy_violation`                                       | プロンプト、素材、結果がモデレーションで拒否されました（実在の人物、著名人、著作権のあるキャラクター）。 | 入力を変更してください。そのまま再試行しても失敗します。料金はかかりません。                  |## HTTP エラー早見表タスクが作られる前のエラーは、2xx 以外のレスポンスで返されます。課金はされません。`error.code` または `error.retryable` で処理を分岐してください。`message` には問題の内容が示されます。全一覧と再試行のルールは[エラー](/errors)にあります。```json
{
  "error": {
    "code": "bad_request",
    "message": "\"prompt\" is required",
    "retryable": false,
    "request_id": "202611260732156684925978268d9d6yOLdMCKV"
  }
}
```| HTTP ステータス | `error.code`                                                                                  | 対処方法                                                                             |
| ---------- | --------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| 400        | `bad_request`, `content_policy_violation`                                                     | リクエストを修正してください。メッセージにフィールド名が示されます。そのまま再試行しないでください。                               |
| 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/seedance-2-5-beta

## Authentication

- `Authorization` header (bearer token, required) — API キーを `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` は任意です。論理的に 1 件のリクエストごとに一意の値（255 文字以内）を送り、まったく同じボディを再試行するときだけ再利用してください。24 時間以内に同じキーと同じボディで再試行すると、最初のレスポンスが `Idempotent-Replayed: true` 付きで再度返されます。同じキーで異なるボディを送ると `409 idempotency_conflict` が返ります。2xx 以外のレスポンスは保存されないため、400 や 402 の後の再試行は改めて実行されます。

### Body (application/json)

This endpoint expects a Seedance25BetaVideoRequest.

- `model` (enum, required) — 実行するモデルです。 **値**：`seedance-2.5-beta` **値が正しくない場合** - 未指定：`"model" is required`
  - Allowed values: `seedance-2.5-beta`
- `prompt` (string, required) — 動画の内容：被写体、動き、カメラワーク、スタイル、音。参照素材を使う場合は、それぞれの用途を書いてください。 **長さ**：1–5000 文字 - 素材は位置で指定します：`@image1` は `reference_images` の 1 番目、`@video1` は `reference_videos` の 1 番目、`@audio1` は `reference_audios` の 1 番目です。 **値が正しくない場合** - 未指定：`"prompt" is required`
- `aspect_ratio` (enum, optional, default: 16:9) — 動画の形（幅:高さ）です。 **指定できる値**：`adaptive`, `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16` **デフォルト**：`16:9` - 省略時は `16:9` です。
  - Allowed values: `adaptive`, `21:9`, `16:9`, `4:3`, `1:1`, `3:4`, `9:16`
- `duration` (integer, optional, default: 5) — 動画の長さ（秒）、整数です。 **デフォルト**：`5` **範囲**：4–30 - 省略すると `5` が送られます。 - 長さによって料金は変わりません。
- `generate_audio` (boolean, optional, default: true) — 動画には常に生成された音声が付きます。省略するか `true` を送ってください。 **デフォルト**：`true` **値が正しくない場合** - `false` を送った場合：`seedance-2.5-beta always generates audio; use seedance-2.5 for a silent video`
- `reference_audios` (list of string, optional) — 従う音楽、声、音です。 **要素数**：1–10 各要素は公開されている `https://` の URL です。ローカルファイルは先に [アップロード](/quick-guide#upload-an-input-file)（`POST /v1/files`）し、返された `data.url` を渡してください。 - 公開 HTTPS リンクの MP3 または WAV ファイルを送ってください。 - 少なくとも 1 枚の参照画像か 1 本の参照動画と一緒に送ってください。
- `reference_images` (list of string, optional) — 動画の内容、キャラクター、製品、スタイルを導く画像です。 **要素数**：1–30 各要素は公開されている `https://` の URL です。ローカルファイルは先に [アップロード](/quick-guide#upload-an-input-file)（`POST /v1/files`）し、返された `data.url` を渡してください。 - 画像はリストの順に使われます。プロンプトでは位置で指定してください。
- `reference_videos` (list of string, optional) — 動き、カメラワーク、内容を参照する動画です。 **要素数**：1–10 各要素は公開されている `https://` の URL です。ローカルファイルは先に [アップロード](/quick-guide#upload-an-input-file)（`POST /v1/files`）し、返された `data.url` を渡してください。 - 公開 HTTPS リンクの MP4 または MOV ファイルを送ってください。
- `resolution` (enum, optional, default: 720p) — 出力解像度です。料金は解像度で決まります。 **指定できる値**：`480p`, `720p`, `1080p`, `4K` **デフォルト**：`720p`
  - Allowed values: `480p`, `720p`, `1080p`, `4K`
- `callback_url` (string, optional) — タスクが成功または失敗したときに通知するアドレスです。公開 HTTPS URL で、スキーム・ホスト・ポートが有効な [Webhook エンドポイント](/webhooks)のいずれかと同じである必要があり、そのエンドポイントの `secret` で署名されます。 **長さ**：≤ 2048 文字 - 先に `POST /v1/webhooks` でエンドポイントを登録してください。BeatAPI は `task.succeeded` または `task.failed` を、アカウントの Webhook と同じ本文・ヘッダー・再試行規則で送ります。そのイベントを購読しているアカウントのエンドポイントにも届き、そのエンドポイントと同じアドレスなら通知は 1 回だけです。 - 署名エンドポイントが削除・停止された、または別のホストに変更された場合、このコールバックは無効になります。 **値が正しくない場合** - 値が文字列ではない：`"callback_url" must be a string.` - アドレスが 2048 文字を超える：`"callback_url" must be at most 2048 characters.` - URL ではない、またはホストや `http`・`https` のスキームがない：`"callback_url" must be a valid https URL.` - `http` を使っている、またはプライベートなど公開されていないアドレスを指している：`"callback_url" must be a public HTTPS URL.` - スキーム・ホスト・ポートが同じ有効な Webhook エンドポイントがない：`"callback_url" must be on the host of one of your active webhook endpoints, whose secret signs it; register one with POST /v1/webhooks.`

## Response

### 201

タスクオブジェクトです。タスクが成功するまで `output` は `null` です。「実行中」と記載されたフィールドは、タスクの完了後に表示されなくなります。

- `data` (QueuedTask, required) — Accepted or current BeatAPI task state.

## Errors

### 400 Bad Request Error

`bad_request`, `content_policy_violation` リクエストを修正してください。メッセージにフィールド名が示されます。そのまま再試行しないでください。

- `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`

## Types

### QueuedTask

- `id` (string, required) — Stable BeatAPI task ID used for polling and support.
- `object` (enum, required) — Object discriminator; always `task`.
  - Allowed values: `task`
- `task_kind` (enum, required) — Public task family that determines which capability fields are present. `data` is a data capability run as a task (`data:web.research`), polled through `POST /v1/capabilities/run`.
  - Allowed values: `workflow`, `effect`, `image`, `video`, `audio`, `data`
- `capability_id` (string, required) — Stable BeatAPI workflow, Effect, generation model, or data capability ID (such as `web.research`) selected when the task was accepted.
- `capability_version` (integer, required) — Always `1`.
- `status` (enum, required) — Current task lifecycle status. Stop polling at `succeeded` or `failed`; Music Video can also require manual action.
  - Allowed values: `queued`, `processing`, `storyboard_ready`, `requires_action`, `editing`, `composing`, `succeeded`, `failed`
- `stage` (enum, required) — Always repeats `status`. Kept for compatibility; read `status`.
  - Allowed values: `queued`, `processing`, `storyboard_ready`, `requires_action`, `editing`, `composing`, `succeeded`, `failed`
- `created_at` (integer, required) — Unix timestamp when BeatAPI accepted the task.
- `updated_at` (integer, required) — Unix timestamp of the latest task update.
- `completed_at` (integer, required, nullable) — Terminal Unix timestamp, or null while work is in progress.
- `output` (QueuedTaskOutput, required, nullable) — Output is null until the task succeeds.
- `request_id` (string, required) — Correlation ID to retain for logs and BeatAPI support.
- `error_code` (string, required, nullable) — Machine-readable terminal failure code, or null when no task failure is recorded. `task_cancelled` marks a task you cancelled while it waited in its model's queue.
- `error_message` (string, required, nullable) — Human-readable terminal failure detail, or null when no task failure is recorded.
- `workflow` (enum, optional) — Present for workflow tasks; identifies the selected BeatAPI workflow.
  - Allowed values: `music-video`, `ecommerce-video`, `video-analysis`
- `effect_id` (string, optional) — Present for Effect tasks; stable selected Effect ID.
- `effect_version` (integer, optional) — Present for Effect tasks; immutable Effect version used for processing.
- `media_type` (enum, optional) — Present when task_kind is image or video.
  - Allowed values: `image`, `video`, `audio`
- `model` (string, optional) — Stable BeatAPI model alias. It is independent from internal execution routing.
- `storyboard` (Storyboard, optional) — Music Video storyboard metadata when available.
- `poll_after_seconds` (integer, optional) — Present while the task is running: how long to wait before the next status call (5 for images, 8 for video and Effects, 10 for workflows and data tasks). Follow it instead of a fixed interval. Absent on a terminal task.
- `typical_seconds` (QueuedTaskTypicalSeconds, optional) — Present while the task is running, when enough recent finishes exist: how long this task's model recently took from accepted to succeeded, measured on this gateway. Past `p90` with no change the task is running long; there is no ETA beyond that.
- `queue` (QueuedTaskQueue, optional) — Present only while the task waits for its model's capacity (read by id, not in the task list). A task still waiting at `deadline` fails with `processing_unavailable` and is refunded. Cancel it with `POST /v1/tasks/{task_id}/cancel`.
- `usage` (TaskUsage, optional) — USD reservation, settlement, refund, and optional billable duration for this task.
- `error` (QueuedTaskError, optional) — Present on a failed task: the terminal failure as one object. Its values are the same as the flat `error_code`, `error_message` and `retryable`, which stay.
- `retryable` (boolean, optional) — Present on a failed task: whether resubmitting could succeed. True when the task failed on our side or timed out (a failed task is not charged); false when it was refused for content or bad input. Same code-to-retryable rule as the error envelope.

### QueuedTaskOutput

Output is null until the task succeeds.

- QueuedTaskOutput0
- QueuedTaskOutput1
- QueuedTaskOutput2

### Storyboard

- `shots` (list of StoryboardShot, required) — Ordered Music Video storyboard shots. The array may be empty before storyboard generation completes.

### QueuedTaskTypicalSeconds

Present while the task is running, when enough recent finishes exist: how long this task's model recently took from accepted to succeeded, measured on this gateway. Past `p90` with no change the task is running long; there is no ETA beyond that.

- `p50` (integer, required) — Median seconds.
- `p90` (integer, required) — Ninetieth-percentile seconds.
- `samples` (integer, required) — Finished tasks the figures rest on.
- `window` (string, required) — The window measured, such as `7d`.

### QueuedTaskQueue

Present only while the task waits for its model's capacity (read by id, not in the task list). A task still waiting at `deadline` fails with `processing_unavailable` and is refunded. Cancel it with `POST /v1/tasks/{task_id}/cancel`.

- `position` (integer, required) — Place in the queue; 1 is next.
- `ahead` (integer, required) — Tasks of the same model ahead of this one.
- `queued_at` (integer, required) — Unix seconds when the task was queued.
- `deadline` (integer, required) — Unix seconds after which the task stops waiting.

### TaskUsage

- `credits_reserved` (double, required) — USD amount reserved for this task. The compatibility field name is retained; 1 Credit equals $1 USD.
- `credits_charged` (double, required) — USD amount charged. `0` on a failed task, because the reserved amount was returned.
- `credits_settled` (double, required) — USD amount settled after successful work.
- `credits_refunded` (double, required) — USD amount returned after a failed task. On a failed task `credits_reserved` is the amount held at create, `credits_charged` and `credits_settled` are `0`, and `credits_refunded` is the amount returned.
- `billable_duration_seconds` (integer, optional) — Server-detected or request-declared billable duration used for USD calculation.

### QueuedTaskError

Present on a failed task: the terminal failure as one object. Its values are the same as the flat `error_code`, `error_message` and `retryable`, which stay.

- `code` (string, required) — Machine-readable failure code, the same value as `error_code`.
- `message` (string, required) — English sentence that states the cause, the same value as `error_message`.
- `retryable` (boolean, optional) — Whether resubmitting could succeed, the same value as `retryable`. Absent when `retryable` is absent.

### QueuedTaskOutput0

- `media` (list of QueuedTaskOutputOneOf0MediaItems, required) — BeatAPI-hosted result assets.
- `url` (string, required) — The primary asset's URL, the one to read when you want a single file (the first video, else the first image). The same value as `r2_url`.
- `r2_url` (string, required, deprecated) — Deprecated — read `url`. The same value as `url`, kept only for clients that already read it.
- `tracks` (list of QueuedTaskOutputOneOf0TracksItems, optional) — Audio tasks only. One entry for each song or stem the call made, beside the files in `media`.
- `data` (any, optional) — Audio tasks only. What an action returns that is not a file, such as lyrics, aligned lyrics, a boosted style, a persona id or MIDI notes.

### QueuedTaskOutput1

- `text` (string, required) — Completed video analysis text.
- `usage` (QueuedTaskOutputOneOf1Usage, required) — Measured token usage used for final USD settlement.
- `finish_reason` (string, required, nullable) — Why the model stopped generating.

### QueuedTaskOutput2

A data task's result: the capability's own result object, such as `web.research` with `research_notes` and `sources` (in a view: `items`).

- `object` (string, required) — The result type, such as `web.research`.
- `request_id` (string, optional) — The ID of the task that produced the result.
- `query` (string, optional) — The question that was researched.
- `status` (enum, optional) — `partial` when part of the research could not be finished; `partial_reasons` says why.
  - Allowed values: `complete`, `partial`
- `research_notes` (string, optional) — The research notes.
- `sources` (list of map from string to any, optional) — The sources behind the notes.
- `partial_reasons` (list of string, optional) — Present when `status` is `partial`.
- `x_search` (map from string to any, optional) — How much X was searched, when the run searched X at all.

### StoryboardShot

- `id` (string, required) — BeatAPI shot id. Use this id for media retrieval, edit, and compose operations.
- `index` (integer, required) — Zero-based shot order in the storyboard.
- `status` (enum, required) — Current lifecycle state for this storyboard shot.
  - Allowed values: `queued`, `processing`, `storyboard_ready`, `requires_action`, `editing`, `composing`, `succeeded`, `failed`
- `created_at` (integer, required) — Unix timestamp when the shot record was created.
- `updated_at` (integer, required) — Unix timestamp when the shot record last changed.
- `duration_seconds` (integer, optional) — Planned or generated shot duration in seconds.
- `prompt` (string, optional) — Creative instruction used to generate this shot.
- `lyric_text` (string, optional) — Lyric segment aligned with this shot when available.
- `media` (StoryboardShotMedia, optional) — Present only after the shot media has been materialized or after a shot edit finishes.

### QueuedTaskOutputOneOf0MediaItems

- `type` (enum, required) — Result asset type.
  - Allowed values: `image`, `video`, `audio`
- `url` (string, required) — BeatAPI-hosted HTTPS result URL.
- `mime_type` (string, required) — Result asset MIME type.

### QueuedTaskOutputOneOf0TracksItems

- `id` (string, required) — The id a follow-up sends as `audio_id`.
- `title` (string, optional) — Song title.
- `name` (string, optional) — Stem name on a split result.
- `tags` (string, optional) — Style tags.
- `lyrics` (string, optional) — Lyrics of the song.
- `duration` (double, optional) — Length in seconds.
- `audio_url` (string, optional) — The song or stem file.
- `image_url` (string, optional) — Cover art.

### QueuedTaskOutputOneOf1Usage

Measured token usage used for final USD settlement.

- `input_tokens` (integer, required) — Tokens consumed by the prompt and video input.
- `output_tokens` (integer, required) — Tokens consumed by visible output and model reasoning.
- `total_tokens` (integer, required) — Total measured input and output tokens.

### StoryboardShotMedia

Present only after the shot media has been materialized or after a shot edit finishes.

- `type` (string, optional) — Hosted media type for the materialized shot.
- `url` (string, optional) — BeatAPI-hosted HTTPS URL for the materialized shot.
- `mime_type` (string, optional) — MIME type of the hosted shot media.

## Examples

### テキストから動画

**Request**

```json
{
  "model": "seedance-2.5-beta",
  "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
  "aspect_ratio": "16:9",
  "duration": 5,
  "resolution": "720p"
}
```

**Response**

```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "seedance-2.5-beta",
    "capability_version": 1,
    "status": "queued",
    "stage": "queued",
    "created_at": 1791993600,
    "updated_at": 1791993600,
    "completed_at": null,
    "output": null,
    "request_id": "202611260732156684925978268d9d6yOLdMCKV",
    "error_code": null,
    "error_message": null,
    "media_type": "video",
    "model": "seedance-2.5-beta",
    "poll_after_seconds": 8,
    "usage": {
      "credits_reserved": 2.93,
      "credits_charged": 2.93,
      "credits_settled": 0,
      "credits_refunded": 0,
      "billable_duration_seconds": 5
    }
  }
}
```

**SDK Code**

```python テキストから動画
import requests

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

payload = {
    "model": "seedance-2.5-beta",
    "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
    "aspect_ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
}
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":"seedance-2.5-beta","prompt":"A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound","aspect_ratio":"16:9","duration":5,"resolution":"720p"}'
};

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\": \"seedance-2.5-beta\",\n  \"prompt\": \"A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound\",\n  \"aspect_ratio\": \"16:9\",\n  \"duration\": 5,\n  \"resolution\": \"720p\"\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\": \"seedance-2.5-beta\",\n  \"prompt\": \"A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound\",\n  \"aspect_ratio\": \"16:9\",\n  \"duration\": 5,\n  \"resolution\": \"720p\"\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\": \"seedance-2.5-beta\",\n  \"prompt\": \"A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound\",\n  \"aspect_ratio\": \"16:9\",\n  \"duration\": 5,\n  \"resolution\": \"720p\"\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": "seedance-2.5-beta",
  "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
  "aspect_ratio": "16:9",
  "duration": 5,
  "resolution": "720p"
}',
  '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\": \"seedance-2.5-beta\",\n  \"prompt\": \"A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound\",\n  \"aspect_ratio\": \"16:9\",\n  \"duration\": 5,\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift テキストから動画
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "seedance-2.5-beta",
  "prompt": "A slow tracking shot through a rain-lit night market, neon reflections on wet stone, ambient crowd sound",
  "aspect_ratio": "16:9",
  "duration": 5,
  "resolution": "720p"
] 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": "seedance-2.5-beta",
  "prompt": "The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera",
  "aspect_ratio": "9:16",
  "duration": 8,
  "reference_audios": [
    "https://cdn.beatapi.io/samples/neon-singer-preview.mp3"
  ],
  "reference_images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "720p"
}
```

**Response**

```json
{
  "data": {
    "id": "task_7Qm2Xc9LpR4vT8sKa1Nf6YbH3eWdJ0uZ",
    "object": "task",
    "task_kind": "video",
    "capability_id": "seedance-2.5-beta",
    "capability_version": 1,
    "status": "queued",
    "stage": "queued",
    "created_at": 1791993600,
    "updated_at": 1791993600,
    "completed_at": null,
    "output": null,
    "request_id": "202611260732156684925978268d9d6yOLdMCKV",
    "error_code": null,
    "error_message": null,
    "media_type": "video",
    "model": "seedance-2.5-beta",
    "poll_after_seconds": 8
  }
}
```

**SDK Code**

```python 参照画像と参照音声
import requests

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

payload = {
    "model": "seedance-2.5-beta",
    "prompt": "The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera",
    "aspect_ratio": "9:16",
    "duration": 8,
    "reference_audios": ["https://cdn.beatapi.io/samples/neon-singer-preview.mp3"],
    "reference_images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
    "resolution": "720p"
}
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":"seedance-2.5-beta","prompt":"The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera","aspect_ratio":"9:16","duration":8,"reference_audios":["https://cdn.beatapi.io/samples/neon-singer-preview.mp3"],"reference_images":["https://cdn.beatapi.io/samples/neon-singer.png"],"resolution":"720p"}'
};

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\": \"seedance-2.5-beta\",\n  \"prompt\": \"The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera\",\n  \"aspect_ratio\": \"9:16\",\n  \"duration\": 8,\n  \"reference_audios\": [\n    \"https://cdn.beatapi.io/samples/neon-singer-preview.mp3\"\n  ],\n  \"reference_images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\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\": \"seedance-2.5-beta\",\n  \"prompt\": \"The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera\",\n  \"aspect_ratio\": \"9:16\",\n  \"duration\": 8,\n  \"reference_audios\": [\n    \"https://cdn.beatapi.io/samples/neon-singer-preview.mp3\"\n  ],\n  \"reference_images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\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\": \"seedance-2.5-beta\",\n  \"prompt\": \"The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera\",\n  \"aspect_ratio\": \"9:16\",\n  \"duration\": 8,\n  \"reference_audios\": [\n    \"https://cdn.beatapi.io/samples/neon-singer-preview.mp3\"\n  ],\n  \"reference_images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\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": "seedance-2.5-beta",
  "prompt": "The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera",
  "aspect_ratio": "9:16",
  "duration": 8,
  "reference_audios": [
    "https://cdn.beatapi.io/samples/neon-singer-preview.mp3"
  ],
  "reference_images": [
    "https://cdn.beatapi.io/samples/neon-singer.png"
  ],
  "resolution": "720p"
}',
  '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\": \"seedance-2.5-beta\",\n  \"prompt\": \"The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera\",\n  \"aspect_ratio\": \"9:16\",\n  \"duration\": 8,\n  \"reference_audios\": [\n    \"https://cdn.beatapi.io/samples/neon-singer-preview.mp3\"\n  ],\n  \"reference_images\": [\n    \"https://cdn.beatapi.io/samples/neon-singer.png\"\n  ],\n  \"resolution\": \"720p\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift 参照画像と参照音声
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "model": "seedance-2.5-beta",
  "prompt": "The singer from @image1 performs on stage in time with @audio1, warm spotlights, slow orbiting camera",
  "aspect_ratio": "9:16",
  "duration": 8,
  "reference_audios": ["https://cdn.beatapi.io/samples/neon-singer-preview.mp3"],
  "reference_images": ["https://cdn.beatapi.io/samples/neon-singer.png"],
  "resolution": "720p"
] 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()
```