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

# 获取 Seedance 视频内容

> 通过接口代理下载已完成 Seedance 视频任务的 MP4 文件

## 使用场景

当你需要在自己的服务器中代理视频下载，或不方便直接访问
`metadata.url` 中的 CDN 地址时，可使用此接口。

## 前置条件

* 任务 `status` 必须为 `completed`
* 任务未过期（参考 `expires_at` 字段）

## 响应格式

成功时返回 `video/mp4` 字节流，HTTP 状态码为 200。
客户端应将响应体直接写入文件或通过流传输给终端用户。

## 替代方案

如果只需要链接，直接读取
`GET /v1/videos/{task_id}` 响应中的 `metadata.url` 即可，
无需通过此接口下载。


## OpenAPI

````yaml /openapi/videos.zh.yaml get /v1/videos/{task_id}/content
openapi: 3.1.0
info:
  title: InfinityBlue API — 视频（Videos）
  version: 1.0.0
  summary: 统一的 AI 视频生成接口
  description: |
    视频生成类接口，采用**异步任务模型**：提交任务 → 轮询状态 → 获取结果。

    InfinityBlue 提供两套视频接口：

    - **通用视频接口** (`/v1/video/generations`)：支持 Kling、Veo 等多厂商模型，
      参数风格与 OpenAI Images API 接近，适合跨模型场景。
    - **Seedance 2.0 接口** (`/v1/videos`)：专为字节豆包 Seedance 2.0 系列优化，
      提供更丰富的 Seedance 专属参数（`seconds`、`resolution`、`ratio`、
      `generate_audio`、`camera_fixed` 等），以及首尾帧、视频参考等多模态素材支持。

    ## 典型调用流程

    1. `POST /v1/video/generations` 或 `POST /v1/videos` — 提交任务，获取 `task_id`
    2. `GET /v1/video/generations/{task_id}` 或 `GET /v1/videos/{task_id}` —
       轮询状态，直到 `status` 为 `completed` 或 `failed`
    3. 从响应的 `url` / `metadata.url` 字段或 `GET /v1/videos/{task_id}/content`
       下载视频文件

    ## 认证

    所有请求需在请求头中携带 API Key：
    ```
    Authorization: Bearer YOUR_API_KEY
    ```
  contact:
    name: InfinityBlue
    url: https://getinfinityblue.com
servers:
  - url: https://api.getinfinityblue.com
    description: 生产环境
security:
  - bearerAuth: []
tags:
  - name: 视频（Videos）
    description: |
      通用视频生成接口，支持 Kling、Veo 等多厂商模型，
      采用"提交 → 轮询 → 取结果"的异步任务模型。
  - name: Seedance 2.0
    description: |
      字节豆包 Seedance 2.0 专属视频接口，参数更丰富，
      支持首尾帧、视频参考、音频参考等多模态素材。
paths:
  /v1/videos/{task_id}/content:
    get:
      tags:
        - Seedance 2.0
      summary: 获取 Seedance 视频内容
      description: |
        获取已完成的 Seedance 视频任务的视频文件内容。
        接口代理/重定向至视频文件流，返回原始 `video/mp4` 字节流。
        仅当任务 `status=completed` 时可用，未完成时返回 404。
      operationId: getSeedanceVideoContent
      parameters:
        - name: task_id
          in: path
          description: 视频任务 ID，由创建接口返回的 `id` 字段。
          required: true
          schema:
            type: string
          example: video_abc123
      responses:
        '200':
          description: 成功获取视频内容，返回原始 MP4 字节流
          content:
            video/mp4:
              schema:
                type: string
                format: binary
                description: 视频文件的原始字节流。
        '400':
          description: 请求参数错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: API Key 无效或缺失
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: 任务不存在、尚未完成或内容已过期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: 请求频率超限
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: 服务器内部错误
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      description: 标准错误响应。
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: 错误信息。
              examples:
                - 无效的时长。支持的范围为 4 到 15 秒。
            type:
              type: string
              description: 错误类型。
              examples:
                - invalid_request_error
            param:
              type:
                - string
                - 'null'
              description: 相关参数。
              examples:
                - seconds
            code:
              type:
                - string
                - 'null'
              description: 错误代码。
              examples:
                - invalid_duration
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        使用 Bearer Token 认证，格式：`Authorization: Bearer sk-xxxxxx`。
        在 [控制台](https://api.getinfinityblue.com/console) 获取 API Key。

````