# Seedance 1.5 Pro API 文档

> 通过 AI Studio API 使用 Seedance 1.5 Pro 模型生成视频。

## 概览

使用 AI Studio API 创建 Seedance 1.5 Pro 生成任务并查询任务状态。接口采用异步流程：先创建任务拿到 `taskId`，再通过任务查询接口轮询结果。

## 认证方式

所有请求都需要在 `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 |
