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

# Seedance 1.5 Pro API：字节跳动的视频生成模型

> 用于文生视频、图生视频和视频扩展工作流的字节跳动视频生成 API

## 概览

要继续现有镜头，请使用 [视频扩展请求](#video-extend)。将 `input.mode` 设置为 `video-extend`，在 `video_urls` 中提供原始剪辑作为单个条目，并在 `prompt` 中描述接下来应发生的情况。示例中包含 `duration`、`resolution` 以及 `sound` 切换开关。

如果需要打开和关闭 **图像** 而不是视频剪辑，请从 [图生视频](#image-to-video) 开始，并按顺序发送帧。

| 功能 | 值 |
| - | - |
| 模型 ID | `seedance-1-5-pro` |
| 模式 | `text-to-video`, `image-to-video`, `video-extend` |
| 提示词长度 | 3 至 2500 个字符 |
| 参考图片 | 1-2 个 `image-to-video` 的 URL；第二个图像用作结束帧 |
| 源视频 | 恰好 1 个公开视频 URL，用于 `video-extend` |
| 纵横比 | `auto`、`1:1`、`3:4`、`4:3`、`9:16`、`16:9`、`21:9` 用于 `text-to-video` 和 `image-to-video` |
| 可选分辨率 | `480p`, `720p`, `1080p` |
| 时长 | 4-12 秒；使用 `4`、`8` 或 `12` 进行可预测的层级匹配 |
| 音频 | 必需的 `sound` 切换 |
| 输出 | 生成或扩展的视频 URL 位于 `resultJson.resultUrls` 中 |

## 接口与身份验证

API 基础地址：

```text theme={null}
https://api.apixo.ai/api/v1
```

| 方法 | 端点 | 用途 |
| - | - | - |
| `POST` | `/generateTask/seedance-1-5-pro` | 提交生成任务 |
| `GET` | `/statusTask/seedance-1-5-pro?taskId={taskId}` | 查询任务状态并获取结果 |

每个请求都必须携带 APIXO API 密钥：

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

提交任务时，还需要设置以下请求头：

```http theme={null}
Content-Type: application/json
```

## 异步请求示例

以下示例提交一个最简单的文生视频任务，响应中会返回 `taskId`。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedance-1-5-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "async",
    "input": {
      "mode": "text-to-video",
      "prompt": "a calm seaside sunrise with gentle camera dolly movement",
      "resolution": "720p",
      "duration": 8,
      "sound": false,
      "aspect_ratio": "auto",
      "camera_fixed": false,
      "seed": 123456,
      "watermark": false
    }
  }'
```

成功响应：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
```

保存 `taskId`，后续轮询结果时需要用到它。

## 轮询结果

```bash theme={null}
curl -X GET "https://api.apixo.ai/api/v1/statusTask/seedance-1-5-pro?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
```

任务处理中的响应示例：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
```

成功响应：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://file.apixo.ai/xxx.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965695412,
    "costTime": 84483
  }
}
```

任务失败时的响应示例：

```json theme={null}
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "SensitiveContent",
    "failMsg": "Content was rejected by safety checks, please adjust the prompt",
    "createTime": 1767965610929,
    "completeTime": 1767965620132,
    "costTime": 9203
  }
}
```

等 `state` 变为 `success` 后，再解析 `resultJson`：

```javascript theme={null}
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;
```

## 请求体

### 文生视频

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a clean product showcase on a neutral background, subtle lighting shifts, steady camera",
    "resolution": "720p",
    "duration": 8,
    "sound": false,
    "aspect_ratio": "auto",
    "camera_fixed": true,
    "seed": 123456,
    "watermark": false
  }
}
```

### 图生视频

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "prompt": "animate this landscape with moving clouds and soft wind",
    "image_urls": [
      "https://example.com/start-frame.jpg",
      "https://example.com/end-frame.jpg"
    ],
    "resolution": "480p",
    "duration": 4,
    "sound": true,
    "aspect_ratio": "1:1",
    "camera_fixed": false,
    "seed": 123456,
    "watermark": false
  }
}
```

### 视频扩展

