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

# doubao-seedance-2.0 動画生成

>  - 非同期処理モード、後続のクエリ用にタスクIDを返却
- テキストから動画、画像から動画（最初のフレーム/最後のフレーム）をサポート
- 参照動画、参照音声、音声付き動画をサポート
- 横画面、縦画面、正方形、ウルトラワイド、自適応など様々なアスペクト比をサポート 

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://api.apimart.ai/v1/videos/generations \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "model": "doubao-seedance-2.0",
      "prompt": "子猫がカメラに向かってあくびをする",
      "resolution": "720p",
      "size": "16:9",
      "duration": 5,
      "generate_audio": true
    }'
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.apimart.ai/v1/videos/generations"

  payload = {
      "model": "doubao-seedance-2.0",
      "prompt": "子猫がカメラに向かってあくびをする",
      "resolution": "720p",
      "size": "16:9",
      "duration": 5,
      "generate_audio": True
  }

  headers = {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json"
  }

  response = requests.post(url, json=payload, headers=headers)

  print(response.json())
  ```

  ```javascript JavaScript theme={null}
  const url = "https://api.apimart.ai/v1/videos/generations";

  const payload = {
    model: "doubao-seedance-2.0",
    prompt: "子猫がカメラに向かってあくびをする",
    resolution: "720p",
    size: "16:9",
    duration: 5,
    generate_audio: true
  };

  const headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
  };

  fetch(url, {
    method: "POST",
    headers: headers,
    body: JSON.stringify(payload)
  })
    .then(response => response.json())
    .then(data => console.log(data))
    .catch(error => console.error('Error:', error));
  ```

  ```go Go theme={null}
  package main

  import (
      "bytes"
      "encoding/json"
      "fmt"
      "io/ioutil"
      "net/http"
  )

  func main() {
      url := "https://api.apimart.ai/v1/videos/generations"

      payload := map[string]interface{}{
          "model":          "doubao-seedance-2.0",
          "prompt":         "子猫がカメラに向かってあくびをする",
          "resolution":     "720p",
          "size":           "16:9",
          "duration":       5,
          "generate_audio": true,
      }

      jsonData, _ := json.Marshal(payload)

      req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
      req.Header.Set("Authorization", "Bearer <token>")
      req.Header.Set("Content-Type", "application/json")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      body, _ := ioutil.ReadAll(resp.Body)
      fmt.Println(string(body))
  }
  ```

  ```java Java theme={null}
  import java.net.http.HttpClient;
  import java.net.http.HttpRequest;
  import java.net.http.HttpResponse;
  import java.net.URI;

  public class Main {
      public static void main(String[] args) throws Exception {
          String url = "https://api.apimart.ai/v1/videos/generations";

          String payload = """
          {
            "model": "doubao-seedance-2.0",
            "prompt": "子猫がカメラに向かってあくびをする",
            "resolution": "720p",
            "size": "16:9",
            "duration": 5,
            "generate_audio": true
          }
          """;

          HttpClient client = HttpClient.newHttpClient();
          HttpRequest request = HttpRequest.newBuilder()
              .uri(URI.create(url))
              .header("Authorization", "Bearer <token>")
              .header("Content-Type", "application/json")
              .POST(HttpRequest.BodyPublishers.ofString(payload))
              .build();

          HttpResponse<String> response = client.send(request,
              HttpResponse.BodyHandlers.ofString());

          System.out.println(response.body());
      }
  }
  ```

  ```php PHP theme={null}
  <?php

  $url = "https://api.apimart.ai/v1/videos/generations";

  $payload = [
      "model" => "doubao-seedance-2.0",
      "prompt" => "子猫がカメラに向かってあくびをする",
      "resolution" => "720p",
      "size" => "16:9",
      "duration" => 5,
      "generate_audio" => true
  ];

  $ch = curl_init($url);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_POST, true);
  curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
  curl_setopt($ch, CURLOPT_HTTPHEADER, [
      "Authorization: Bearer <token>",
      "Content-Type: application/json"
  ]);

  $response = curl_exec($ch);
  curl_close($ch);

  echo $response;
  ?>
  ```

  ```ruby Ruby theme={null}
  require 'net/http'
  require 'json'
  require 'uri'

  url = URI("https://api.apimart.ai/v1/videos/generations")

  payload = {
    model: "doubao-seedance-2.0",
    prompt: "子猫がカメラに向かってあくびをする",
    resolution: "720p",
    size: "16:9",
    duration: 5,
    generate_audio: true
  }

  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 = payload.to_json

  response = http.request(request)
  puts response.body
  ```

  ```swift Swift theme={null}
  import Foundation

  let url = URL(string: "https://api.apimart.ai/v1/videos/generations")!

  let payload: [String: Any] = [
      "model": "doubao-seedance-2.0",
      "prompt": "子猫がカメラに向かってあくびをする",
      "resolution": "720p",
      "size": "16:9",
      "duration": 5,
      "generate_audio": true
  ]

  var request = URLRequest(url: url)
  request.httpMethod = "POST"
  request.setValue("Bearer <token>", forHTTPHeaderField: "Authorization")
  request.setValue("application/json", forHTTPHeaderField: "Content-Type")
  request.httpBody = try? JSONSerialization.data(withJSONObject: payload)

  let task = URLSession.shared.dataTask(with: request) { data, response, error in
      if let error = error {
          print("Error: \(error)")
          return
      }

      if let data = data, let responseString = String(data: data, encoding: .utf8) {
          print(responseString)
      }
  }

  task.resume()
  ```

  ```csharp C# theme={null}
  using System;
  using System.Net.Http;
  using System.Text;
  using System.Threading.Tasks;

  class Program
  {
      static async Task Main(string[] args)
      {
          var url = "https://api.apimart.ai/v1/videos/generations";

          var payload = @"{
              ""model"": ""doubao-seedance-2.0"",
              ""prompt"": ""子猫がカメラに向かってあくびをする"",
              ""resolution"": ""720p"",
              ""size"": ""16:9"",
              ""duration"": 5,
              ""generate_audio"": true
          }";

          using var client = new HttpClient();
          client.DefaultRequestHeaders.Add("Authorization", "Bearer <token>");

          var content = new StringContent(payload, Encoding.UTF8, "application/json");
          var response = await client.PostAsync(url, content);
          var result = await response.Content.ReadAsStringAsync();

          Console.WriteLine(result);
      }
  }
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "code": 200,
    "data": [
      {
        "status": "submitted",
        "task_id": "task_01KMCGF6BQGN3X28H3KSR50X5T"
      }
    ]
  }
  ```

  ```json 400 theme={null}
  {
    "error": {
      "code": 400,
      "message": "リクエストパラメータが無効です",
      "type": "invalid_request_error"
    }
  }
  ```

  ```json 401 theme={null}
  {
    "error": {
      "code": 401,
      "message": "認証に失敗しました。APIキーを確認してください",
      "type": "authentication_error"
    }
  }
  ```

  ```json 402 theme={null}
  {
    "error": {
      "code": 402,
      "message": "残高が不足しています。チャージしてから再度お試しください",
      "type": "payment_required"
    }
  }
  ```

  ```json 429 theme={null}
  {
    "error": {
      "code": 429,
      "message": "リクエストが多すぎます。しばらくしてから再度お試しください",
      "type": "rate_limit_error"
    }
  }
  ```

  ```json 500 theme={null}
  {
    "error": {
      "code": 500,
      "message": "サーバー内部エラー。しばらくしてから再度お試しください",
      "type": "server_error"
    }
  }
  ```
</ResponseExample>

## 認証

<ParamField header="Authorization" type="string" required>
  すべてのAPIエンドポイントはBearer Token認証が必要です

  APIキーの取得：

  [APIキー管理ページ](https://apimart.ai/keys)にアクセスしてAPIキーを取得してください

  リクエストヘッダーに追加：

  ```
  Authorization: Bearer YOUR_API_KEY
  ```
</ParamField>

## リクエストパラメータ

<ParamField body="model" type="string" required>
  動画生成モデル名

  サポートされるモデル：

  * `doubao-seedance-2.0` - スタンダード版、テキストから動画、画像から動画、最初/最後のフレーム動画、参照動画、参照音声、音声付き動画をサポート
  * `doubao-seedance-2.0-fast` - 高速版、スタンダード版と同じ機能で、生成速度がより高速
  * `doubao-seedance-2.0-mini` - ミニ版、スタンダード版と同じ機能
</ParamField>

<ParamField body="prompt" type="string">
  動画コンテンツの説明

  テキストから動画の場合は必須、画像から動画/動画参照生成の場合はオプション

  主題、アクション、カメラワーク、スタイルを明確に記述すると、より良い生成結果が得られます

  <Warning>
    * プロンプトは 4000 文字まで入力できますが、500 文字程度を推奨します。
    * モデル `doubao-seedance-2.0-mini` には文字数制限がありません。推奨：中国語のプロンプトは500文字以内、英語のプロンプトは1000語以内にしてください。文字数が多すぎると情報が分散しやすく、モデルが細部を見落として要点のみに注目し、動画に一部の要素が欠ける可能性があります。
  </Warning>

  例：`"子猫がカメラに向かってあくびをする"`
</ParamField>

<ParamField body="duration" type="integer" default="5">
  動画の長さ（秒）

  サポート範囲：`4` \~ `15` 秒

  デフォルト：`5`
</ParamField>

<ParamField body="size" type="string" default="16:9">
  動画のアスペクト比

  オプション：

  * `16:9` - 横画面
  * `9:16` - 縦画面
  * `1:1` - 正方形
  * `4:3` - 従来の比率
  * `3:4` - 縦向き従来の比率
  * `21:9` - ウルトラワイド
  * `adaptive` - 自適応（入力画像/動画に応じて自動的にマッチング）

  デフォルト：`16:9`
</ParamField>

<ParamField body="resolution" type="string" default="720p">
  動画の解像度

  オプション：

  * `480p` - 標準画質
  * `720p` - 高画質
  * `1080p` - フルHD（`doubao-seedance-2.0` のみ対応）
  * `4k` - 超高画質（`doubao-seedance-2.0` のみ対応）

  デフォルト：`720p`
</ParamField>

<ParamField body="seed" type="integer">
  ランダムシード、生成コンテンツのランダム性を制御するために使用

  <Note>
    * 同じリクエストで異なる seed 値を受け取ると、異なる結果が生成されます
    * 同じリクエストで同じ seed 値を受け取ると、類似の結果が生成されますが、完全に一致することは保証されません
  </Note>
</ParamField>

<ParamField body="generate_audio" type="boolean" default="false">
  音声を生成するかどうか（音声付き動画）

  `true` に設定すると、動画にAI生成の音声が含まれます

  デフォルト：`false`
</ParamField>

<ParamField body="return_last_frame" type="boolean" default="false">
  最後のフレーム画像を返すかどうか

  `true` に設定すると、タスク結果に動画の最後のフレームの画像URLが追加で返されます。連続動画生成に使用できます

  デフォルト：`false`
</ParamField>

<ParamField body="tools" type="array<object>">
  ツールリスト、ウェブ検索などの拡張機能に使用

  例：`[{"type": "web_search"}]`

  <Expandable title="フィールド説明">
    <ParamField body="type" type="string" required>
      ツールタイプ

      オプション：

      * `web_search` - ウェブ検索、生成時にウェブ情報を参照
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="image_urls" type="array<string>">
  画像URL配列、画像から動画に使用

  2種類の形式をサポート：

  * 通常の画像URL：`https://example.com/cat.jpg`
  * Asset URL（審査済み素材）：`asset://asset_a`

  例：`["https://example.com/cat.jpg"]` または `["asset://asset_a"]`

  <Note>
    Asset URL は `doubao-seedance-2.0` および `doubao-seedance-2.0-fast` モデルのみ対応しています。その他のモデルでは使用できません。
  </Note>

  <Warning>
    * `image_urls` と `image_with_roles` は同時に使用できません
    * 最大9枚の参照画像
  </Warning>
