> ## 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.

# 查询视频

> 接受用当前调用的 API 密钥创建的 Render ID（`render_` 前缀）、H3 生成 ID（`vid_` 前缀）、Remake 生成 ID（`anim_`）或超分 ID（`vsr_`），返回其完整的当前状态。此接口替代已下线的 `GET /v1/renders/{render_id}`。

结果文件在任务结束 24 小时后删除；此后该视频仍显示为 `ready`，但 `video_url` 和 `alpha_url` 为 null。




## OpenAPI

````yaml zh/openapi.yaml GET /v1/videos/{video_id}
openapi: 3.0.3
info:
  title: Viggle API
  description: >
    Viggle API 可生成 AI 视频（Viggle H3、Viggle Remake、Video Remix）、图片（Viggle Image）、2
    倍视频超分（FlashVSR），以及 JST-2 3D 角色、动作和场景。所有任务都是异步的：先创建，再轮询（渲染任务也可监听进度），直到任务进入终态。


    基础 URL：`https://apis.viggle.ai`。每个请求都需通过 `Authorization: Bearer <API key>`
    认证。用量按积分计费（1 积分 = $0.01）。指南与价格：https://docs.viggle.ai/zh/v1/introduction
  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: >-
      Video Remix（JST-1）。准备输入、创建渲染任务、监听进度、取消以及下载结果。渲染任务的状态通过 `GET
      /v1/videos/{video_id}` 读取。
  - name: Credits
    description: 读取调用方 API 密钥可用的积分余额。
  - name: Characters
    description: |
      创建、列出、查看和删除可复用的角色资产。`type` 决定创建时是否同时提取 3D vsplat；就绪后需单独导出其下载链接。
  - name: Motions
    description: |
      创建、列出、查看和删除可复用的动作资产，也可从官方动作模板导入。`type` 决定创建时是否同时提取或生成 3D 动画；就绪后需单独导出其下载链接。
  - name: Videos
    description: >
      从文本、帧或参考素材生成 Viggle H3 视频（`vid_` 前缀），或从驱动视频和角色图生成 Viggle Remake 视频（`anim_`
      前缀）；用 FlashVSR 将视频超分 2 倍（`vsr_` 前缀）；并以统一视图读取调用方 API 密钥创建的所有视频——H3
      生成、Remake 生成以及 Video Remix 渲染任务（`render_` 前缀）——合并为同一种资源。
  - name: Images
    description: |
      Viggle Image——根据文本提示词生成 1–6 张 PNG 图片，可选用最多 8 张参考图引导（`img_` 前缀），并可按 ID 获取。
  - name: Scenes
    description: >
      场景模型——从文本提示词或 360° 全景图构建 3D
      高斯泼溅场景（`.spz`），生成新的指定位姿视角，并基于这些视角重建场景。每个操作都是一个异步任务（`scn_` 前缀），按 ID
      读取结果。每次运行按每个视角 1 积分计费，一张全景图计为 6 个视角。除非任务以 `ready` 结束，否则积分全额退款。
paths:
  /v1/videos/{video_id}:
    parameters:
      - $ref: '#/components/parameters/VideoId'
      - $ref: '#/components/parameters/RequestId'
    get:
      tags:
        - Videos
      summary: 获取视频
      description: >
        接受用当前调用的 API 密钥创建的 Render ID（`render_` 前缀）、H3 生成 ID（`vid_` 前缀）、Remake 生成
        ID（`anim_`）或超分 ID（`vsr_`），返回其完整的当前状态。此接口替代已下线的 `GET
        /v1/renders/{render_id}`。


        结果文件在任务结束 24 小时后删除；此后该视频仍显示为 `ready`，但 `video_url` 和 `alpha_url` 为 null。
      operationId: getVideo
      responses:
        '200':
          description: 视频当前状态。
          headers:
            X-Request-Id:
              $ref: '#/components/headers/RequestId'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video'
        '401':
          $ref: '#/components/responses/V1Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
