# Seedance 1.5 Pro API ドキュメント

> AI Studio API で Seedance 1.5 Pro モデルを使用して動画を生成します。

## 概要

AI Studio API を使用して Seedance 1.5 Pro の生成タスクを作成し、タスク状態を確認します。処理は非同期です。まずタスクを作成して `taskId` を取得し、その後タスク API で結果を確認します。

## 認証

すべてのリクエストで `Authorization` ヘッダーに API Key が必要です。

```http
Authorization: Bearer YOUR_API_KEY
```

## 利用可能なモデル

| modelId | バージョン | プロバイダー | 実行モデル |
| --- | --- | --- | --- |
| `video:bytedance-seedance-1-5-pro` | Seedance 1.5 Pro | Bytedance Seedance 1.5 Pro | bytedance/seedance-1.5-pro |
| `video:fal-fal-ai-bytedance-seedance-v1-5-pro-text-to-video` | Seedance 1.5 Pro Text to Video | ByteDance | fal-ai/bytedance/seedance/v1.5/pro/text-to-video |
| `video:fal-fal-ai-bytedance-seedance-v1-5-pro-image-to-video` | Seedance 1.5 Pro Image to Video | ByteDance | fal-ai/bytedance/seedance/v1.5/pro/image-to-video |

## 1. 生成タスクを作成

### エンドポイント

```http
POST https://localhost:3000/api/ai-studio/execute
Content-Type: application/json
Authorization: Bearer YOUR_API_KEY
```

### リクエスト例

```json
{
  "modelId": "video:bytedance-seedance-1-5-pro",
  "isPublic": true,
  "payload": {
    "model": "bytedance/seedance-1.5-pro",
    "input": {
      "prompt": "A serene beach at sunset with waves gently crashing on the shore, palm trees swaying in the breeze, and seagulls flying across the orange sky",
      "input_urls": [
        "https://file.aiquickdraw.com/custom-page/akr/section-images/example1.png"
      ],
      "aspect_ratio": "1:1",
      "resolution": "720p",
      "duration": 8,
      "fixed_lens": false,
      "generate_audio": false,
      "nsfw_checker": false
    }
  }
}
```

### 成功レスポンス

```json
{
  "success": true,
  "data": {
    "modelId": "video:bytedance-seedance-1-5-pro",
    "generationId": "generation-id",
    "reservedCredits": 20,
    "taskId": "provider-task-id",
    "state": "queued"
  }
}
```

## 2. タスク状態を確認

### エンドポイント

```http
GET https://localhost:3000/api/ai-studio/tasks/{taskId}
Authorization: Bearer YOUR_API_KEY
```

### 成功レスポンス

```json
{
  "success": true,
  "data": {
    "generationId": "generation-id",
    "taskId": "provider-task-id",
    "modelId": "video:bytedance-seedance-1-5-pro",
    "state": "succeeded",
    "mediaUrls": [
      "https://example.com/result.mp4"
    ],
    "reservedCredits": 20,
    "refundedCredits": 0
  }
}
```

## リクエストフィールド

### Seedance 1.5 Pro

#### Payload フィールド

| フィールド | タイプ | 必須 | デフォルト / 例 | 選択肢 | 説明 |
| --- | --- | --- | --- | --- | --- |
| `model` | enum | はい | `"bytedance/seedance-1.5-pro"` | bytedance/seedance-1.5-pro | The model name to use for generation. Required field. - Must be `bytedance/seedance-1.5-pro` for this endpoint |
| `input` | object | いいえ | `-` | - | Input parameters for the generation task |

#### input フィールド

| フィールド | タイプ | 必須 | デフォルト / 例 | 選択肢 | 説明 |
| --- | --- | --- | --- | --- | --- |
| `prompt` | string | はい | `"A serene beach at sunset with waves gently crashing on the shore, palm trees swaying in the breeze, and seagulls flying across the orange sky"` | - | The text prompt used to generate the video. Required field. (Min length: 3, Max length: 20000 characters) |
| `input_urls` | string[] | いいえ | `["https://file.aiquickdraw.com/custom-page/akr/section-images/example1.png"]` | - | URLs of input images for image-to-video generation. Optional field. - Accepts 0-2 images<br>- If not provided, the model will perform text-to-video generation<br>- File URLs after upload, not file content<br>- Accepted types: image/jpeg, image/png, image/webp<br>- Max size per image: 10.0MB |
| `aspect_ratio` | enum | はい | `"1:1"` | 1:1, 4:3, 3:4, 16:9, 9:16, 21:9 | Video aspect ratio configuration. Required field. |
| `resolution` | enum | いいえ | `"720p"` | 480p, 720p, 1080p | Video resolution - 480p for faster generation, 720p for balance, 1080p for higher quality |
| `duration` | number | はい | `-` | - | Duration of the video in seconds,Optional range 4-12 s |
| `fixed_lens` | boolean | いいえ | `false` | - | Seedance adds dynamic camera movement. Enable this feature to lock the camera for stable, static shots. - **true**: Lock camera for static shots<br>- **false**: Allow dynamic camera movement |
| `generate_audio` | boolean | いいえ | `false` | - | Whether to generate audio for the video. - **true**: Generate with audio (higher cost)<br>- **false**: Generate without audio Note: Enabling audio will increase the generation cost |
| `nsfw_checker` | boolean | いいえ | `-` | - | Defaults to false. You can set it to false based on your needs. If set to false, our content filtering will be disabled, and all results will be returned directly by the model itself.<br>Note: There is no guarantee that everything can be filtered out; if you are not satisfied with the results, you will need to make your own arrangements. |

### Seedance 1.5 Pro Text to Video

#### Payload フィールド