</ParamField>

<ParamField body="image_with_roles" type="array">
  ロール付き画像配列、最初のフレーム/最後のフレームの指定をサポート

  <Note>
    `url` フィールドに Asset URL を使用する場合、`doubao-seedance-2.0` および `doubao-seedance-2.0-fast` モデルのみ対応しています。その他のモデルでは使用できません。
  </Note>

  <Expandable title="フィールド説明">
    <ParamField body="url" type="string" required>
      画像URLアドレス

      2種類の形式をサポート：

      * 通常の画像URL：`https://example.com/day.jpg`
      * Asset URL（審査済み素材）：`asset://asset_a`

      <Note>
        Asset URL は `doubao-seedance-2.0` および `doubao-seedance-2.0-fast` モデルのみ対応しています。その他のモデルでは使用できません。
      </Note>
    </ParamField>

    <ParamField body="role" type="string" required>
      画像ロール

      オプション：

      * `first_frame` - 最初のフレーム画像、動画の開始画面として使用
      * `last_frame` - 最後のフレーム画像、動画の終了画面として使用
      * `reference_image` - 参照ポートレート画像（Asset URL と組み合わせて使用）
    </ParamField>
  </Expandable>

  例：

  ```json theme={null}
  [
    {"url": "https://example.com/day.jpg", "role": "first_frame"},
    {"url": "https://example.com/night.jpg", "role": "last_frame"}
  ]
  ```

  Asset URL の書き方：

  ```json theme={null}
  [
    {"url": "asset://asset_a", "role": "reference_image"}
  ]
  ```

  <Warning>
    * `image_urls` と `image_with_roles` は同時に使用できません
    * 最初/最後のフレーム画像を使用する場合、`video_urls` と `audio_urls` は使用できません
  </Warning>
