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

# 查询任务状态

> 查询 Kling 任务状态。

**路径：** `GET https://api.omniall.ai/v1/videos/{task_id}`

成功后读取 `video_url`，或通过 `/content` 下载。



## OpenAPI

````yaml zh-CN/openapi/kling-video.yaml GET /v1/videos/{task_id}
openapi: 3.1.0
info:
  title: Omniall AI — 快手可灵
  version: 1.0.0
  description: >-
    通过 OpenAI Video 风格协议调用 Kling 视频能力。


    **创建：** `POST https://api.omniall.ai/v1/videos`


    **查询：** `GET /v1/videos/{task_id}` · **下载：** `GET
    /v1/videos/{task_id}/content`


    模型别名（大小写不敏感）。见[模型广场](https://omniall.ai/pricing)。


    **时长优先级：** 顶层 `seconds` > 顶层 `duration` > `metadata.seconds` /
    `metadata.duration` / `metadata.video_duration` > 默认 **5**。


    **分辨率优先级：** `metadata.output_config.resolution` > `metadata.resolution` > 顶层
    `size` > 默认 **720P**。


    鉴权：`Authorization: Bearer sk-...`
servers:
  - url: https://api.omniall.ai
security: []
paths:
  /v1/videos/{task_id}:
    get:
      tags:
        - Kling
      summary: 查询任务状态
      description: |-
        查询 Kling 任务状态。

        **路径：** `GET https://api.omniall.ai/v1/videos/{task_id}`

        成功后读取 `video_url`，或通过 `/content` 下载。
      operationId: klingGetVideo
      parameters:
        - name: Authorization
          in: header
          required: true
          schema:
            type: string
            example: Bearer sk-...
          description: Bearer API Key，例如 `Bearer sk-...`。
        - name: task_id
          in: path
          required: true
          schema:
            type: string
            example: task_xxxxxxxx
          description: 创建接口返回的任务 ID。
      responses:
        '200':
          description: 任务状态
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KlingTask'
              examples:
                排队中:
                  summary: 排队中
                  value:
                    id: task_xxxxxxxx
                    task_id: task_xxxxxxxx
                    object: video
                    model: kling-2.5-motion-std-720p
                    status: queued
                    progress: 0
                    created_at: 1780891541
                生成中:
                  summary: 生成中
                  value:
                    id: task_xxxxxxxx
                    task_id: task_yyyyyyyy
                    object: video
                    model: kling-2.5-motion-std-720p
                    status: in_progress
                    progress: 0
                    created_at: 1780891541
                    completed_at: 1780891544
                成功:
                  summary: 成功
                  value:
                    id: task_xxxxxxxx
                    task_id: task_yyyyyyyy
                    object: video
                    model: kling-3.0-omni-720p-noref-mute
                    status: completed
                    progress: 100
                    seconds: '5'
                    size: 720x1280
                    created_at: 1780891541
                    completed_at: 1780891600
                    video_url: https://cdn.example.com/output/xxx.mp4
                失败:
                  summary: 失败
                  value:
                    id: task_xxxxxxxx
                    task_id: task_yyyyyyyy
                    object: video
                    model: kling-2.5-motion-std-720p
                    status: failed
                    progress: 100
                    created_at: 1780891541
                    completed_at: 1780891559
                    error:
                      code: task_failed
                      message: 参数错误：参考视频 URL 无法访问
components:
  schemas:
    KlingTask:
      type: object
      properties:
        id:
          type: string
        task_id:
          type: string
        object:
          type: string
          example: video
        model:
          type: string
          description: 实际计费档位名称。
        status:
          type: string
          description: >-
            queued / pending / processing / in_progress / completed / failed /
            cancelled
        progress:
          type: integer
        created_at:
          type: integer
        completed_at:
          type: integer
        seconds:
          type: string
        size:
          type: string
        video_url:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string

````

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