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

# 视频生成

## 简介

视频生成接口支持文生视频、图生视频、视频生视频等多种功能。通过统一的API接口，您可以调用Sora 2、Veo、阿里万相、豆包 Seedance 等多个主流视频生成模型。

**重要提示**：视频生成是异步任务，需要先提交任务获取任务ID，然后轮询查询任务状态直到成功。

## 支持的模型及功能

| 模型系列            | 模型名称                                     | 支持功能                                                                                          |
| --------------- | ---------------------------------------- | --------------------------------------------------------------------------------------------- |
| **Sora 2**      | `sora-2`                                 | 文生视频、图生视频、视频生视频（Remix 模式）                                                                     |
| **谷歌 Veo**      | `veo-3.0-fast-generate-001`              | 文生视频（首帧模式）                                                                                    |
|                 | `veo-3.1-fast-generate-preview`          | 文生视频（首帧模式、首尾帧模式）                                                                              |
| **Gemini Omni** | `gemini-omni-flash-preview`              | 文生视频、单图图生视频（含音频），详见 [Gemini Omni Flash Preview](/cn/api-reference/endpoint/gemini-omni-flash) |
| **阿里万相**        | `wan2.5-t2v-preview`                     | 文生视频                                                                                          |
|                 | `wan2.5-i2v-preview`                     | 图生视频（首帧模式）                                                                                    |
| **豆包 Seedance** | `doubao-seedance-1-0-lite-t2v-250428`    | 文生视频                                                                                          |
|                 | `doubao-seedance-1-0-lite-i2v-250428`    | 图生视频（首帧模式、首尾帧模式、参考图模式）                                                                        |
|                 | `doubao-seedance-1-0-pro-250528`         | 文生视频（首帧模式）                                                                                    |
|                 | `doubao-seedance-1-5-pro-251215`         | 文生视频、图生视频（首帧模式、首尾帧模式），支持音频生成                                                                  |
|                 | `doubao-seedance-1-5-pro-251215-noAudio` | 文生视频、图生视频（首帧模式、首尾帧模式），不生成音频                                                                   |

**功能说明**：

* **文生视频（T2V）**：仅通过文本提示词生成视频
* **图生视频（I2V）**：基于参考图片生成视频
  * **首帧模式**：使用首帧图片作为起始画面
  * **首尾帧模式**：使用首帧和尾帧图片控制视频起止画面
  * **参考图模式**：使用参考图片作为风格参考（仅部分模型支持）
* **视频生视频（Remix）**：基于已有视频重新生成（仅 Sora 2 支持）

## 认证

<ParamField header="Authorization" type="string" required>
  Bearer Token，如 `Bearer sk-xxxxxxxxxx`
</ParamField>

## API 端点

### 提交视频任务

**POST** `/v1/video/generations`

提交视频生成任务，返回任务ID用于后续查询。

### 查询视频任务

**GET** `/v1/video/generations/{task_id}`

根据任务ID查询视频生成任务的状态和结果。

#### 路径参数

<ParamField path="task_id" type="string" required>
  视频生成任务ID，由提交任务接口返回
</ParamField>

#### 响应示例

**任务状态说明**：

| 状态            | 说明         | 建议操作   |
| ------------- | ---------- | ------ |
| `queued`      | 任务已排队，等待处理 | 继续轮询   |
| `in_progress` | 任务正在处理中    | 继续轮询   |
| `succeeded`   | 任务成功完成     | 下载视频   |
| `failed`      | 任务失败       | 查看失败原因 |

**响应示例（排队中）**：

```json theme={null}
{
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "status": "queued",
  "format": "mp4"
}
```

**响应示例（处理中）**：

```json theme={null}
{
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "status": "in_progress",
  "format": "mp4"
}
```

**响应示例（已完成）**：

```json theme={null}
{
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "status": "succeeded",
  "format": "mp4"
}
```

**响应示例（失败）**：

```json theme={null}
{
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "status": "failed",
  "format": "mp4",
  "error": {
    "code": 400,
    "message": "提示词包含不当内容"
  }
}
```

#### 使用示例

```bash theme={null}
curl -X GET "https://api.gravitex.ai/v1/video/generations/video_69095b4ce0048190893a01510c0c98b0" \
  -H "Authorization: Bearer sk-xxxxxxxxxx"
```

### 下载视频

**GET** `/v1/video/generations/download?id={videoId}`

