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

# 视频生成

> 提交 Seedance 2.0 文生视频和图生视频任务（gogogotoken.ai）

视频生成是**异步任务**。提交后立即返回 `task_id`，再通过 [任务查询](/overseas/video-tasks) 轮询结果。

<Note>
  Base URL 固定为 `https://gogogotoken.ai`。所有请求需携带 `Authorization: Bearer YOUR_API_KEY`。
</Note>

<RequestExample>
  ```bash 文生视频 theme={null}
  curl -X POST https://gogogotoken.ai/v1/video/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "doubao-seedance-2-0-fast",
      "prompt": "一只橘猫在阳光下伸懒腰，镜头缓慢推进",
      "seconds": "5",
      "metadata": { "resolution": "480p" }
    }'
  ```

  ```bash 图生视频（公网图片） theme={null}
  curl -X POST https://gogogotoken.ai/v1/video/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "doubao-seedance-2-0",
      "prompt": "镜头缓缓推进，人物自然微笑",
      "images": ["https://assets.example.com/first-frame.jpg"],
      "seconds": "5",
      "metadata": { "resolution": "720p" }
    }'
  ```

  ```bash 图生视频（素材 asset://） theme={null}
  curl -X POST https://gogogotoken.ai/v1/video/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "doubao-seedance-2-0",
      "prompt": "产品在展示台上缓慢旋转，背景简洁",
      "seconds": "5",
      "metadata": {
        "resolution": "720p",
        "content": [
          {
            "type": "image_url",
            "image_url": { "url": "asset://asset_xxx" },
            "role": "first_frame"
          }
        ]
      }
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "id": "task_1234567890",
    "task_id": "task_1234567890",
    "status": "queued",
    "model": "doubao-seedance-2-0-fast"
  }
  ```
</ResponseExample>

## 推荐模型

| 模型                         | 说明            |
| -------------------------- | ------------- |
| `doubao-seedance-2-0-fast` | 更快更省，最高 720p  |
| `doubao-seedance-2-0`      | 画质更好，支持 1080p |

按实际生成量计费，提交时预扣，完成后按真实用量结算。

## 图生视频两种方式

**方式 1 · 公网 HTTPS 图片**

在请求体中传入 `images` 数组，或使用 `metadata.content[]` 指定首帧。

**方式 2 · 已上传素材**

先通过 [素材管理](/overseas/assets) 登记图片，得到 `asset://asset_xxx`，在 `metadata.content` 中引用。

<Warning>
  `asset://` 图生要求素材与推理接入点在**同一 BytePlus 项目**。若报 `asset not found`，可先用公网 HTTPS 图片链接代替。
</Warning>

## OpenAI 兼容格式（可选）

| 操作 | 方法   | 路径                             |
| -- | ---- | ------------------------------ |
| 提交 | POST | `/v1/videos`                   |
| 查询 | GET  | `/v1/videos/{task_id}`         |
| 下载 | GET  | `/v1/videos/{task_id}/content` |

参数与 `/v1/video/generations` 相同。

## 参数说明

<ParamField body="model" type="string" required>
  视频模型 ID：`doubao-seedance-2-0` 或 `doubao-seedance-2-0-fast`。
</ParamField>

<ParamField body="prompt" type="string" required>
  视频描述文本。
</ParamField>

<ParamField body="seconds" type="string">
  时长（秒），常用 `"5"`。
</ParamField>

<ParamField body="images" type="string[]">
  图生视频时的参考图片 URL 列表（公网 HTTPS）。
</ParamField>

<ParamField body="metadata.resolution" type="string">
  分辨率：`480p`、`720p`、`1080p`。`fast` 模型请勿使用 1080p。
</ParamField>

<ParamField body="metadata.ratio" type="string">
  画幅比例，如 `9:16`、`16:9`。
</ParamField>

<ParamField body="metadata.content" type="array">
  高级图生/参考内容，可指定 `first_frame` 与 `asset://` 引用。
</ParamField>

## 下一步

提交成功后，使用返回的 `task_id` 调用 [任务查询与轮询](/overseas/video-tasks)。建议每 5–8 秒轮询一次，通常 30–120 秒出片。
