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

# 视频查询

> 查询视频生成任务的状态和结果

查询已创建的视频生成任务的当前状态、进度和结果。

## 查询视频任务

通过视频 ID 查询任务详情：

```bash theme={null}
curl "https://models.rivus.cn/v1/videos/$VIDEO_ID" \
  -H "Authorization: Bearer $TOKEN"
```

### 响应示例

任务进行中：

```json theme={null}
{
  "id": "video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737",
  "object": "video",
  "created_at": 1762789802,
  "status": "processing",
  "model": "sora-2",
  "prompt": "百事可乐宣传片",
  "progress": 45,
  "seconds": "4",
  "size": "720x1280"
}
```

任务完成：

```json theme={null}
{
  "id": "video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737",
  "object": "video",
  "created_at": 1762789802,
  "completed_at": 1762789891,
  "expires_at": 1762793491,
  "status": "completed",
  "model": "sora-2",
  "prompt": "百事可乐宣传片",
  "progress": 100,
  "seconds": "4",
  "size": "720x1280"
}
```

### 状态说明

* `queued`：任务已排队，等待处理
* `processing`：正在生成视频
* `completed`：生成完成，可下载视频
* `failed`：生成失败

### 响应字段说明

* `id`：视频任务的唯一标识符
* `created_at`：任务创建时间戳
* `completed_at`：任务完成时间戳（仅在 completed 状态下存在）
* `expires_at`：视频过期时间戳（仅在 completed 状态下存在）
* `progress`：处理进度（0-100）
* `seconds`：视频时长（字符串格式）
* `size`：视频分辨率

## 下载视频内容

直接下载生成的视频文件：

```bash theme={null}
curl -L "https://models.rivus.cn/v1/videos/$VIDEO_ID/content" \
  -H "Authorization: Bearer $TOKEN" \
  --output "$VIDEO_ID.mp4"
```


## OpenAPI

````yaml GET /v1/videos/{video_id}
openapi: 3.0.0
info:
  title: OpenAI Video API
  description: OpenAI Sora 视频生成 API
  version: 1.0.0
servers:
  - url: https://models.rivus.cn
    description: Rivus AI 生产环境
security:
  - BearerAuth: []
paths:
  /v1/videos/{video_id}:
    get:
      tags:
        - Videos
      summary: 查询视频任务
      description: 查询指定视频任务的状态和结果
      operationId: getVideo
      parameters:
        - name: video_id
          in: path
          required: true
          description: 视频任务的唯一标识符
          schema:
            type: string
          example: video_abc123
      responses:
        '200':
          description: 查询成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoObject'
              examples:
                processing:
                  summary: 处理中
                  value:
                    id: video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737
                    object: video
                    created_at: 1762789802
                    status: processing
                    model: sora-2
                    prompt: 百事可乐宣传片
                    progress: 45
                    seconds: '4'
                    size: 720x1280
                completed:
                  summary: 已完成
                  value:
                    id: video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737
                    object: video
                    created_at: 1762789802
                    completed_at: 1762789891
                    expires_at: 1762793491
                    status: completed
                    model: sora-2
                    prompt: 百事可乐宣传片
                    progress: 100
                    seconds: '4'
                    size: 720x1280
        '404':
          description: 视频任务不存在
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    VideoObject:
      type: object
      properties:
        id:
          type: string
          description: 视频任务的唯一标识符
          example: video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737
        object:
          type: string
          description: 对象类型
          enum:
            - video
          example: video
        created_at:
          type: integer
          description: 创建时间戳（Unix 时间）
          example: 1762789802
        completed_at:
          type: integer
          description: 任务完成时间戳（仅在 completed 状态下存在）
          example: 1762789891
        expires_at:
          type: integer
          description: 视频过期时间戳（仅在 completed 状态下存在）
          example: 1762793491
        model:
          type: string
          description: 使用的模型名称
          example: sora-2
        status:
          type: string
          description: 任务状态
          enum:
            - queued
            - processing
            - completed
            - failed
          example: queued
        prompt:
          type: string
          description: 生成视频的文本描述
          example: 一个无人机从海滩升空拍摄夕阳
        progress:
          type: integer
          description: 处理进度（0-100）
          minimum: 0
          maximum: 100
          example: 0
        seconds:
          type: string
          description: 视频时长（字符串格式）
          example: '10'
        size:
          type: string
          description: 视频分辨率
          example: 1280x720
        assets:
          type: array
          description: 生成的视频资源数组，仅在 completed 状态下存在（部分供应商可能不返回此字段，需通过 /content 端点下载）
          items:
            $ref: '#/components/schemas/VideoAsset'
        parent_video_id:
          type: string
          description: 父视频 ID（仅 Remix 任务返回）
          example: video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737
        error:
          type: object
          description: 错误信息，仅在 failed 状态下存在
          properties:
            code:
              type: string
              example: generation_failed
            message:
              type: string
              example: 视频生成失败，请重试
    Error:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: 错误描述
              example: Invalid request parameters
            type:
              type: string
              description: 错误类型
              example: invalid_request_error
            code:
              type: string
              description: 错误代码
              example: invalid_parameters
    VideoAsset:
      type: object
      properties:
        url:
          type: string
          description: 视频文件 URL
          example: >-
            https://cdn.example.com/video_691209aab0a08198a4e78870277f7e3d0215e09cec47a737.mp4
        quality:
          type: string
          description: 视频质量/分辨率
          example: 1280x720
        duration:
          type: integer
          description: 视频时长（秒）
          example: 10
        size_bytes:
          type: integer
          description: 文件大小（字节）
          example: 5242880
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 使用 API Key 作为 Bearer Token

````