> ## 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-1-5-pro 動画生成

>  - 非同期処理モード、後続のクエリ用にタスク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-1-5-pro",
      "prompt": "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "720p",
      "audio": true
    }'
  ```

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

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

  payload = {
      "model": "doubao-seedance-1-5-pro",
      "prompt": "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "720p",
      "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-1-5-pro",
    prompt: "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
    duration: 5,
    aspect_ratio: "16:9",
    resolution: "720p",
    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-1-5-pro",
          "prompt":       "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
          "duration":     5,
          "aspect_ratio": "16:9",
          "resolution":   "720p",
          "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-1-5-pro",
            "prompt": "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
            "duration": 5,
            "aspect_ratio": "16:9",
            "resolution": "720p",
            "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-1-5-pro",
      "prompt" => "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
      "duration" => 5,
      "aspect_ratio" => "16:9",
      "resolution" => "720p",
      "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-1-5-pro",
    prompt: "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
    duration: 5,
    aspect_ratio: "16:9",
    resolution: "720p",
    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-1-5-pro",
      "prompt": "日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳",
      "duration": 5,
      "aspect_ratio": "16:9",
      "resolution": "720p",
      "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-1-5-pro"",
              ""prompt"": ""日光の下で遊ぶ可愛い子猫、ふわふわの毛並み、輝く瞳"",
              ""duration"": 5,
              ""aspect_ratio"": ""16:9"",
              ""resolution"": ""720p"",
              ""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_01K8SGYNNNVBQTXNR4MM964S7K"
      }
    ]
  }
  ```

  ```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-1-5-pro` - 1.5 Pro版。音声生成と先頭フレーム/末尾フレーム（画像から動画）をサポート
</ParamField>

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

  シーン、アクション、スタイルなどを詳細に記述すると、より良い生成結果が得られます

  例：`"ビーチでの夕日、海面に金色の日差し、砂浜に優しく打ち寄せる波"`
</ParamField>

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

  サポート範囲：`4` ～ `12` 秒

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

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

  オプション：

  * `16:9` - 横画面
  * `9:16` - 縦画面
  * `1:1` - 正方形
  * `4:3` - 従来の比率
  * `3:4` - 縦向き従来の比率
  * `21:9` - ウルトラワイド

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

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

  オプション：

  * `480p` - 標準画質
  * `720p` - HD画質
  * `1080p` - フルHD画質

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

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

  値の範囲：`-1` から `2^32-1` までの整数

  <Note>
    * 同じリクエストで、モデルが異なるシード値を受け取った場合（例：シードを指定しない、またはシードを-1に設定するとランダムな数値が使用される）、異なる結果が生成されます
    * 同じリクエストで、モデルが同じシード値を受け取った場合、類似の結果が生成されますが、完全に同一であることは保証されません
  </Note>
</ParamField>

<ParamField body="audio" type="boolean" default="true">
  音声を生成するかどうか

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

  デフォルト：`true`

  <Note>
    音声生成は Seedance 2.0 シリーズおよび Seedance 1.5 Pro のみ対応しています
  </Note>
</ParamField>

<ParamField body="camerafixed" type="boolean" default="false">
  カメラを固定するかどうか

  `true` に設定すると、カメラ位置が固定されます

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

## 解像度とアスペクト比の組み合わせ

| 解像度   | サポートされるアスペクト比                   | 備考      |
| ----- | ------------------------------- | ------- |
| 480p  | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | すべてサポート |
| 720p  | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | すべてサポート |
| 1080p | 16:9, 4:3, 1:1, 3:4, 9:16, 21:9 | すべてサポート |

<ParamField body="image_urls" type="array<url>">
  画像から動画への変換用画像URL配列

  自動ロール割り当てルール：

  * 1枚 = 最初のフレーム
  * 2枚 = 最初のフレーム + 最後のフレーム

  例：`["https://example.com/first.png", "https://example.com/last.png"]`

  <Warning>
    * `image_urls` と `image_with_roles` を同時に使用することはできません
  </Warning>
</ParamField>

<ParamField body="image_with_roles" type="array">
  より精密な制御のためのロール付き画像配列

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

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

      オプション：

      * `first_frame` - 最初のフレーム画像、動画の開始フレームとして（1枚のみサポート）
      * `last_frame` - 最後のフレーム画像、動画の終了フレームとして（1枚のみサポート）
    </ParamField>
  </Expandable>

  例：

  ```json theme={null}
  [
    {"url": "https://example.com/start.png", "role": "first_frame"},
    {"url": "https://example.com/end.png", "role": "last_frame"}
  ]
  ```

  <Warning>
    * `image_urls` と `image_with_roles` を同時に使用することはできません
    * 最初のフレームと最後のフレームはそれぞれ1枚のみサポート
  </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-1-5-pro",
  "prompt": "ビーチでの夕日、海面に金色の日差し、砂浜に優しく打ち寄せる波",
  "audio": true
}
```

### ケース 2：高品質縦画面ショート動画

```json theme={null}
{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "桜の木の下で回転する女の子、風に舞う花びら",
  "duration": 5,
  "aspect_ratio": "9:16",
  "resolution": "720p",
  "audio": true
}
```

### ケース 3：最初のフレームからダイナミック動画

```json theme={null}
{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "画像に自然なダイナミック効果を追加してアニメーション化",
  "image_urls": ["https://example.com/first.png"],
  "duration": 5,
  "audio": true
}
```

### ケース 4：最初/最後のフレームによるトランジション効果

```json theme={null}
{
  "model": "doubao-seedance-1-5-pro",
  "prompt": "シーンが昼から夜に移り変わり、街の灯りが徐々に点灯",
  "image_with_roles": [
    {"url": "https://example.com/day.png", "role": "first_frame"},
    {"url": "https://example.com/night.png", "role": "last_frame"}
  ],
  "duration": 5
}
```

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

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

## 1.0バージョンとの違い

| 機能       | 1.0 fast/quality | 1.5 Pro             |
| -------- | ---------------- | ------------------- |
| デフォルト解像度 | 1080p            | **720p**            |
| サポート解像度  | 480p/720p/1080p  | **480p/720p/1080p** |
| 長さの範囲    | 2-12秒            | **4-12秒**           |
| 音声生成     | 非サポート            | **サポート**            |
| 参照画像     | `reference` (1枚) | **非サポート**           |