components:
  parameters:
    VideoId:
      name: video_id
      in: path
      required: true
      description: >-
        调用方拥有的公开视频 ID，可以是 Render（`render_` 前缀）、H3 生成任务（`vid_`）、Remake
        生成任务（`anim_`）或超分任务（`vsr_`）。
      schema:
        type: string
        minLength: 1
      example: render_job_3f9a2c71b5e04d18
    RequestId:
      name: X-Request-Id
      in: header
      required: false
      description: 可选，调用方提供的关联 ID，会原样回显在响应头中。不传则由服务生成。用于链路追踪和技术支持。
      schema:
        type: string
        minLength: 1
  headers:
    RequestId:
      description: 用于技术支持和链路追踪的稳定请求标识。
      schema:
        type: string
  schemas:
    Video:
      description: >
        统一的只读完整状态资源，涵盖已完成的角色+动作渲染任务（`render_` 前缀）、Viggle H3 视频生成（`vid_` 前缀）或
        Remake 生成（`anim_` 前缀）。不包含 `links` 字段。


        `stage` 仅在视频来自渲染任务且 `status` 为 `processing` 时填充；其他情况下均为 null，包括所有 H3 和
        Remake 视频。`alpha_url` 仅在来自渲染任务、以 `background_mode=transparent` 创建且已
        `ready` 的视频上填充；其他情况下始终为 null。`seed` 仅适用于 H3——只在源自 H3 的视频上出现；来自渲染任务或
        Remake 的视频上不会出现（不是“存在但为 null”，而是响应中根本没有该字段）。
      type: object
      additionalProperties: false
      required:
        - id
        - status
        - stage
        - progress
        - video_url
        - alpha_url
        - created_at
        - completed_at
        - error
      properties:
        id:
          type: string
          description: 公开视频 ID——渲染任务（`render_` 前缀）、H3 生成（`vid_` 前缀）或 Remake 生成（`anim_` 前缀）。
          minLength: 1
        status:
          description: 整体生命周期。`ready`、`failed` 和 `cancelled` 为终态。
          allOf:
            - $ref: '#/components/schemas/ResourceStatus'
        stage:
          type: string
          description: >-
            粗粒度流水线阶段，仅适用于渲染任务。除来自渲染任务的视频 `status` 为 `processing` 时外，均为 null；H3
            视频始终为 null。
          nullable: true
          allOf:
            - $ref: '#/components/schemas/RenderStage'
        progress:
          type: integer
          description: >-
            对于渲染任务（`render_`），为尽力估算的百分比，范围 0 到 100，流水线上报进度前为 `0`。对于
            H3（`vid_`）、Remake（`anim_`）和超分（`vsr_`）视频，在视频变为 `ready` 前为 null，之后为
            `100`，中间没有其他值；H3 和 Remake 请改为关注 `queue_position` 和
            `estimated_wait_seconds`。
          nullable: true
          minimum: 0
          maximum: 100
        video_url:
          type: string
          description: >-
            已完成视频的 URL；就绪前、未产生输出时，或结果文件在任务结束 24 小时后被删除后，为 null。H3、Remake
            和超分视频为有效期 1 小时的签名链接，每次读取都会重新签名；渲染任务为 CDN URL。
          nullable: true
          format: uri
        alpha_url:
          type: string
          description: >-
            仅适用于渲染任务的透明背景输出 alpha/遮罩视频 URL；所有 H3 视频以及未以
            `background_mode=transparent` 创建的渲染任务均为 null。
          nullable: true
          format: uri
        created_at:
          type: string
          description: 创建时间戳。来自渲染任务的视频精度为纳秒；H3 视频精度为秒。
          nullable: true
          format: date-time
        completed_at:
          type: string
          description: >
            进入终态的时间戳；视频仍在进行中时为 null。对于来自渲染任务的视频，该字段可能比 `status` 变为 `ready` 滞后约
            30 秒才回填——请根据 `status`（或检查 `video_url`）判断是否完成，而不是根据该字段是否存在。
          nullable: true
          format: date-time
        error:
          type: object
          description: '`status` 为 `failed` 时的结构化失败详情；否则为 null。'
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ErrorBody'
        seed:
          type: integer
          format: int64
          description: >-
            仅适用于 H3——只在源自 H3 的视频上出现，来自渲染任务、Remake 和超分的视频上不存在（而非
            null）。生成实际使用的种子——调用方提供的值原样返回，或在 `POST /v1/videos` 未提供时生成的值。生成的种子是 63
            位随机整数（0 到 2^63−1），通常超过 2^53 − 1——请使用支持 64 位整数的 JSON
            解码器解析该字段；JavaScript 的 `JSON.parse` 会静默对其取整。
        queue_position:
          type: integer
          nullable: true
          minimum: 0
          description: >-
            H3（`vid_`）和 Remake（`anim_`）视频上存在。视频排队期间，排在它之前的任务的确切数量。开始处理后及终态时为
            `null`；来自渲染任务和超分的视频上完全不存在该字段。
        estimated_wait_seconds:
          type: integer
          nullable: true
          minimum: 0
          description: >-
            H3（`vid_`）和
            Remake（`anim_`）视频上存在。预计剩余等待秒数，基于全集群的平均渲染时长以及当前排队/调度状态——排队时为预计完成前的等待时间；处理中时为剩余的平均渲染时间。终态时或无法给出有界估计时为
            `null`；来自渲染任务和超分的视频上完全不存在该字段。
    ResourceStatus:
      description: |
        所有异步资源共用的公开生命周期。取值与 `RenderStatus` 相同。
      type: string
      enum:
        - queued
        - processing
        - ready
        - failed
        - cancelled
    RenderStage:
      description: |
        粗粒度的进度提示，仅在渲染任务处于 `processing` 时设置。遇到无法识别的值时，应视为“进行中”而不是报错。
      type: string
      enum:
        - analyzing
        - rendering
        - finishing
    ErrorBody:
      type: object
      additionalProperties: false
      required:
        - code
        - message
        - retryable
        - request_id
        - details
        - remediation
      properties:
        code:
          description: 稳定的机器可读错误代码。请据此进行程序化处理，而不要解析 `message`。
          allOf:
            - $ref: '#/components/schemas/ErrorCode'
        message:
          type: string
          description: 人类可读的说明，适合写入日志或展示给开发者。
        retryable:
          type: boolean
          description: 不修改输入直接重试该操作是否可能成功。HTTP 408、429 和 5xx 响应为 true。
        request_id:
          type: string
          description: 用于追踪和技术支持的关联标识符。报告失败时请附上。
        details:
          type: object
          description: 特定于该错误的结构化上下文；可用的键取决于 `code`。
          additionalProperties: true
        remediation:
          description: 建议的恢复操作及可选的重试延迟。
          allOf:
            - $ref: '#/components/schemas/ErrorRemediation'
    ErrorResponse:
      type: object
      additionalProperties: false
      required:
        - error
      properties:
        error:
          description: 错误负载，包含稳定的错误代码、消息、重试建议、关联 ID 以及特定于该错误的详情。
          allOf:
            - $ref: '#/components/schemas/ErrorBody'
    ErrorCode:
      description: >
        API 返回的错误代码，出现在同步错误信封以及失败任务的 `error` 对象中。客户端应能容忍此处未列出的代码。没有公开映射的异步失败会以
        `PROCESSING_FAILED` 呈现。
      type: string
      enum:
        - INVALID_REQUEST
        - UNAUTHENTICATED
        - INVALID_CREDENTIAL
        - INSUFFICIENT_CREDITS
        - RENDER_NOT_FOUND
        - CHARACTER_NOT_FOUND
        - MOTION_NOT_FOUND
        - DRAFT_NOT_FOUND
        - NOT_FOUND
        - RESULT_EXPIRED
        - IDEMPOTENCY_KEY_REUSED
        - ID_ALREADY_EXISTS
        - UPLOAD_TIMEOUT
        - CONTENT_POLICY_VIOLATION
        - RATE_LIMITED
        - SERVICE_BUSY
        - INTERNAL_ERROR
        - IMAGE_REQUIRED
        - MOTION_VIDEO_REQUIRED
        - UNSUPPORTED_MEDIA
        - VIDEO_TOO_LONG
        - VIDEO_TOO_LARGE
        - VIDEO_RESOLUTION_TOO_HIGH
        - VIDEO_UNREADABLE
        - VIDEO_DIMENSIONS_MUST_BE_EVEN
        - VIDEO_INACCESSIBLE
        - NO_HUMANS_DETECTED
        - MOTION_NOT_READY
        - MOTION_MODEL_MISMATCH
        - INVALID_BACKGROUND_MODE
        - ALL_WORKERS_BUSY
        - WORKER_STOPPED
        - TASK_FAILED
        - PROCESSING_FAILED
    ErrorRemediation:
      type: object
      additionalProperties: false
      required:
        - action
        - retry_after_ms
      properties:
        action:
          type: string
          enum:
            - none
            - retry
          description: 建议的下一步操作。同步错误始终为 `none`；失败任务的 `error` 在失败可重试时为 `retry`。
        retry_after_ms:
          type: integer
          description: 重试前建议等待的毫秒数；不建议定时重试时为 null。
          nullable: true
          format: int64
          minimum: 0
  responses:
    V1Unauthorized:
      description: 缺少 API 密钥或 API 密钥无效。错误码 `UNAUTHENTICATED`。
      headers:
        X-Request-Id:
          $ref: '#/components/headers/RequestId'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: >
        未找到，或不属于当前调用的 API 密钥（错误码 `RENDER_NOT_FOUND`、`DRAFT_NOT_FOUND`，图片为
        `NOT_FOUND`）。结果文件已因保留期到期被删除的渲染任务返回 `RESULT_EXPIRED`。
      headers:
        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
      description: >
        以 `Authorization: Bearer <API key>` 的形式发送 API 密钥。密钥以 `sk-`
        开头。缺少密钥或密钥无效时返回 `401 UNAUTHENTICATED`。切勿在浏览器代码中暴露 API 密钥。

````

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