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

# 列出视频

> 使用游标分页列出当前调用者的渲染、H3 视频和角色动画。

通过不透明游标分页返回当前身份拥有的视频，按 `created_at` 从新到旧排列。列表合并三种来源：通过[渲染视频](/zh/v1/api-reference/renders/create)创建的 `render_`；通过[文本](/zh/v1/api-reference/videos/create-from-text)、[首帧](/zh/v1/api-reference/videos/create-from-first-frame)、[首尾帧](/zh/v1/api-reference/videos/create-from-first-last-frame)或[参考素材](/zh/v1/api-reference/videos/create-from-reference-video)生成的 H3 `vid_`；以及[使用 Viggle-Animate](/zh/v1/api-reference/videos/create-from-character-animation)生成的 `anim_`。本接口替代已停用的 `GET /v1/renders`。

<Note>
  `GET /v1/renders` 现返回 `405 Method Not Allowed`，而不是 `404`，因为同一路径仍支持 `POST /v1/renders`。如旧集成通过 `404` 判断接口已停用，请同时处理 `405`，或直接迁移到本接口。
</Note>

## 请求参数

| 参数       | 类型      |  必填 | 默认值  | 说明                                                                     |
| -------- | ------- | :-: | ---- | ---------------------------------------------------------------------- |
| `status` | string  |  否  | —    | 精确状态筛选：`queued`、`processing`、`ready`、`failed` 或 `cancelled`。省略时包含全部状态。 |
| `cursor` | string  |  否  | —    | 上一次响应的 `next_cursor`，请原样传入，并保持分页筛选条件一致。最长 512 字符。                      |
| `limit`  | integer |  否  | `20` | 每页最多返回的视频摘要数量，范围 1–100。后续页使用 `next_cursor`，不要自行计算偏移量。                  |

## 响应参数

返回 `200 OK`。

| 字段                     | 类型             | 始终返回 | 说明                                                                                  |
| ---------------------- | -------------- | :--: | ----------------------------------------------------------------------------------- |
| `items`                | array          |   是  | 一页视频摘要，按创建时间从新到旧排列，混合 Render、H3 和角色动画三种来源。                                          |
| `items[].id`           | string         |   是  | Render 为 `render_...`，H3 为 `vid_...`，角色动画为 `anim_...`。                              |
| `items[].status`       | string         |   是  | `queued`、`processing`、`ready`、`failed` 或 `cancelled`。                               |
| `items[].stage`        | string 或 null  |   是  | 仅 Render 来源且 `status=processing` 时有值。Render 的其他状态，以及所有 H3 和角色动画条目，均为 `null`，这是预期行为。 |
| `items[].progress`     | integer 或 null |   是  | 0–100 的进度，或 `null`。                                                                 |
| `items[].created_at`   | string 或 null  |   是  | Render 精确到纳秒，H3 和角色动画精确到秒。同一秒创建的条目若直接比较字符串，可能看似乱序；列表本身顺序正确，仅显示精度不同。                 |
| `items[].completed_at` | string 或 null  |   是  | 见下方完成时间说明。                                                                          |

摘要不包含签名媒体 URL 或失败详情；完整状态请调用[获取视频](/zh/v1/api-reference/videos/get)。

```json theme={null}
{
  "items": [
    {"id":"render_a1b2c3","status":"ready","stage":null,"progress":100,"created_at":"2026-08-25T09:12:03.123456789Z","completed_at":"2026-08-25T09:13:47Z"},
    {"id":"vid_3f2a9c","status":"ready","stage":null,"progress":100,"created_at":"2026-08-24T09:12:03Z","completed_at":"2026-08-24T09:13:47Z"},
    {"id":"anim_7c1e4b","status":"ready","stage":null,"progress":100,"created_at":"2026-09-09T09:12:03Z","completed_at":"2026-09-09T09:13:47Z"}
  ],
  "next_cursor": null,
  "has_more": false
}
```

## 完成时间

Render 来源的视频在 `status` 变为 `ready` 后，`completed_at` 可能延迟约 30 秒回填，并非永久缺失。判断完成状态时应检查 `status == "ready"`，不要依赖 `completed_at` 非空。

