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

# 下载视频文件

> 使用 API 令牌下载已完成的 MP4，支持 Range 请求。

用于 Ark、OpenAI 视频、Vertex AI 和即梦兼容任务。Gemini API 任务使用 [Gemini 下载接口](/cn/api/video-gemini-download)。

仅在任务成功后下载。优先使用查询响应返回的地址；OpenAI 格式用创建响应的 `id` 作为 `task_id`。

## 下载示例

```bash theme={"system"}
curl --fail -L -o video.mp4 \
  "https://api.aiohub.org/v1/videos/<TASK_ID>/content" \
  -H "Authorization: Bearer <AIOHUB_API_KEY>"
```

下载请求需要创建任务所属账号的 API 令牌。文件支持 `Range` 请求，成功后保留 72 小时；过期返回 410，重新查询不会恢复文件。请在到期前保存到自己的存储。


## OpenAPI

````yaml openapi/relay.json GET /v1/videos/{task_id}/content
openapi: 3.0.1
info:
  title: AIOHub API
  description: AIOHub 公开 API
  version: 1.0.0
servers:
  - url: https://api.aiohub.org
security:
  - BearerAuth: []
tags:
  - name: 获取模型列表
  - name: OpenAI Chat
  - name: OpenAI Responses
  - name: 图片生成
  - name: OpenAI 图像
  - name: 视频生成
  - name: Claude Messages
  - name: Gemini API
  - name: OpenAI Embeddings
  - name: 文本补全
  - name: OpenAI 音频
  - name: Realtime API
paths:
  /v1/videos/{task_id}/content:
    get:
      tags:
        - 视频生成
      summary: 获取视频内容
      description: |
        获取已完成视频任务的视频文件内容。

        此接口会代理返回视频文件流。

        Seedance 任务的视频文件在成功后保留 72 小时，支持 `Range` 请求；超过保留期返回 410。
      operationId: getVideoContent
      parameters:
        - name: task_id
          in: path
          description: 视频任务 ID
          required: true
          example: video-abc123
          schema:
            type: string
      responses:
        '200':
          description: 成功获取视频内容
          content:
            video/mp4:
              schema:
                type: string
                format: binary
          headers: {}
        '404':
          description: 视频不存在或未完成
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
        '410':
          description: 已超过 72 小时保留期
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          headers: {}
      deprecated: false
      security:
        - BearerAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: 错误信息
            type:
              type: string
              description: 错误类型
            param:
              type: string
              description: 相关参数
              nullable: true
            code:
              type: string
              description: 错误代码
              nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: API key (sk-xxx)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.