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

# 查询视频任务

> 返回同一用户创建的任务。读取已完成的任务时，如尚未结算会完成结算；无论是否被读取，任务完成后都会结算。



## OpenAPI

````yaml /openapi.cn.json get /api/v3/contents/generations/tasks/{id}
openapi: 3.1.0
info:
  title: OmniRelay API
  version: 1.0.0
  description: 面向已核验真实文本模型的兼容 OpenAI 网关。访问按工作空间开通，使用自己的模型列表查询能力与客户价格。
servers:
  - url: https://api.omnirelay.ai
security:
  - bearerAuth: []
tags:
  - name: 服务
  - name: 模型
  - name: 对话
  - name: 管理 API
  - name: 响应
  - name: 向量
  - name: 图片
  - name: 视频
paths:
  /api/v3/contents/generations/tasks/{id}:
    get:
      tags:
        - 视频
      summary: 查询视频任务
      description: 返回同一用户创建的任务。读取已完成的任务时，如尚未结算会完成结算；无论是否被读取，任务完成后都会结算。
      operationId: getVideoTask
      parameters:
        - name: id
          in: path
          required: true
          description: 创建任务时返回的任务 ID。
          schema:
            type: string
      responses:
        '200':
          description: 任务当前状态。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTask'
              example:
                id: 3f0c9a2e-6b1d-4c35-9a7e-2d8c5b1e4f60
                model: doubao-seedance-2-0-260128
                status: succeeded
                created_at: 1791994620
                updated_at: 1791994785
                content:
                  video_url: https://example.com/video.mp4
                duration: 5
                ratio: '16:9'
                resolution: 480p
                framespersecond: 24
                seed: 9846
                generate_audio: true
                usage:
                  completion_tokens: 50638
                  total_tokens: 50638
                cost_microusd: 1265950
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: not_found：该用户没有此 ID 的任务。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                error:
                  code: not_found
                request_id: 2f6c1d0e9a
components:
  schemas:
    VideoTask:
      type: object
      required:
        - id
        - model
        - status
        - created_at
        - updated_at
      properties:
        id:
          type: string
        model:
          type: string
        status:
          type: string
          enum:
            - queued
            - running
            - succeeded
            - failed
            - expired
            - cancelled
          description: succeeded 扣费；failed、expired 和 cancelled 不扣费。
        created_at:
          type: integer
          description: Unix 秒。
        updated_at:
          type: integer
          description: Unix 秒。
        content:
          type: object
          properties:
            video_url:
              type: string
              description: 签名 MP4 链接，生成后 48 小时内有效。status 为 succeeded 时返回。
        duration:
          type: integer
        ratio:
          type: string
        resolution:
          type: string
        framespersecond:
          type: integer
        seed:
          type: integer
        generate_audio:
          type: boolean
        usage:
          type: object
          properties:
            completion_tokens:
              type: integer
              description: 实际生成的输出 tokens：宽 x 高 x (24 x 秒数 + 1) / 1024。
            total_tokens:
              type: integer
        error:
          type: object
          description: 任务未生成的原因。
          properties:
            code:
              type: string
            message:
              type: string
        cost_microusd:
          type: integer
          description: 折扣后的费用（micro-USD），任务结算后返回。
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - type
          properties:
            code:
              type: string
              example: model_unavailable
            message:
              type: string
              example: The model does not exist or is disabled.
              description: 用于日志和 SDK 异常的简短英文说明；措辞可能调整，请按 code 判断。
            type:
              type: string
              example: not_found_error
              description: >-
                按 HTTP
                状态划分的错误类别：invalid_request_error、authentication_error、insufficient_quota、permission_error、not_found_error、conflict_error、rate_limit_error、service_unavailable
                或 api_error。
            param:
              type: string
              maxLength: 200
              description: 可识别时返回被拒绝的请求字段路径，不包含参数值；Responses 使用原生字段名。
        request_id:
          type: string
          description: 在对话补全、Responses 和 Embeddings 出错时返回。
  responses:
    Unauthorized:
      description: '`unauthorized`：缺少 API Key，或该 Key 已吊销或无效。'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error:
              code: unauthorized
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 在 OmniRelay 控制台创建的 API Key。所有者确认身份后可在控制台再次查看。

````

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