下载已完成的视频文件（仅 Sora 2 支持）。

#### 查询参数

<ParamField query="id" type="string" required>
  视频ID，由查询任务接口返回的 task\_id
</ParamField>

#### 响应示例

```json theme={null}
{
  "success": true,
  "generation_id": "video_69095b4ce0048190893a01510c0c98b0",
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "format": "mp4",
  "size": 15728640,
  "base64": "AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAB...",
  "data_url": "data:video/mp4;base64,AAAAIGZ0eXBpc29tAAACAGlzb21pc28yYXZjMW1wNDEAAAAIZnJlZQAAB..."
}
```

**响应字段说明**：

| 字段名             | 类型      | 说明                                    |
| --------------- | ------- | ------------------------------------- |
| `success`       | boolean | 是否成功                                  |
| `generation_id` | string  | 生成ID（与 videoId 相同）                    |
| `task_id`       | string  | 任务ID                                  |
| `format`        | string  | 视频格式（固定为 `"mp4"`）                     |
| `size`          | number  | 视频文件大小（字节）                            |
| `base64`        | string  | Base64 编码的视频数据                        |
| `data_url`      | string  | Data URL 格式的视频数据，可直接用于前端 `<video>` 标签 |

#### 使用示例

```bash theme={null}
curl -X GET "https://api.gravitex.ai/v1/video/generations/download?id=video_69095b4ce0048190893a01510c0c98b0" \
  -H "Authorization: Bearer sk-xxxxxxxxxx"
```

## 提交视频任务

#### 使用示例

