# Seedance 2.0 Fast Oversea 视频生成 API 对接文档

## 概述

Seedance 2.0 Fast Oversea 视频生成接口，支持文本、图片、视频、音频等多模态输入生成视频。Fast 版本提供更快的生成速度和更优惠的价格。

**Base URL**: `https://api.apiverse.ai`（海外加速）

**版本特性**：
- ⚡ 更快的生成速度
- 💰 更优惠的价格
- 🎬 支持 480p/720p 分辨率（不支持 1080p）
- 🎨 支持多模态输入（文本、图片、视频、音频）

---

## 认证方式

所有接口均需要在请求头中携带 Token 进行认证：

```
Authorization: Bearer {YOUR_AUTH_TOKEN}
```

---

## 支持的使用场景

### 场景1：文生视频

纯文本描述生成视频，结果具有较大随机性。

```bash
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/seedance2-0-fast-oversea" \
  -H "Authorization: Bearer your_auth_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": [
      {
        "type": "text",
        "text": "写实风格，晴朗的蓝天之下，一大片白色的雏菊花田，镜头逐渐拉近，最终定格在一朵雏菊花的特写上，花瓣上有几颗晶莹的露珠"
      }
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p",
    "generateAudio": true
  }'
```

### 场景2：首帧/尾帧图片生视频

传入首帧或尾帧图片，模型基于图片内容生成视频。

```bash
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/seedance2-0-fast-oversea" \
  -H "Authorization: Bearer your_auth_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": [
      {
        "type": "text",
        "text": "女孩抱着狐狸，女孩睁开眼，温柔地看向镜头，狐狸友善地抱着，镜头缓缓拉出，女孩的头发被风吹动"
      },
      {
        "type": "image_url",
        "image_url": {
          "url": "https://example.com/fox_girl.png"
        },
        "role": "first_frame"
      }
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }'
```

### 场景3：多图参考生视频

传入多张参考图片，在提示词中通过 "图片1"、"图片2" 引用（最多9张）。

```bash
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/seedance2-0-fast-oversea" \
  -H "Authorization: Bearer your_auth_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": [
      {
        "type": "text",
        "text": "[图片1]戴着眼镜穿着蓝色T恤的男生和[图片2]的柯基小狗，坐在[图片3]的草坪上，视频卡通风格"
      },
      {
        "type": "image_url",
        "image_url": { "url": "https://example.com/boy.png" },
        "role": "reference_image"
      },
      {
        "type": "image_url",
        "image_url": { "url": "https://example.com/dog.png" },
        "role": "reference_image"
      },
      {
        "type": "image_url",
        "image_url": { "url": "https://example.com/grass.png" },
        "role": "reference_image"
      }
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }'
```

### 场景4：视频参考生视频

传入参考视频（最多3个），模型基于视频内容生成新视频。

```bash
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/seedance2-0-fast-oversea" \
  -H "Authorization: Bearer your_auth_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": [
      {
        "type": "text",
        "text": "参考视频的动作风格，生成一个女孩在海边奔跑的视频"
      },
      {
        "type": "video_url",
        "video_url": { "url": "https://example.com/reference.mp4" },
        "role": "reference_video"
      }
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }'
```

### 场景5：音频参考生视频

传入参考音频（最多3个），模型基于音频内容生成视频。

```bash
curl -X POST "https://api.apiverse.ai/api/v2/open/aigc/seedance2-0-fast-oversea" \
  -H "Authorization: Bearer your_auth_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "content": [
      {
        "type": "text",
        "text": "根据音频的节奏，生成一个舞者跳舞的视频"
      },
      {
        "type": "audio_url",
        "audio_url": { "url": "https://example.com/music.mp3" },
        "role": "reference_audio"
      }
    ],
    "ratio": "16:9",
    "duration": 5,
    "resolution": "720p"
  }'
```

---

## 接口详情

### 1. 创建视频生成任务

**接口地址**: `POST /api/v2/open/aigc/seedance2-0-fast-oversea`

**请求参数**:

| 参数名 | 类型 | 必填 | 说明 |
|--------|------|------|------|
| content | array | 是 | 内容数组，包含 text/image_url/video_url/audio_url 类型 |
| ratio | string | 否 | 宽高比，支持：16:9(默认)/9:16/1:1/4:3/3:4/21:9/adaptive |
| duration | int | 否 | 视频时长（秒），范围 4-15，默认 5 |
| resolution | string | 否 | 输出分辨率：480p/720p(默认)，**Fast版本不支持1080p** |
| generateAudio | bool | 否 | 是否生成音频，默认 true |
| webSearch | bool | 否 | 是否启用在线搜索，默认 false |
| nsfwChecker | bool | 否 | 内容过滤开关，默认 false |
| seed | int | 否 | 随机种子，用于复现结果 |
| returnLastFrame | bool | 否 | 是否返回视频尾帧图片URL |
| taskNickname | string | 否 | 任务昵称 |
| callbackUrl | string | 否 | 回调URL |

**content 数组元素结构**:

```json
{
  "type": "text|image_url|video_url|audio_url",
  "text": "提示词文本（type=text时必填）",
  "image_url": {
    "url": "图片URL"
  },
  "video_url": {
    "url": "视频URL"
  },
  "audio_url": {
    "url": "音频URL"
  },
  "role": "first_frame|last_frame|reference_image|reference_video|reference_audio"
}
```

**role 说明**:
- `first_frame`: 首帧图片（仅1张）
- `last_frame`: 尾帧图片（仅1张）
- `reference_image`: 参考图片（最多9张）
- `reference_video`: 参考视频（最多3个）
- `reference_audio`: 参考音频（最多3个）

**文件格式要求**:
- **图片**: JPEG/PNG/WebP/BMP/TIFF/GIF，单张最大 30MB
- **视频**: MP4/MOV，480p-720p，2-15秒，单个最大 50MB
- **音频**: WAV/MP3，2-15秒，单个最大 15MB

**响应示例**:

```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_1234567890",
    "status": "processing",
    "createdAt": "2024-01-01 12:00:00"
  }
}
```

---

### 2. 查询任务状态

**接口地址**: `GET /api/v2/open/aigc/{taskId}`

**响应示例**:

```json
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "task_1234567890",
    "status": "success",
    "videoUrl": "https://example.com/result.mp4",
    "lastFrameUrl": "https://example.com/last_frame.jpg",
    "createdAt": "2024-01-01 12:00:00",
    "completedAt": "2024-01-01 12:02:30",
    "completionTokens": 108000
  }
}
```

**status 状态说明**:
- `processing`: 处理中
- `success`: 成功
- `failed`: 失败

> **completionTokens 说明**：上游返回的实际 token 用量，仅在【按 token 计费】的任务结算完成后返回。按秒计费的任务、以及尚未结算完成的任务不会返回该字段。

---

## 价格说明

Seedance 2.0 Fast Oversea 采用按秒计费，价格比标准版更优惠：

| 分辨率 | 无视频输入 | 有视频输入 |
|--------|-----------|-----------|
| 480p | 约 0.044 USD/秒 | 约 0.078 USD/秒 |
| 720p | 约 0.097 USD/秒 | 约 0.172 USD/秒 |

**注意**：
- Fast 版本不支持 1080p
- 实际价格以账户配置为准
- 生成音频会增加成本

---

## 注意事项

1. **分辨率限制**: Fast 版本仅支持 480p 和 720p，不支持 1080p
2. **不支持的参数**: Fast 版本不支持 `watermark`（水印）和 `cameraFixed`（固定镜头）参数
3. **提示词长度**: 3-20,000 字符
4. **视频时长**: 4-15 秒
5. **文件数量限制**:
   - 参考图片最多 9 张
   - 参考视频最多 3 个
   - 参考音频最多 3 个
6. **首帧/尾帧**: 只能选择其中一个，不能同时使用
7. **content 数组**: 必须包含至少一个 type=text 的元素

---

## 错误码

| 错误码 | 说明 |
|--------|------|
| 200 | 成功 |
| 401 | 认证失败 |
| 402 | 余额不足 |
| 422 | 参数错误 |
| 429 | 请求过于频繁 |
| 500 | 服务器内部错误 |
| 501 | 生成失败 |

---

## 最佳实践

1. **选择合适的分辨率**: 如果对画质要求不高，建议使用 480p 以获得更快的速度和更低的成本
2. **合理使用参考素材**: 参考图片/视频/音频可以提高生成质量，但会增加处理时间
3. **提示词优化**: 清晰、具体的提示词能获得更好的效果
4. **使用回调**: 对于长时间任务，建议使用 callbackUrl 而非轮询
5. **错误处理**: 建议实现重试机制，处理网络波动和临时错误

---

## 技术支持

如有问题，请联系技术支持团队。