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

# 查询任务

> 使用 `GET /v1/video/query` 查询 Veo 统一视频任务状态与结果。

# 查询任务

Veo 统一视频任务提交后，通过 `GET /v1/video/query` 查询进度与结果。查询参数使用 `id`，值为 [创建视频](./unified-generation) 返回的任务 ID。

* 路由入口是 `GET /v1/video/query`。
* 任务 ID 通过 Query 参数 `id` 传入。
* 处理中时常返回 `pending` 或 `processing` 等状态；完成后 `video_url` 会带上可访问地址。

## 方法与路径

```http theme={null}
GET /v1/video/query?id={task_id}
```

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl "https://octopusx.ai/v1/video/query?id=sora-2:task_01k74ynm13exf9ha36zz7820hv" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://octopusx.ai/v1/video/query",
      params={"id": "sora-2:task_01k74ynm13exf9ha36zz7820hv"},
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Accept": "application/json",
      },
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const params = new URLSearchParams({
    id: "sora-2:task_01k74ynm13exf9ha36zz7820hv",
  });

  const response = await fetch(
    `https://octopusx.ai/v1/video/query?${params.toString()}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        Accept: "application/json",
      },
    }
  );

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

## 响应示例

<ResponseExample>
  ```json 200 - 处理中 theme={null}
  {
    "id": "task_01k6x15vhrff09dkkqjrzwhm60",
    "status": "pending",
    "video_url": null,
    "enhanced_prompt": "",
    "status_update_time": 1759763621142
  }
  ```

  ```json 200 - 已完成 theme={null}
  {
    "id": "task_01k6x15vhrff09dkkqjrzwhm60",
    "status": "completed",
    "video_url": "https://example.com/output.mp4",
    "enhanced_prompt": "make animate",
    "status_update_time": 1759763651908
  }
  ```
</ResponseExample>

部分渠道在 `pending` 或 `completed` 时还会返回更完整的 `detail` 结构（含上游任务元数据、缩略图、进度百分比等）。请以实际响应为准做兼容解析。

## 认证

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

## Query Parameters

<ParamField query="id" type="string" required>
  任务 ID，与创建接口返回的 `id` 一致。
</ParamField>

## Response

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

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

<ResponseField name="video_url" type="string | null">
  视频结果地址。任务未完成时可能为 `null`。
</ResponseField>

<ResponseField name="enhanced_prompt" type="string">
  增强后的提示词；若未启用增强可能为空字符串。
</ResponseField>

<ResponseField name="status_update_time" type="integer">
  状态最近更新时间（Unix 时间戳，毫秒或秒取决于上游，请以实际响应为准）。
</ResponseField>

## 相关接口

* [Veo 视频概览](./overview)
* [创建视频](./unified-generation)
* [Veo 任务查询（OpenAI 格式）](./query)