```json theme={null}
{
  "request_type": "async",
  "input": {
    "mode": "video-extend",
    "prompt": "continue the same shot with a gentle smile and then a smooth ride-away",
    "video_urls": [
      "https://example.com/source.mp4"
    ],
    "resolution": "720p",
    "duration": 8,
    "sound": true,
    "camera_fixed": true,
    "seed": 123456,
    "watermark": false
  }
}
```

## 参数

**request\_type** `string` *required* (default: async)

结果获取方式。选择 `async` 时，通过 `statusTask` 轮询结果；选择 `callback` 时，通过 Webhook 接收结果。

**callback\_url** `string`

当 `request_type` 为 `callback` 时必填。请提供公网可访问的 HTTPS 地址，用于接收任务的最终结果。详见 [Webhook](https://apixo.ai/docs/zh/api-reference/webhooks.md)。

**input** `object` *required*

Seedance 1.5 Pro 的输入参数。

**属性**

**mode** `string`

生成模式。支持的值：`text-to-video`、`image-to-video`、`video-extend`。如果省略，APIXO 在存在 `image_urls` 时推断为 `image-to-video`，否则推断为 `text-to-video`。扩展源视频时需显式设置 `video-extend`。

**prompt** `string` *required*

描述所需视频或续集的文本提示。修剪后支持3-2500个字符。

**image\_urls** `string[]`

参考图像 URL。`image-to-video` 模式下必需。支持1-2个URL；当提供两个时，第一个为起始帧，第二个为结束帧。

**video\_urls** `string[]`

需要用于 [`video-extend`](#video-extend)。需传递恰好一个公开视频URL到数组中，并在`prompt`中描述其后续动作。对于`text-to-video`和[`image-to-video`](#image-to-video)场景，应省略`video_urls`。打开和关闭帧的图像需通过`image_urls`传入。

**resolution** `string` *required*

输出视频分辨率。支持的值：`480p`、`720p`、`1080p`。

**duration** `integer` *required*

视频时长（以秒为单位）。支持从 `4` 到 `12` 的整数值；后端也支持数字字符串形式。建议使用 `4`、`8` 或 `12` 以实现可预测的层级匹配。

**sound** `boolean` *required*

是否随视频生成音频。使用 `true` 表示生成音频，使用 `false` 表示生成静音视频。

**aspect\_ratio** `string` (default: 1:1)

`text-to-video` 和 `image-to-video` 的输出纵横比。支持的值：`auto`、`1:1`、`3:4`、`4:3`、`9:16`、`16:9`、`21:9`。

**camera\_fixed** `boolean`

设置为 `true` 可请求稳定的摄像机视角。对于 `video-extend` 任务，若未指定该字段，后端将默认设为 `true`。

**seed** `integer`

可选的随机种子，用于在重试和多次运行中实现更可复现的结果。

**watermark** `boolean`

支持时，是否在输出视频中保留生成水印。

**nsfw\_checker** `boolean` (default: false)

启用此请求的内容安全过滤。默认值为 `false`，若提供该参数，必须为布尔值。

> [!TIP]
>
> 为保持兼容性，仍支持旧版 `fixed_lens` 字段，但新集成应使用 `camera_fixed`。

## 响应格式

### 提交任务时的响应

任务受理后，`POST /generateTask/seedance-1-5-pro` 会返回任务 ID：

**code** `integer`

API 状态码。`200` 表示任务已受理。

**message** `string`

状态说明。

**data.taskId** `string`

任务的唯一 ID，用于查询任务状态。

### 状态响应字段

**taskId** `string`

任务的唯一标识符。

**state** `string`

当前任务状态，可能的值为 `pending`、`processing`、`success`、`failed`。

**resultJson** `string`

JSON 字符串中包含生成或扩展视频 URL 的内容。当 `state` 为 `success` 时存在。

**failCode** `string`

供程序处理的错误码，仅在 `state` 为 `failed` 时返回。

**failMsg** `string`

失败原因说明，仅在 `state` 为 `failed` 时返回。

**createTime** `integer`

任务创建时的 Unix 时间戳，单位为毫秒。

**completeTime** `integer`

任务完成时的 Unix 时间戳，单位为毫秒。任务完成后返回。

**costTime** `integer`

处理耗时，单位为毫秒。任务完成且有该数据时返回。

## Webhook 回调模式

如果希望服务端自动收到最终结果，可以使用回调模式，无需轮询。

```bash theme={null}
curl -X POST "https://api.apixo.ai/api/v1/generateTask/seedance-1-5-pro" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "request_type": "callback",
    "callback_url": "https://your-server.com/webhooks/apixo",
    "input": {
      "mode": "video-extend",
      "prompt": "continue the same scene with a smooth smile, then leave the frame naturally",
      "video_urls": [
        "https://example.com/source.mp4"
      ],
      "resolution": "720p",
      "duration": 8,
      "sound": true,
      "camera_fixed": true,
      "seed": 123456,
      "watermark": false
    }
  }'
```

当任务达到最终状态时，回调有效负载采用与状态端点相同的统一响应结构。有关交付要求及重试行为，请参阅 [Webhooks](https://apixo.ai/docs/zh/api-reference/webhooks.md)。

## 计费

新提交的非 LLM 请求按 **1 积分 = `$0.001`** 计费。先按用量和附加项目计算总额，再应用账号折扣，最后将请求总额向上取整到整数积分。如果约定了固定单价，则按该单价的原始精度计算，不再使用标准价或另行打折；最终积分仍向上取整。详见[积分换算与取整](https://apixo.ai/docs/zh/pricing.md#credit-conversion-and-rounding)。

Seedance 1.5 Pro 按秒计费。所选的 `resolution`、`duration` 和 `sound` 参数将决定所有支持模式（包括 `video-extend`）的总费用。

| 分辨率 | `sound` | 价格 |
| - | - | - |
| `480p` | `false` | `$0.011 / second` |
| `480p` | `true` | `$0.022 / second` |
| `720p` | `false` | `$0.024 / second` |
| `720p` | `true` | `$0.047 / second` |
| `1080p` | `false` | `$0.053 / second` |
| `1080p` | `true` | `$0.105 / second` |

总费用为每秒价格乘以计费时长。例如，`720p` 且 `sound: false` 持续 8 秒的费用为 `$0.192`。

最新的美元费率见 [API 价目表](https://apixo.ai/pricing/api)。

## 延迟与轮询

实际延迟可能受提示复杂度、输入媒体类型、生成模式、路由选择及当前队列负载影响。`video-extend` 需要进行源剪辑分析和最终拼接，因此耗时可能长于直接的文生视频或图生视频生成。

| 模式 | 时长 | 通常生成耗时 | 建议首次查询时间 | 轮询间隔 |
| - | - | - | - | - |
| `text-to-video`, `image-to-video` | `4`秒 | 40s-60s | 任务创建 40 秒后 | 5s-10s |
| `text-to-video`, `image-to-video` | `8`秒 | 60s-90s | 任务创建 60 秒后 | 5s-10s |
| `text-to-video`, `image-to-video` | `12`秒 | 90s-120s | 任务创建 90 秒后 | 5s-10s |
| `video-extend` | `4`秒 | 45s-75s | 任务创建 45 秒后 | 5s-10s |
| `video-extend` | `8`秒 | 60s-110s | 任务创建 60 秒后 | 5s-10s |
| `video-extend` | `12`秒 | 90s-150s | 任务创建 90 秒后 | 5s-10s |

> [!TIP]
>
> 视频生成可能需要较长时间。在生产环境中，建议使用回调模式以避免频繁轮询。

请求频率和并发上限因账号、API 密钥和路由而异。收到 `429` 时，请降低请求频率，逐步延长重试间隔。账号级限制见[系统 API](https://apixo.ai/docs/zh/api-reference/system.md)。

## 错误与排查

### HTTP 错误

| 代码 | 含义 | 处理方式 |
| - | - | - |
| `400` | 请求体无效、缺少必填字段、模式不受支持、分辨率不受支持、持续时间无效、源 URL 数组格式错误或提示/媒体被拒绝 | 在重试前修复请求 |
| `401` | 缺少 API 密钥，或密钥无效 | 检查 `Authorization` 请求头 |
| `402` | 余额或配额不足 | 充值或更换账号或API密钥 |
| `403` | 密钥或路由无权访问该模型 | 检查权限和路由策略 |
| `429` | 已达到速率或并发限制 | 按指数退避策略重试 |
| `500` | 服务器错误或未知任务失败 | 重试并退避；如果重复出现，请联系支持人员 |
| `502` | 服务错误 | 逐步延长间隔后重试 |
| `504` | 服务超时 | 重试；耗时较长的任务可改用回调模式 |

### 任务失败错误码

| 错误码 | 含义 | 处理方式 |
| - | - | - |
| `MISSING_REQUIRED_PARAM` | 缺少必填字段，例如 `prompt`、`video_urls`、`resolution`、`duration` 或 `sound` | 在重试前修复请求 |
| `INVALID_PARAMETER` | 一个或多个字段使用不受支持的值或类型 | 检查 `mode`、媒体 URL、`resolution`、`duration`、`sound`、`camera_fixed`、`seed` 和 `watermark` |
| `API_SERVICE_UNAVAILABLE` | 视频扩展处理或生成暂时不可用 | 稍后重试 |
| `PromptInvalid` | 提示被拒绝或格式错误 | 修改提示词后重试 |
| `SensitiveContent` | 提示或生成的内容违反内容安全要求 | 更改提示或参考媒体 |
| `ImageFormatIncorrect` | 无法接受参考图像。 | 使用公共 JPG、PNG 或 WebP 图像 URL |
| `RateLimited` | 请求频率达到上限 | 稍后重试并退避 |
| `Timeout` | 工作流程未及时完成 | 重试、简化提示或者使用回调方式 |
| `InsufficientBalance` | 生成服务暂时不可用 | 稍后重试或联系支持人员 |
| `Unknown error` | 任务因未知原因失败 | 重试或通过 `taskId` 联系支持人员 |

### 常见问题的验证修复

| 问题表现 | 解决办法 |
| - | - |
| `mode` 被拒绝 | 使用`text-to-video`、`image-to-video`或`video-extend` |
| 图生视频缺少 `image_urls` | 提供 1-2 个可公开访问的图像 URL |
| video-extend 缺少 `video_urls` | 将`input.mode`设置为`video-extend`并提供 exactly 1 个公共视频 URL |
| `resolution` 请求被拒绝 | 使用`480p`、`720p`或`1080p` |
| `duration` 被拒绝 | 发送从 `4` 到 `12` 的整数 |
| `sound` 被拒绝 | 发送布尔值：`true` 或 `false` |
| 提示长度错误 | 将修剪后的提示保持在 3-2500 个字符内 |

完整列表见[错误码](https://apixo.ai/docs/zh/api-reference/errors.md)。

## MCP 集成

[完整模型 Schema](https://apixo.ai/docs/models/schemas/video/seedance-1-5-pro.json) 中的 `mcp.result` 指定了结果的解析方式，`mcp.attachments` 列出支持绑定文件的字段。这些元数据供客户端集成使用，无需作为生成参数提交。附件字段为 `image_urls`, `video_urls`。请保留用户指定的文件顺序。API 负责校验模型参数。

## 相关链接

* [生成 API 概览](https://apixo.ai/docs/zh/models.md)
* [视频模型](https://apixo.ai/docs/zh/models/video)
* [提交生成任务](https://apixo.ai/docs/zh/api-reference/generate-task.md)
* [查询任务状态](https://apixo.ai/docs/zh/api-reference/status-task.md)
* [Webhook](https://apixo.ai/docs/zh/api-reference/webhooks.md)
* [错误码](https://apixo.ai/docs/zh/api-reference/errors.md)
* [参数规范](https://apixo.ai/docs/zh/api-reference/parameters.md)
* [路由策略](https://apixo.ai/docs/zh/concepts/routing-strategies.md)
* [在 APIXO Playground 尝试 Seedance 1.5 Pro](https://apixo.ai/models/seedance-1-5-pro)
* [API定价](https://apixo.ai/pricing/api)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.