## 示例

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://apis.viggle.ai/v1/videos?status=ready&limit=20" -H "Authorization: Bearer $VIGGLE_API_KEY"
  ```

  ```python Python theme={null}
  import os, requests
  response = requests.get("https://apis.viggle.ai/v1/videos", params={"status": "ready", "limit": 20}, headers={"Authorization": f"Bearer {os.environ['VIGGLE_API_KEY']}"})
  response.raise_for_status()
  page = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch("https://apis.viggle.ai/v1/videos?status=ready&limit=20", { headers: { Authorization: `Bearer ${process.env.VIGGLE_API_KEY}` } });
  const page = await response.json();
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest("GET", "https://apis.viggle.ai/v1/videos?status=ready&limit=20", nil)
  req.Header.Set("Authorization", "Bearer "+os.Getenv("VIGGLE_API_KEY"))
  resp, err := http.DefaultClient.Do(req)
  if err != nil { panic(err) }
  defer resp.Body.Close()
  ```
</CodeGroup>

继续分页时，将上一次响应中的 `next_cursor` 作为下一次请求的 `cursor`。当 `has_more` 为 `false` 时停止。

## 下一步

使用任意 `items[].id` 调用[获取视频](/zh/v1/api-reference/videos/get)，获取包括 `video_url` 在内的完整状态。


## OpenAPI

````yaml zh/openapi.yaml GET /v1/videos
openapi: 3.0.3
info:
  title: Viggle API
  description: 使用 AI 生成角色动画视频。
  version: 2.0.0
  contact:
    name: Viggle Support
    url: https://viggle.ai
servers:
  - url: https://apis.viggle.ai
    description: 生产服务器
security:
  - bearerAuth: []
tags:
  - name: Renders
    description: 准备输入、创建渲染、观察进度并获取结果。
  - name: Credits
    description: 查询当前调用者可用的积分余额。
  - name: Characters
    description: 创建、列出、查询和删除可复用角色。type 决定是否同时提取 3D vsplat，就绪后通过导出接口获取下载链接。
  - name: Motions
    description: 创建、列出、查询和删除可复用动作，也可从官方模板导入。type 决定是否提取或生成 3D 动画，就绪后通过导出接口获取下载链接。
  - name: Videos
    description: 生成 MiniMax H3 视频（vid_）或角色动画视频（anim_），并统一查询调用者的 H3、角色动画及角色动作渲染（render_）结果。
paths:
  /v1/videos:
    get:
      tags:
        - Videos
      summary: 列出视频
      description: 使用游标分页列出当前调用者的渲染、H3 视频和角色动画。
      operationId: listVideos
      parameters:
        - name: status
          in: query
          required: false
          description: 可选生命周期筛选。提供后仅返回当前状态与该值完全匹配的视频。
          schema:
            $ref: '#/components/schemas/ResourceStatus'
        - name: cursor
          in: query
          required: false
          description: 上一页 next_cursor 返回的不透明令牌，请原样传入，分页时保持其他筛选条件一致。
          schema:
            type: string
            minLength: 1
            maxLength: 512
        - name: limit
          in: query
          required: false
          description: 每页最多视频摘要数量，范围 1–100，默认 20。
          schema:
            type: integer
            minimum: 1
            maximum: 100
            default: 20
        - $ref: '#/components/parameters/RequestId'
        - $ref: '#/components/parameters/SourceChannel'
      responses:
        '200':
          description: 请求成功。
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoPage'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/V1Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  schemas:
    ResourceStatus:
      description: 异步资源共用的公开生命周期，枚举值与 RenderStatus 相同。
      type: string
      enum:
        - queued
        - processing
        - ready
        - failed
        - cancelled
    VideoPage:
      type: object
      additionalProperties: false
      required:
        - items
        - next_cursor
        - has_more
      properties:
        items:
          type: array
          description: 本页的视频摘要，按创建时间倒序合并当前调用者的不同视频来源。
          items:
            $ref: '#/components/schemas/VideoSummary'
        next_cursor:
          type: string
          description: 下一页的不透明游标，无后续页时为 null。作为下次 cursor 查询参数原样传入。
          nullable: true
        has_more:
          type: boolean
          description: 当前页之后是否还有下一页。
    VideoSummary:
      type: object
      description: >-
        统一视频资源的列表摘要，包含 render_、vid_ 和 anim_ 三种来源。不包含签名媒体 URL 或失败详情，完整状态请通过 GET
        /v1/videos/{video_id} 获取。stage 仅 Render 来源且 processing 时有值，其他情况为
        null。Render 创建时间精确到纳秒，其他来源精确到秒；同一秒内应比较实际时间，不要比较字符串精度。
      additionalProperties: false
      required:
        - id
        - status
        - stage
        - progress
        - created_at
        - completed_at
      properties:
        id:
          type: string
          description: Render 为 `render_...`，H3 为 `vid_...`，角色动画为 `anim_...`。
          minLength: 1
        status:
          description: '`queued`、`processing`、`ready`、`failed` 或 `cancelled`。'
          allOf:
            - $ref: '#/components/schemas/ResourceStatus'
        stage:
          type: string
          description: >-
            仅 Render 来源且 `status=processing` 时有值。Render 的其他状态，以及所有 H3 和角色动画条目，均为
            `null`，这是预期行为。
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RenderStage'
        progress:
          type: integer
          description: 0–100 的进度，或 `null`。
          nullable: true
          minimum: 0
          maximum: 100
        created_at:
          type: string
          description: Render 精确到纳秒，H3 和角色动画精确到秒。同一秒创建的条目若直接比较字符串，可能看似乱序；列表本身顺序正确，仅显示精度不同。
          nullable: true
          format: date-time
        completed_at:
          type: string
          description: 见下方完成时间说明。
          nullable: true
          format: date-time
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          description: 草稿流程的顶层错误，包含稳定错误码、说明、重试建议、关联 ID 和错误详情。
          allOf:
            - $ref: '#/components/schemas/ErrorBody'
    RenderStage:
      description: >-
        大致处理阶段。multipart 渲染使用
        analyzing、rendering、finishing，其他值来自草稿流程。未知值应按处理中处理，不要直接失败。
      type: string
      enum:
        - queued
        - preparing
        - generating
        - finalizing
        - ready
        - failed
        - cancelled
        - analyzing
        - rendering
        - finishing
    ErrorBody:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - retryable
        - request_id
        - details
        - remediation
      properties:
        code:
          description: 恢复方法
          allOf:
            - $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: 供人阅读的描述，不要解析其文本做逻辑判断。
        retryable:
          type: boolean
          description: 重试相同请求是否可能成功。
        request_id:
          type: string
          description: 用于关联 Viggle 日志与支持排查。仅当异步工作进程无法恢复原请求 ID 时为 `null`。
        details:
          type: object
          description: 补充结构化信息，可能为空。
          additionalProperties: true
        remediation:
          description: >-
            `{action, retry_after_ms}`，表示下一步操作。除非建议定时重试，否则 `retry_after_ms` 为
            `null`。
          allOf:
            - $ref: '#/components/schemas/ErrorRemediation'
    ErrorCode:
      description: 草稿渲染流程的错误码集合。资源操作将相应错误映射为 ResourceError 说明的小写下划线形式。
      type: string
      enum:
        - UNAUTHENTICATED
        - INVALID_CREDENTIAL
        - FORBIDDEN
        - INVALID_REQUEST
        - INVALID_CHARACTER
        - INVALID_MOTION
        - UNSUPPORTED_MEDIA
        - CONTENT_POLICY_VIOLATION
        - UPLOAD_REQUIRED
        - UPLOAD_MISMATCH
        - UPLOAD_EXPIRED
        - DRAFT_NOT_FOUND
        - DRAFT_ALREADY_CONSUMED
        - RENDER_NOT_FOUND
        - RENDER_NOT_CANCELLABLE
        - CHARACTER_NOT_FOUND
        - MOTION_NOT_FOUND
        - MOTION_NOT_READY
        - MOTION_TEMPLATE_NOT_FOUND
        - AVATAR_NOT_FOUND
        - ANIMATION_NOT_FOUND
        - EXTRACTION_UNAVAILABLE
        - EXTRACTION_FAILED
        - IDEMPOTENCY_KEY_REUSED
        - INSUFFICIENT_CREDITS
        - RATE_LIMITED
        - SERVICE_BUSY
        - INTERNAL_ERROR
    ErrorRemediation:
      type: object
      additionalProperties: false
      required:
        - action
        - retry_after_ms
      properties:
        action:
          type: string
          description: 建议的下一步操作，供程序或人工读取，例如稍后重试、重新上传或修正输入。
        retry_after_ms:
          type: integer
          description: 建议重试等待的毫秒数；无需定时重试时为 null。
          nullable: true
          format: int64
          minimum: 0
  parameters:
    RequestId:
      name: X-Request-Id
      in: header
      required: false
      description: 可选的调用者自定义关联 ID，最长 128 字符。服务会在响应头返回实际使用的值，便于追踪和支持排查。
      schema:
        type: string
        minLength: 1
        maxLength: 128
    SourceChannel:
      name: X-Viggle-Source
      in: header
      required: false
      description: 可选来源标签，最长 128 字符，用于识别 SDK、集成、产品入口或内部工作流。
      schema:
        type: string
        minLength: 1
        maxLength: 128
  headers:
    RequestId:
      description: 用于支持排查和追踪的稳定请求 ID。
      schema:
        type: string
  responses:
    BadRequest:
      description: 请求失败，详情见错误响应。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    V1Unauthorized:
      description: 请求失败，详情见错误响应。
      headers:
        WWW-Authenticate:
          schema:
            type: string
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Forbidden:
      description: 请求失败，详情见错误响应。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: 请求失败，详情见错误响应。
      headers:
        Retry-After:
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InternalServerError:
      description: 请求失败，详情见错误响应。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    ServiceUnavailable:
      description: 请求失败，详情见错误响应。
      headers:
        Retry-After:
          schema:
            type: integer
            minimum: 0
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API key or OAuth access token
      description: 服务端 SDK 使用项目 API 密钥，Remote MCP 使用 OAuth 访问令牌。不要在浏览器代码中暴露项目密钥。

````