<Tabs>
  <Tab title="Sora 2">
    **1. 文生视频（基础示例）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "sora-2",
        "prompt": "一只可爱的小猫在花园里玩耍，阳光明媚，画面温馨",
        "seconds": "4",
        "size": "720x1280"
      }'
    ```

    **2. 文生视频（横屏，8秒）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "sora-2",
        "prompt": "一只可爱的小猫在花园里玩耍，阳光明媚，画面温馨",
        "seconds": "8",
        "size": "1280x720"
      }'
    ```

    **3. 图生视频（首帧模式）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "sora-2",
        "prompt": "一只可爱的小猫在花园里玩耍，阳光明媚，画面温馨",
        "seconds": "4",
        "size": "720x1280",
        "input_reference": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
      }'
    ```

    **4. Remix 模式（视频生视频）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "sora-2",
        "prompt": "将视频改成夜晚场景，添加星空",
        "seconds": "4",
        "size": "720x1280",
        "remix_from_video_id": "video_69095b4ce0048190893a01510c0c98b0"
      }'
    ```
  </Tab>

  <Tab title="Veo">
    **1. 文生视频（基础示例）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "veo-3.1-fast-generate-preview",
        "prompt": "科幻城市鸟瞰图，黎明时分，阳光穿透云层",
        "durationSeconds": 8,
        "aspectRatio": "16:9",
        "resolution": "1080p",
        "fps": 24,
        "generateAudio": true,
        "personGeneration": "allow_all",
        "addWatermark": false
      }'
    ```

    **2. 文生视频（竖屏，带随机种子）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "veo-3.1-fast-generate-preview",
        "prompt": "科幻城市鸟瞰图，黎明时分，阳光穿透云层",
        "durationSeconds": 6,
        "aspectRatio": "9:16",
        "resolution": "720p",
        "fps": 30,
        "generateAudio": false,
        "personGeneration": "allow_adult",
        "addWatermark": true,
        "seed": 12345,
        "sampleCount": 2
      }'
    ```

    **3. 图生视频（首帧模式）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "veo-3.1-fast-generate-preview",
        "prompt": "基于这张图片生成视频，画面逐渐展开",
        "durationSeconds": 8,
        "aspectRatio": "16:9",
        "resolution": "1080p",
        "fps": 24,
        "image": "data:image/png;base64,iVBORw0KGgoAAxxxx...",
        "generateAudio": true,
        "personGeneration": "dont_allow",
        "addWatermark": false
      }'
    ```

    **4. 图生视频（首尾帧模式，仅 veo-3.1 支持）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "veo-3.1-fast-generate-preview",
        "prompt": "从第一张图过渡到第二张图",
        "durationSeconds": 8,
        "aspectRatio": "16:9",
        "resolution": "1080p",
        "fps": 24,
        "image": "data:image/png;base64,iVBORw0KGgoAAxxxx...",
        "lastFrame": "data:image/png;base64,iVBORw0KGgoAAyyyy...",
        "generateAudio": true,
        "seed": 67890,
        "sampleCount": 1
      }'
    ```
  </Tab>

  <Tab title="阿里万相">
    **1. 文生视频（基础示例）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "wan2.5-t2v-preview",
        "prompt": "一只小猫慢慢睁开眼睛，耳朵轻轻抖动，镜头慢慢推进",
        "duration": 5,
        "size": "1280*720",
        "smart_rewrite": true,
        "generate_audio": true
      }'
    ```

    **2. 文生视频（10秒，1080p，带随机种子）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "wan2.5-t2v-preview",
        "prompt": "一只小猫慢慢睁开眼睛，耳朵轻轻抖动，镜头慢慢推进",
        "duration": 10,
        "size": "1920*1080",
        "smart_rewrite": false,
        "generate_audio": false,
        "seed": 123456
      }'
    ```

    **3. 图生视频（首帧模式）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "wan2.5-i2v-preview",
        "prompt": "小猫慢慢睁开眼睛，耳朵轻轻抖动，镜头慢慢推进",
        "duration": 5,
        "resolution": "720p",
        "smart_rewrite": true,
        "generate_audio": true,
        "image": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
      }'
    ```

    **4. 图生视频（带自定义音频）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "wan2.5-i2v-preview",
        "prompt": "小猫慢慢睁开眼睛，耳朵轻轻抖动，镜头慢慢推进",
        "duration": 10,
        "resolution": "1080p",
        "smart_rewrite": false,
        "generate_audio": false,
        "audio_url": "https://example.com/audio.mp3",
        "image": "data:image/png;base64,iVBORw0KGgoAAxxxx...",
        "seed": 789012
      }'
    ```
  </Tab>

  <Tab title="豆包 Seedance">
    **1. 文生视频（T2V，基础示例）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-0-lite-t2v-250428",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "一只小猫在花园里玩耍，阳光明媚 --ratio 16:9 --dur 5 --rs 720p --wm false"
            }
          ]
        }
      }'
    ```

    **2. 文生视频（T2V，完整参数）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-0-lite-t2v-250428",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "一只小猫在花园里玩耍，阳光明媚 --ratio 9:16 --dur 10 --rs 1080p --fps 30 --wm true --seed 12345"
            }
          ]
        }
      }'
    ```

    **3. 图生视频（首帧模式）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-0-lite-i2v-250428",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "女孩睁开眼睛，温柔地看着镜头 --ratio adaptive --dur 5 --rs 720p --wm false"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
              }
            }
          ]
        }
      }'
    ```

    **4. 图生视频（首尾帧模式，仅 lite-i2v 支持）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-0-lite-i2v-250428",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "一只蓝绿色的精卫鸟变成人形 --rs 720p --dur 5 --fps 24 --cf false --wm false --seed 67890"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
              },
              "role": "first_frame"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
              },
              "role": "last_frame"
            }
          ]
        }
      }'
    ```

    **5. 图生视频（参考图模式，仅 lite-i2v 支持）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-0-lite-i2v-250428",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "[图1] 戴眼镜穿蓝色T恤的男孩和 [图2] 柯基狗，坐在 [图3] 草坪上，3D卡通风格 --rs 720p --dur 5 --ratio 16:9 --wm false"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/ref1.png"
              },
              "role": "reference_image"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/ref2.png"
              },
              "role": "reference_image"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "https://example.com/ref3.png"
              },
              "role": "reference_image"
            }
          ]
        }
      }'
    ```

    **6. Pro 模型（首帧模式）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-0-pro-250528",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "女孩睁开眼睛，温柔地看着镜头 --ratio 16:9 --dur 5 --rs 1080p --wm false"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
              }
            }
          ]
        }
      }'
    ```

    **7. Seedance 1.5 Pro 文生视频（带音频）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-5-pro-251215",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "一只可爱的小猫在花园里追逐蝴蝶，春天的阳光洒在花朵上 --ratio 16:9 --dur 6 --rs 720p --wm false"
            }
          ]
        }
      }'
    ```

    **8. Seedance 1.5 Pro 图生视频（首帧模式，不带音频）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-5-pro-251215-noAudio",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "画面逐渐动起来，人物微笑看向镜头 --ratio 16:9 --dur 5 --rs 720p --wm false"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
              }
            }
          ]
        }
      }'
    ```

    **9. Seedance 1.5 Pro 图生视频（首尾帧模式，带音频）**

    ```bash theme={null}
    curl -X POST "https://api.gravitex.ai/v1/video/generations" \
      -H "Authorization: Bearer sk-xxxxxxxxxx" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "doubao-seedance-1-5-pro-251215",
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "从静态画面过渡到动态场景 --ratio 16:9 --dur 8 --rs 720p --wm false"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
              },
              "role": "first_frame"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
              },
              "role": "last_frame"
            }
          ]
        }
      }'
    ```
  </Tab>
