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

# Seedance 1.5 视频生成

> 使用 `POST /v1/videos` 调用 Seedance 1.5 的 480p、720p、1080p 模型。

# Seedance 1.5

Seedance 1.5 使用 `multipart/form-data` 请求提交异步视频任务。模型名中的 `480p`、`720p`、`1080p` 表示输出清晰度档位。

* 接口路径是 `POST /v1/videos`。
* 请求格式是 `multipart/form-data`。
* 可用模型为 `doubao-seedance-1-5-pro_480p`、`doubao-seedance-1-5-pro_720p`、`doubao-seedance-1-5-pro_1080p`。
* `seconds` 支持 `4` 到 `11` 秒。
* `size` 传宽高比，例如 `16:9`、`9:16`、`1:1`、`4:3`、`3:4`、`21:9`。
* 首帧图使用 `first_frame_image`，尾帧图使用 `last_frame_image`，字段值传服务端可访问的图片 URL。

## 方法与路径

```http theme={null}
POST /v1/videos
```

## 请求示例

<RequestExample>
  ```bash 文生视频 cURL theme={null}
  curl -X POST https://www.geeknow.top/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=doubao-seedance-1-5-pro_720p" \
    -F "prompt=雨夜街头，一位穿红色雨衣的女孩慢跑，镜头缓慢跟拍，电影感光影" \
    -F "seconds=8" \
    -F "size=16:9"
  ```

  ```bash 首帧生视频 cURL theme={null}
  curl -X POST https://www.geeknow.top/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=doubao-seedance-1-5-pro_720p" \
    -F "prompt=让图片中的人物自然抬头，微笑，看向镜头" \
    -F "seconds=8" \
    -F "size=9:16" \
    -F "first_frame_image=https://example.com/images/first-frame.png"
  ```

  ```bash 首尾帧 cURL theme={null}
  curl -X POST https://www.geeknow.top/v1/videos \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -F "model=doubao-seedance-1-5-pro_1080p" \
    -F "prompt=从首帧自然过渡到尾帧，保持主体一致，动作连贯" \
    -F "seconds=8" \
    -F "size=16:9" \
    -F "first_frame_image=https://example.com/images/opening-frame.png" \
    -F "last_frame_image=https://example.com/images/ending-frame.png"
  ```

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

  resp = requests.post(
      "https://www.geeknow.top/v1/videos",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      data={
          "model": "doubao-seedance-1-5-pro_720p",
          "prompt": "雨夜街头，一位穿红色雨衣的女孩慢跑，镜头缓慢跟拍，电影感光影",
          "seconds": "8",
          "size": "16:9",
      },
      timeout=120,
  )

  print(resp.json())
  ```

  ```python Python - 首帧生视频 theme={null}
  import requests

  resp = requests.post(
      "https://www.geeknow.top/v1/videos",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      data={
          "model": "doubao-seedance-1-5-pro_720p",
          "prompt": "让图片中的人物自然抬头，微笑，看向镜头",
          "seconds": "8",
          "size": "9:16",
          "first_frame_image": "https://example.com/images/first-frame.png",
      },
      timeout=120,
  )

  print(resp.json())
  ```

  ```javascript JavaScript theme={null}
  const form = new FormData();
  form.append("model", "doubao-seedance-1-5-pro_720p");
  form.append("prompt", "雨夜街头，一位穿红色雨衣的女孩慢跑，镜头缓慢跟拍，电影感光影");
  form.append("seconds", "8");
  form.append("size", "16:9");

  const response = await fetch("https://www.geeknow.top/v1/videos", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
    },
    body: form,
  });

  console.log(await response.json());
  ```

  ```javascript JavaScript - 首帧生视频 theme={null}
  const form = new FormData();
  form.append("model", "doubao-seedance-1-5-pro_720p");
  form.append("prompt", "让图片中的人物自然抬头，微笑，看向镜头");
  form.append("seconds", "8");
  form.append("size", "9:16");
  form.append("first_frame_image", "https://example.com/images/first-frame.png");

  const response = await fetch("https://www.geeknow.top/v1/videos", {
    method: "POST",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
    },
    body: form,
  });

  console.log(await response.json());
  ```
</RequestExample>

## 响应示例

<ResponseExample>
  ```json 200 - 提交成功 theme={null}
  {
    "id": "video_abc123",
    "task_id": "video_abc123",
    "object": "video",
    "model": "doubao-seedance-1-5-pro_720p",
    "status": "queued",
    "progress": 0,
    "created_at": 1735689600,
    "video_url": ""
  }
  ```

  ```json 400 - 参数错误 theme={null}
  {
    "error": {
      "message": "prompt is required",
      "type": "invalid_request_error",
      "param": "prompt",
      "code": "invalid_request_error"
    }
  }
  ```

  ```json 401 - 认证失败 theme={null}
  {
    "error": {
      "message": "invalid token",
      "type": "invalid_request_error",
      "code": "invalid_api_key"
    }
  }
  ```

  ```json 402 - 额度不足 theme={null}
  {
    "error": {
      "message": "insufficient quota",
      "type": "insufficient_quota",
      "code": "insufficient_quota"
    }
  }
  ```

  ```json 429 - 请求过多 theme={null}
  {
    "error": {
      "message": "rate limit exceeded",
      "type": "rate_limit_error",
      "code": "rate_limit_exceeded"
    }
  }
  ```
</ResponseExample>

## 认证

使用 Bearer Token 鉴权：

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Form Fields

<ParamField body="model" type="string" required>
  模型名称。可选 `doubao-seedance-1-5-pro_480p`、`doubao-seedance-1-5-pro_720p`、`doubao-seedance-1-5-pro_1080p`。
</ParamField>

<ParamField body="prompt" type="string" required>
  视频生成提示词。
</ParamField>

<ParamField body="seconds" type="string">
  视频时长。支持 `4` 到 `11` 秒，建议按字符串传入，例如 `"8"`。
</ParamField>

<ParamField body="size" type="string">
  宽高比。常用值包括 `16:9`、`9:16`、`1:1`、`4:3`、`3:4`、`21:9`、`keep_ratio`、`adaptive`。
</ParamField>

<ParamField body="first_frame_image" type="string">
  首帧图片 URL。用于首帧生视频或首尾帧模式，需传服务端可访问的公网 URL。
</ParamField>

<ParamField body="last_frame_image" type="string">
  尾帧图片 URL。通常与 `first_frame_image` 一起用于首尾帧模式，需传服务端可访问的公网 URL。
</ParamField>

## Response

<ResponseField name="id" type="string">
  视频任务 ID。后续可用于 `GET /v1/videos/{id}` 查询。
</ResponseField>

<ResponseField name="task_id" type="string">
  视频任务 ID 的兼容字段。通常与 `id` 相同。
</ResponseField>

<ResponseField name="object" type="string">
  对象类型，通常为 `video`。
</ResponseField>

<ResponseField name="model" type="string">
  本次任务使用的模型，例如 `doubao-seedance-1-5-pro_720p`。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态。常见值为 `queued`、`in_progress`、`completed`、`failed`。
</ResponseField>

<ResponseField name="progress" type="number">
  任务进度，常见范围为 `0` 到 `100`。
</ResponseField>

<ResponseField name="video_url" type="string">
  任务完成后的视频地址。也可以使用 `GET /v1/videos/{id}/content` 下载结果。
</ResponseField>

<ResponseField name="error" type="object">
  任务失败或接口错误时返回的错误对象，通常包含 `message` 和 `code`。
</ResponseField>

## 模型选择

| 模型                              | 清晰度   |
| ------------------------------- | ----- |
| `doubao-seedance-1-5-pro_480p`  | 480p  |
| `doubao-seedance-1-5-pro_720p`  | 720p  |
| `doubao-seedance-1-5-pro_1080p` | 1080p |

## 使用场景

### 720p 文生视频

```json theme={null}
{
  "model": "doubao-seedance-1-5-pro_720p",
  "prompt": "雨夜街头，一位穿红色雨衣的女孩慢跑，镜头缓慢跟拍，电影感光影",
  "seconds": "8",
  "size": "16:9"
}
```

### 竖屏首帧生视频

```text theme={null}
model=doubao-seedance-1-5-pro_720p
prompt=让图片中的人物自然抬头，微笑，看向镜头
seconds=8
size=9:16
first_frame_image=https://example.com/images/first-frame.png
```

### 首尾帧过渡

```text theme={null}
model=doubao-seedance-1-5-pro_1080p
prompt=从首帧自然过渡到尾帧，保持主体一致，动作连贯
seconds=8
size=16:9
first_frame_image=https://example.com/images/opening-frame.png
last_frame_image=https://example.com/images/ending-frame.png
```

## 注意事项

* 请求格式为 `multipart/form-data`。
* 图片通过 `first_frame_image`、`last_frame_image` 传入 URL；本地文件需先上传到服务端可访问的公网地址。
* `seconds` 支持 `4` 到 `11` 秒。
* 模型名里的 `480p`、`720p`、`1080p` 决定输出清晰度。
* 不推荐用于“参考生视频”模式；需要图片约束时优先使用首帧或首尾帧。

## 相关接口

* [Seedance 1.5 概览](./overview)
* [Seedance 1.5 任务查询](./query)