</ParamField>

<ParamField body="video_urls" type="array<string>">
  参照動画URL配列

  2種類の形式をサポート：

  * 通常の動画URL：`https://example.com/reference.mp4`
  * Asset URL（審査済み素材）：`asset://asset_a`

  例：`["https://example.com/reference.mp4"]` または `["asset://asset_a"]`

  <Note>
    Asset URL は `doubao-seedance-2.0` および `doubao-seedance-2.0-fast` モデルのみ対応しています。その他のモデルでは使用できません。
  </Note>

  <Warning>
    * 最初/最後のフレーム画像（`image_with_roles`）を使用する場合、参照動画は使用できません
    * 最大3つの参照動画、1.8s \< 合計時間 \< 15.2s
    * 参照動画の解像度は 480P \~ 720P の範囲である必要があります
    * 参照動画に実在の人物を含めることはできません
  </Warning>
</ParamField>

<ParamField body="audio_urls" type="array<string>">
  参照音声URL配列

  2種類の形式をサポート：

  * 通常の音声URL：`https://example.com/speech.wav`
  * Asset URL（審査済み素材）：`asset://asset_a`

  例：`["https://example.com/speech.wav"]` または `["asset://asset_a"]`

  <Note>
    Asset URL は `doubao-seedance-2.0` および `doubao-seedance-2.0-fast` モデルのみ対応しています。その他のモデルでは使用できません。
  </Note>

  <Warning>
    * 最初/最後のフレーム画像（`image_with_roles`）を使用する場合、参照音声は使用できません
    * 最大3つの参照音声、合計時間 ≤ 15s
    * 参照音声は参照画像または参照動画と一緒に使用する必要があります
  </Warning>