</Tabs>

#### 响应示例

```json theme={null}
{
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "status": "submitted",
  "format": "mp4"
}
```

### 请求参数

<ParamField body="model" type="string" required>
  模型标识，支持的模型及功能如下：

  **Sora 2 系列**：

  * `sora-2` - 支持文生视频、图生视频、视频生视频（Remix 模式）

  **谷歌 Veo 系列**：

  * `veo-3.0-fast-generate-001` - 文生视频（首帧模式）
  * `veo-3.1-fast-generate-preview` - 文生视频（首帧模式、首尾帧模式）

  **阿里万相系列**：

  * `wan2.5-t2v-preview` - 文生视频
  * `wan2.5-i2v-preview` - 图生视频（首帧模式）

  **豆包 Seedance 系列**：

  * `doubao-seedance-1-0-lite-t2v-250428` - 文生视频1111
  * `doubao-seedance-1-0-lite-i2v-250428` - 图生视频（首帧模式、首尾帧模式、参考图模式）
  * `doubao-seedance-1-0-pro-250528` - 文生视频（首帧模式）
  * `doubao-seedance-1-5-pro-251215` - 文生视频、图生视频（首帧模式、首尾帧模式），支持音频生成
  * `doubao-seedance-1-5-pro-251215-noAudio` - 文生视频、图生视频（首帧模式、首尾帧模式），不生成音频
</ParamField>

<ParamField body="prompt" type="string">
  视频生成提示词，描述画面动作和场景。**注意**：豆包 Seedance 系列模型不需要此字段，提示词直接写在 `metadata.content` 数组的 `text` 字段中
</ParamField>

<ParamField body="image" type="string">
  图生视频时的参考图片（支持 Base64 或 URL 格式）
</ParamField>

<ParamField body="duration" type="integer" default="5">
  视频时长（秒），不同模型支持不同时长
</ParamField>

<ParamField body="resolution" type="string" default="720p">
  视频分辨率：`480p`、`720p`、`1080p`、`4k`
</ParamField>

<ParamField body="aspect_ratio" type="string" default="16:9">
  宽高比：`16:9`、`9:16`、`1:1`、`4:3`、`3:4`、`21:9`、`adaptive`（自适应，仅部分模型支持）
</ParamField>

## 模型专用参数

不同模型支持不同的专用参数，以下按模型系列分类说明：

