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

# Seedance 2.0 Token 计费

> 使用 doubao-seedance-2-0 系列模型提交并查询按 token 计费的视频任务

使用 `doubao-seedance-2-0` 或 `doubao-seedance-2-0-fast` 提交视频生成任务。接口兼容 OpenAI Video API 格式，按输出 token 据实计费，任务完成后自动差额结算。

<RequestExample>
  ```bash 文生视频 1080p theme={null}
  curl -X POST https://gogogotoken.com/v1/video/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "doubao-seedance-2-0",
      "prompt": "a premium smartwatch rotating on a clean studio pedestal, soft product lighting, slow camera push-in",
      "seconds": "5",
      "size": "1080x1920"
    }'
  ```

  ```bash 首帧图生视频 720p theme={null}
  curl -X POST https://gogogotoken.com/v1/video/generations \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "doubao-seedance-2-0-fast",
      "prompt": "turn the product image into a polished product showcase video with slow camera movement",
      "seconds": "5",
      "size": "720x1280",
      "first_frame_image": "data:image/png;base64,<BASE64_IMAGE>"
    }'
  ```
</RequestExample>

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

  ```json completed theme={null}
  {
    "id": "task_1234567890",
    "object": "video",
    "model": "doubao-seedance-2-0",
    "status": "completed",
    "progress": 100,
    "output": {
      "video_url": "https://assets.example.com/generated-video.mp4"
    },
    "usage": {
      "total_tokens": 108900,
      "completion_tokens": 108900
    }
  }
  ```
</ResponseExample>

## 查询任务状态

```bash theme={null}
curl https://gogogotoken.com/v1/video/generations/task_1234567890 \
  -H "Authorization: Bearer YOUR_API_KEY"
```

<Note>
  任务 `status` 变为 `"completed"` 后，系统会根据 `usage.completion_tokens` 和模型当时的分辨率/输入类型自动重算费用。可在控制台日志中查看实际扣费明细。
</Note>

## 参数说明

<ParamField body="model" type="string" required default="doubao-seedance-2-0">
  `doubao-seedance-2-0` 或 `doubao-seedance-2-0-fast`。
</ParamField>

<ParamField body="prompt" type="string" required default="a premium smartwatch rotating on a clean studio pedestal, soft product lighting, slow camera push-in">
  提示词，支持中英文。
</ParamField>

<ParamField body="seconds" type="string" default="5">
  视频时长，传字符串如 `"5"`。
</ParamField>

<ParamField body="size" type="string" default="1080x1920">
  分辨率/宽高比，如 `1080x1920`、`720x1280`、`480x854`。
</ParamField>

<ParamField body="metadata.resolution" type="string">
  输出分辨率，优先级高于 `size`。
</ParamField>

<ParamField body="first_frame_image" type="string">
  首帧图片 Base64。
</ParamField>

<ParamField body="last_frame_image" type="string">
  尾帧图片 Base64。
</ParamField>

## 响应体

<ResponseField name="id" type="string">
  视频任务 ID。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态。
</ResponseField>

<ResponseField name="usage.completion_tokens" type="integer">
  模型服务返回的真实输出 token 数，用于任务完成后的差额结算。
</ResponseField>