</ParamField>

## レスポンス

<ResponseField name="code" type="integer">
  レスポンスステータスコード、成功時は200
</ResponseField>

<ResponseField name="data" type="array">
  レスポンスデータ配列

  <Expandable title="配列要素">
    <ResponseField name="status" type="string">
      タスクステータス、初期送信時は `submitted`
    </ResponseField>

    <ResponseField name="task_id" type="string">
      タスクステータスと結果を照会するための一意のタスク識別子
    </ResponseField>
  </Expandable>
</ResponseField>

## ユースケース

### ケース 1：テキストから動画

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "子猫がカメラに向かってあくびをする",
  "resolution": "720p",
  "size": "16:9",
  "duration": 5,
  "seed": 42,
  "generate_audio": true
}
```

### ケース 2：画像から動画（最初のフレーム）

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "子猫が立ち上がってカメラに向かって歩く",
  "image_urls": ["https://example.com/cat.jpg"],
  "duration": 5
}
```

### ケース 3：最初/最後のフレーム動画

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "昼から夜への移り変わり",
  "image_with_roles": [
    {"url": "https://example.com/day.jpg", "role": "first_frame"},
    {"url": "https://example.com/night.jpg", "role": "last_frame"}
  ],
  "duration": 5
}
```

### ケース 4：動画参照から動画生成

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "動画のスタイルをアニメ風に変換する",
  "video_urls": ["https://example.com/reference.mp4"]
}
```

### ケース 5：参照動画 + 参照音声

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "人物が話しているシーン",
  "video_urls": ["https://example.com/reference.mp4"],
  "audio_urls": ["https://example.com/speech.wav"],
  "size": "16:9",
  "duration": 11
}
```

### ケース 6：音声付き動画

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "男性が女性を呼び止めて言う：「覚えておいて、これからは指で月を指してはいけないよ。」",
  "generate_audio": true
}
```