<Tabs>
  <Tab title="Sora 2">
    <ParamField body="seconds" type="string|integer" default="4">
      视频时长（秒），支持：`4`、`8`、`12`
    </ParamField>

    <ParamField body="size" type="string" default="720x1280">
      视频分辨率，支持：`720x1280`（竖屏）、`1280x720`（横屏）
    </ParamField>

    <ParamField body="input_reference" type="string">
      参考图片（支持 URL 或 Base64 格式），用于图生视频
    </ParamField>

    <ParamField body="remix_from_video_id" type="string">
      Remix 模式：基于已有视频ID重新生成（必须以 `video_` 开头）
    </ParamField>
  </Tab>

  <Tab title="Veo">
    <ParamField body="durationSeconds" type="integer" default="4">
      视频时长（秒），支持：`4`、`6`、`8`
    </ParamField>

    <ParamField body="aspectRatio" type="string" default="16:9">
      宽高比，仅支持：`16:9`、`9:16`
    </ParamField>

    <ParamField body="resolution" type="string" default="1080p">
      分辨率，支持：`720p`、`1080p`
    </ParamField>

    <ParamField body="fps" type="integer" default="24">
      帧率，默认 24
    </ParamField>

    <ParamField body="image" type="string">
      首帧参考图（支持 URL 或 Base64 格式）
    </ParamField>

    <ParamField body="lastFrame" type="string">
      尾帧参考图（支持 URL 或 Base64 格式），仅 `veo-3.1` 系列支持
    </ParamField>

    <ParamField body="generateAudio" type="boolean" default="false">
      是否生成同步音频。快速版模型会忽略该参数并始终包含音频
    </ParamField>

    <ParamField body="personGeneration" type="string" default="allow_all">
      人像生成策略：`allow_all`（所有年龄）、`allow_adult`（成年人）、`dont_allow`（禁止人像）
    </ParamField>

    <ParamField body="addWatermark" type="boolean" default="false">
      是否添加水印
    </ParamField>

    <ParamField body="seed" type="integer">
      随机种子，用于复现结果
    </ParamField>

    <ParamField body="sampleCount" type="integer" default="1">
      每次生成的视频数量，范围：`1-4`
    </ParamField>
  </Tab>

  <Tab title="阿里万相">
    <ParamField body="duration" type="integer" default="5">
      视频时长（秒），支持：`5`、`10`
    </ParamField>

    <ParamField body="resolution" type="string" default="720p">
      视频分辨率，支持：`480p`、`720p`、`1080p`
    </ParamField>

    <ParamField body="size" type="string">
      视频尺寸（仅 t2v 模式），格式：`宽度*高度`，如 `1280*720`
    </ParamField>

    <ParamField body="smart_rewrite" type="boolean" default="false">
      是否启用智能提示词扩写
    </ParamField>

    <ParamField body="generate_audio" type="boolean" default="false">
      是否生成与画面同步的音频
    </ParamField>

    <ParamField body="audio_url" type="string">
      自定义音频文件URL（HTTPS格式）
    </ParamField>

    <ParamField body="seed" type="integer">
      随机种子，范围：`0-2147483647`
    </ParamField>
  </Tab>

  <Tab title="豆包 Seedance">
    <ParamField body="metadata.content" type="array" required>
      内容数组，必须放在 `metadata` 对象中。必须包含文本和可选的图片。参数通过文本提示词中的特殊标记控制：

      * `--rs` 或 `--resolution`：分辨率（`480p`、`720p`、`1080p`）
      * `--ratio`：宽高比（`16:9`、`9:16`、`1:1`、`4:3`、`3:4`、`adaptive`，注意 `doubao-seedance-1-0-lite-t2v-250428` 不支持 `adaptive`）
      * `--dur` 或 `--duration`：时长（秒，如 `5`、`10`）
      * `--fps` 或 `--framespersecond`：帧率（如 `24`、`30`）
      * `--seed`：随机种子
      * `--wm` 或 `--watermark`：水印开关（`true`、`false`）
      * `--cf` 或 `--camerafixed`：固定摄像头（`true`、`false`，仅 lite 模型支持）

      **模型特性说明**：

      * **1.0 lite/pro 系列**：`doubao-seedance-1-0-lite-t2v-250428`、`doubao-seedance-1-0-lite-i2v-250428`、`doubao-seedance-1-0-pro-250528`
        * 支持基础视频生成功能
        * lite-i2v 支持首尾帧模式和参考图模式
        * pro 模型支持高分辨率（720p/1080p）
      * **1.5 pro 系列**：`doubao-seedance-1-5-pro-251215`、`doubao-seedance-1-5-pro-251215-noAudio`
        * **1.5-pro**：支持文生视频和图生视频（首帧模式、首尾帧模式），**自动生成匹配的音频**
        * **1.5-pro-noAudio**：与 1.5-pro 功能相同，但**不生成音频**，视频渲染更快
        * **分辨率支持**：仅支持 `480p` 和 `720p`（不支持 1080p）
        * **时长支持**：4-12 秒之间的任意整数（如 4、5、6、7、8、9、10、11、12）
        * **图生视频模式**：支持首帧模式和首尾帧模式（不支持参考图模式）

      **metadata.content 数组格式**：

      ```json theme={null}
      {
        "metadata": {
          "content": [
            {
              "type": "text",
              "text": "提示词内容 --ratio 16:9 --dur 5 --rs 720p --wm false"
            },
            {
              "type": "image_url",
              "image_url": {
                "url": "data:image/png;base64,..."
              },
              "role": "first_frame"  // 可选：first_frame、last_frame、reference_image
            }
          ],
          "return_last_frame": true,  // 是否返回最后一帧（1.5 Pro 系列）
          "callback_url": "https://your-domain.com/callback"  // 可选的回调 URL
        }
      }
      ```
    </ParamField>
  </Tab>
</Tabs>

## 完整示例

