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

# Kling 任务状态查询

> 使用 `GET /v1/videos/{task_id}` 查询 Kling 视频任务状态与结果。

# Kling 任务状态查询

Kling 系列任务提交后，通过 `GET /v1/videos/{task_id}` 查询。

* 查询路径是 `GET /v1/videos/{task_id}`。
* 成功返回的是 OpenAI 风格 `video` 对象。
* 任务完成后可从 `video_url` 读取结果。

## 方法与路径

```http theme={null}
GET /v1/videos/{task_id}
```

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl https://octopusx.ai/v1/videos/video_123 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://octopusx.ai/v1/videos/video_123",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const response = await fetch("https://octopusx.ai/v1/videos/video_123", {
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
    },
  });

  console.log(await response.json());
  ```
</CodeGroup>

## 响应示例

<ResponseExample>
  ```json 200 - 处理中 theme={null}
  {
    "id": "task_ZOAIupBoCLMo3dmUGcrKUcUEUnCLctc6",
    "object": "video",
    "model": "kling-3.0-omni-720p-noref-audio",
    "status": "processing",
    "progress": 50,
    "created_at": 1774494511
  }
  ```

  ```json 200 - 已完成 theme={null}
  {
    "id": "task_ZOAIupBoCLMo3dmUGcrKUcUEUnCLctc6",
    "object": "video",
    "model": "kling-3.0-omni-720p-noref-audio",
    "status": "completed",
    "progress": 100,
    "created_at": 1774494511,
    "completed_at": 1774494622,
    "metadata": {
      "url": "https://example.com/video/aigcVideoGenFile.mp4"
    },
    "video_url": "https://example.com/video/aigcVideoGenFile.mp4"
  }
  ```
</ResponseExample>

## 认证

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Path Parameters

<ParamField path="task_id" type="string" required>
  任务 ID，与生成接口返回的 `id` 或 `task_id` 一致。
</ParamField>

## Response

<ResponseField name="id" type="string">
  任务 ID。
</ResponseField>

<ResponseField name="object" type="string">
  固定为 `video`。
</ResponseField>

<ResponseField name="model" type="string">
  模型名称。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态，常见值包括 `queued`、`processing`、`completed`、`failed`、`cancelled`。
</ResponseField>

<ResponseField name="progress" type="integer">
  进度百分比（0-100）。
</ResponseField>

<ResponseField name="created_at" type="integer">
  创建时间（Unix 时间戳）。
</ResponseField>

<ResponseField name="completed_at" type="integer">
  完成时间（Unix 时间戳），仅在任务完成时返回。
</ResponseField>

<ResponseField name="metadata" type="object">
  元数据。
</ResponseField>

<ResponseField name="metadata.url" type="string">
  视频地址（在 metadata 中）。
</ResponseField>

<ResponseField name="video_url" type="string">
  视频地址（与 metadata.url 相同）。
</ResponseField>

## 相关接口

* [Kling 视频概览](./overview)
* [Kling 视频生成](./generation)