### ケース 7：連続動画生成（最後のフレームを返す）

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "子猫がカメラに向かって歩き続ける",
  "image_urls": ["https://example.com/last_frame_from_prev.png"],
  "return_last_frame": true
}
```

### ケース 8：高速版生成

```json theme={null}
{
  "model": "doubao-seedance-2.0-fast",
  "prompt": "都市の夜景タイムラプス撮影",
  "size": "21:9",
  "duration": 8
}
```

### ケース 9：参照画像 + 参照動画 + 参照音声（マルチモーダル動画）

参照画像、参照動画、参照音声を組み合わせて、没入感のある一人称視点の広告動画を生成します。商品プロモーション、ブランド広告など、複数素材の融合が必要なシーンに最適です。

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "全編を通して動画1の一人称視点の構図を使用し、全編を通して音声1をBGMとして使用する。一人称視点のフルーツティー宣伝広告、seedanceブランド「苹苹安安」アップルフルーツティー限定版。最初のフレームは画像1：あなたの手が朝露のついたアクスの赤リンゴを摘み、鮮明なリンゴの衝突音。2-4秒：素早いカット切替、あなたの手がリンゴの塊をシェーカーカップに投入し、氷とお茶ベースを加え、力強く振る。氷の衝突音と振る音が軽快なドラムビートに合わせる、背景音：「新鮮カット、新鮮シェイク」。4-6秒：一人称完成品クローズアップ、層状のフルーツティーを透明カップに注ぎ、あなたの手がクリームキャップを上部に軽く絞り出して広げ、カップにピンクのラベルを貼り、カメラがクリームキャップとフルーツティーの層状テクスチャにズームイン。6-8秒：一人称手持ちカップを掲げる、画像2のフルーツティーをカメラに向けて持ち上げる（視聴者に差し出す視点をシミュレート）、カップのラベルがはっきり見える、背景音「さわやかな一口をどうぞ」、最終フレームは画像2で静止。背景音声は一貫して女性の音色を使用。",
  "image_urls": [
    "https://example.com/tea_pic1.jpg",
    "https://example.com/tea_pic2.jpg"
  ],
  "video_urls": ["https://example.com/tea_video1.mp4"],
  "audio_urls": ["https://example.com/tea_audio1.mp3"],
  "generate_audio": true,
  "size": "16:9",
  "duration": 11
}
```

### ケース 10：Asset URL を使用した画像から動画

審査済みのバーチャルアバター素材を参照画像として直接渡すことができ、再アップロードや再審査は不要です。

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "人物が明るい陽光の中、都市の街路を自然に歩く",
  "image_urls": ["asset://asset_a"],
  "duration": 5,
  "resolution": "720p"
}
```

### ケース 11：Asset URL で参照ポートレートを指定（image\_with\_roles）

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "参照ポートレートを使用して、人物がエレガントにカメラに向かって歩く",
  "image_with_roles": [
    {
      "url": "asset://asset_a",
      "role": "reference_image"
    }
  ],
  "resolution": "720p",
  "duration": 5
}
```

### ケース 12：高速版 + Asset URL 画像から動画

```json theme={null}
{
  "model": "doubao-seedance-2.0-fast",
  "prompt": "人物が公園を散歩し、そよ風が吹く",
  "image_urls": ["asset://asset_a"],
  "duration": 5,
  "resolution": "720p"
}
```

### ケース 13：Asset URL 画像 + 参照動画（モーション転送）

審査済みの人物素材と参照動画を組み合わせて、指定した動作を行うよう人物を誘導します。

```json theme={null}
{
  "model": "doubao-seedance-2.0",
  "prompt": "人物が参照動画のリズムに合わせて踊り、動作がスムーズで自然",
  "image_urls": ["https://example.com/dance_reference.jpg", "asset://asset_a"],
  "video_urls": ["https://example.com/dance_reference.mp4", "asset://asset_a"],
  "duration": 8,
  "resolution": "720p"
}
```

<Note>
  **タスク結果の照会**

  動画生成は非同期タスクで、送信時に `task_id` を返します。[タスクステータス取得](/ja/api-reference/tasks/status) エンドポイントを使用して、生成の進行状況と結果を照会してください。
</Note>

## 1.5 Proバージョンとの違い

| 特性          | 1.5 Pro                           | 2.0 / 2.0 fast                              |
| ----------- | --------------------------------- | ------------------------------------------- |
| 解像度         | 480p/720p/1080p                   | **480p/720p/1080p/4k**（fast は 480p/720p のみ） |
| 長さ範囲        | 4-12秒                             | **5-15秒**                                   |
| デフォルト長さ     | 5秒                                | **5秒**                                      |
| アスペクト比パラメータ | `aspect_ratio`                    | **`size`**（`adaptive` 自適応を追加）               |
| 音声生成        | `audio` パラメータ                     | **`generate_audio` パラメータ**                  |
| 参照動画        | 非サポート                             | **`video_urls` サポート**                       |
| 参照音声        | 非サポート                             | **`audio_urls` サポート**                       |
| 画像から動画      | `image_urls` / `image_with_roles` | **`image_urls` / `image_with_roles`**       |
| 音声付き動画      | 非サポート                             | **`generate_audio` サポート**                   |
| 連続動画        | 非サポート                             | **`return_last_frame` サポート**                |
| 高速版         | 非サポート                             | **`doubao-seedance-2.0-fast` サポート**         |