| フィールド | タイプ | 必須 | デフォルト / 例 | 選択肢 | 説明 |
| --- | --- | --- | --- | --- | --- |
| `seed` | object | いいえ | `-` | - | Random seed to control video generation. Use -1 for random. |
| `duration` | enum | いいえ | `"5"` | 4, 5, 6, 7, 8, 9, 10, 11, 12 | Duration of the video in seconds |
| `resolution` | enum | いいえ | `"720p"` | 480p, 720p, 1080p | Video resolution - 480p for faster generation, 720p for balance, 1080p for higher quality |
| `aspect_ratio` | enum | いいえ | `"16:9"` | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16, auto | The aspect ratio of the generated video |
| `enable_safety_checker` | boolean | いいえ | `true` | - | If set to true, the safety checker will be enabled. |
| `prompt` | string | はい | `"Defense attorney declaring \"Ladies and gentlemen, reasonable doubt isn't just a phrase, it's the foundation of justice itself\", footsteps on marble, jury shifting, courtroom drama, closing argument power."` | - | The text prompt used to generate the video |
| `generate_audio` | boolean | いいえ | `true` | - | Whether to generate audio for the video |
| `camera_fixed` | boolean | いいえ | `false` | - | Whether to fix the camera position |

#### input フィールド

_このモデルのフィールド設定はありません。_

### Seedance 1.5 Pro Image to Video

#### Payload フィールド

| フィールド | タイプ | 必須 | デフォルト / 例 | 選択肢 | 説明 |
| --- | --- | --- | --- | --- | --- |
| `seed` | object | いいえ | `-` | - | Random seed to control video generation. Use -1 for random. |
| `duration` | enum | いいえ | `"5"` | 4, 5, 6, 7, 8, 9, 10, 11, 12 | Duration of the video in seconds |
| `resolution` | enum | いいえ | `"720p"` | 480p, 720p, 1080p | Video resolution - 480p for faster generation, 720p for balance, 1080p for higher quality |
| `aspect_ratio` | enum | いいえ | `"16:9"` | 21:9, 16:9, 4:3, 1:1, 3:4, 9:16, auto | The aspect ratio of the generated video |
| `enable_safety_checker` | boolean | いいえ | `true` | - | If set to true, the safety checker will be enabled. |
| `end_image_url` | object | いいえ | `-` | - | The URL of the image the video ends with. Defaults to None. |
| `prompt` | string | はい | `"A man is crying and he says \"I shouldn't have done it. I regret everything\""` | - | The text prompt used to generate the video |
| `generate_audio` | boolean | いいえ | `true` | - | Whether to generate audio for the video |
| `image_url` | string | はい | `"https://v3b.fal.media/files/b/0a8773cd/REzCWn1BKUVuMFTxR-R3W_image_317.png"` | - | The URL of the image used to generate video |
| `camera_fixed` | boolean | いいえ | `false` | - | Whether to fix the camera position |

#### input フィールド

_このモデルのフィールド設定はありません。_

## 価格

生成タスクの作成時にクレジットが予約されます。作成レスポンスの `reservedCredits` が、そのリクエストで予約されたクレジット数です。

| モデル | タイプ | 仕様 | 価格 | 課金 |
| --- | --- | --- | --- | --- |
| Seedance 1.5 Pro | テキスト/画像から動画 | 480p | 7 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 480p | 14 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 480p | 28 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 480p | 19 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 480p | 38 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 720p | 14 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 720p | 28 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 720p | 56 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 720p | 42 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 720p | 84 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 1080p | 30 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 1080p | 60 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 1080p | 120 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 1080p | 90 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro | テキスト/画像から動画 | 1080p | 180 クレジット | 生成ごとの固定価格 |
| Seedance 1.5 Pro Text to Video | テキストから動画 | 480p | 5 クレジット/秒 | 出力秒数 × 5 |
| Seedance 1.5 Pro Text to Video | テキストから動画 | 480p | 2 クレジット/秒 | 出力秒数 × 2 |
| Seedance 1.5 Pro Text to Video | テキストから動画 | 720p | 10 クレジット/秒 | 出力秒数 × 10 |
| Seedance 1.5 Pro Text to Video | テキストから動画 | 720p | 5 クレジット/秒 | 出力秒数 × 5 |
| Seedance 1.5 Pro Text to Video | テキストから動画 | 1080p | 23 クレジット/秒 | 出力秒数 × 23 |
| Seedance 1.5 Pro Text to Video | テキストから動画 | 1080p | 12 クレジット/秒 | 出力秒数 × 12 |
| Seedance 1.5 Pro Image to Video | 画像から動画 | 480p | 5 クレジット/秒 | 出力秒数 × 5 |
| Seedance 1.5 Pro Image to Video | 画像から動画 | 480p | 2 クレジット/秒 | 出力秒数 × 2 |
| Seedance 1.5 Pro Image to Video | 画像から動画 | 720p | 10 クレジット/秒 | 出力秒数 × 10 |
| Seedance 1.5 Pro Image to Video | 画像から動画 | 720p | 5 クレジット/秒 | 出力秒数 × 5 |
| Seedance 1.5 Pro Image to Video | 画像から動画 | 1080p | 23 クレジット/秒 | 出力秒数 × 23 |
| Seedance 1.5 Pro Image to Video | 画像から動画 | 1080p | 12 クレジット/秒 | 出力秒数 × 12 |

## 一般的なエラー

| ステータス | 意味 |
| --- | --- |
| `400` | Invalid request payload |
| `401` | Missing or invalid API key |
| `402` | Insufficient credits or plan limit |
| `404` | Model or task not found |
| `429` | Rate limit exceeded |
| `500` | Server error |