### 豆包 Seedance 系列

豆包 Seedance 系列模型使用特殊的参数传递方式：**所有参数通过提示词中的特殊标记传递**，图片通过 `metadata.content` 数组传递。

#### 1. 文生视频（T2V）

```bash theme={null}
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1-0-lite-t2v-250428",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "一只小猫在花园里玩耍，阳光明媚 --ratio 16:9 --dur 5 --rs 720p --wm false"
        }
      ]
    }
  }'
```

#### 2. 图生视频 - 首帧模式

```bash theme={null}
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1-0-lite-i2v-250428",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "女孩睁开眼睛，温柔地看着镜头 --ratio adaptive --dur 5 --rs 720p --wm false"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
          }
        }
      ]
    }
  }'
```

#### 3. 图生视频 - 首尾帧模式（仅 lite-i2v 支持）

```bash theme={null}
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1-0-lite-i2v-250428",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "一只蓝绿色的精卫鸟变成人形 --rs 720p --dur 5 --cf false"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
          },
          "role": "first_frame"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
          },
          "role": "last_frame"
        }
      ]
    }
  }'
```

#### 4. 图生视频 - 参考图模式（仅 lite-i2v 支持）

```bash theme={null}
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1-0-lite-i2v-250428",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "[图1] 戴眼镜穿蓝色T恤的男孩和 [图2] 柯基狗，坐在 [图3] 草坪上，3D卡通风格 --rs 720p --dur 5"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/ref1.png"
          },
          "role": "reference_image"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/ref2.png"
          },
          "role": "reference_image"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "https://example.com/ref3.png"
          },
          "role": "reference_image"
        }
      ]
    }
  }'
```

#### 5. Seedance 1.5 Pro 文生视频（带音频）

```bash theme={null}
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1-5-pro-251215",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "海边日落，海鸥飞过，波浪拍打岸边，镜头缓缓推进 --ratio 16:9 --dur 8 --rs 720p --fps 30 --wm false"
        }
      ]
    }
  }'
```

#### 6. Seedance 1.5 Pro 图生视频 - 首帧模式（不带音频）

```bash theme={null}
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1-5-pro-251215-noAudio",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "照片中的人物开始微笑，眼神望向远方 --ratio 16:9 --dur 10 --rs 480p --wm false"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
          }
        }
      ]
    }
  }'
```

#### 7. Seedance 1.5 Pro 图生视频 - 首尾帧模式（带音频）

```bash theme={null}
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "doubao-seedance-1-5-pro-251215",
    "metadata": {
      "content": [
        {
          "type": "text",
          "text": "场景从白天平滑过渡到夜晚，灯光逐渐亮起 --ratio 16:9 --dur 12 --rs 720p --fps 24 --wm false"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,iVBORw0KGgoAAxxxx..."
          },
          "role": "first_frame"
        },
        {
          "type": "image_url",
          "image_url": {
            "url": "data:image/png;base64,iVBORw0KGgoAAyyyy..."
          },
          "role": "last_frame"
        }
      ]
    }
  }'
```

**重要提示**：

* `content` 数组必须放在 `metadata` 对象中
* 所有参数通过提示词中的特殊标记传递（如 `--ratio 16:9`）
* 图片必须放在 `content` 数组中，使用 `image_url` 类型
* 首尾帧模式需要两张图片，分别标记 `role: "first_frame"` 和 `role: "last_frame"`
* 参考图模式需要在提示词中使用 `[图1]`、`[图2]` 等标记引用图片，图片标记 `role: "reference_image"`
* `doubao-seedance-1-0-lite-t2v-250428` 不支持图片输入和 `adaptive` 宽高比
* `doubao-seedance-1-0-pro-250528` 仅支持首帧模式
* **`doubao-seedance-1-5-pro-251215` 自动生成音频**，适合需要配乐的场景
* **`doubao-seedance-1-5-pro-251215-noAudio` 不生成音频**，渲染速度更快，适合需要后期配音的场景
* **1.5 pro 系列**支持文生视频和图生视频（首帧模式、首尾帧模式），不支持参考图模式
* **1.5 pro 系列分辨率限制**：仅支持 `480p` 和 `720p`（不支持 1080p）
* **1.5 pro 系列时长范围**：支持 4-12 秒之间的任意整数秒数
* **首尾帧模式**：需要提供两张图片，分别标记 `role: "first_frame"` 和 `role: "last_frame"`

## 最佳实践
