> ## 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` 查询 Grok 统一视频任务状态与结果。

# 查询任务

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

* 路由入口是 `GET /v1/video/query`。
* 任务 ID 通过 Query 参数 `id` 传入，格式常为 `grok:...`。
* 完成后 `video_url` 会带上可访问地址；处理中可能为 `null`。

## 方法与路径

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

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl "https://octopusx.ai/v1/video/query?id=grok:48a67431-0708-46d1-9ab9-83cb84700153" \
    -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": "grok:48a67431-0708-46d1-9ab9-83cb84700153"},
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Accept": "application/json",
      },
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const params = new URLSearchParams({
    id: "grok:48a67431-0708-46d1-9ab9-83cb84700153",
  });

  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": "grok:05c8e247-7e64-472a-acb1-e7f2de5d0d04",
    "status": "processing",
    "video_url": null,
    "status_update_time": 1762780400,
    "progress": 50
  }
  ```

  ```json 200 - 已完成 theme={null}
  {
    "id": "grok:05c8e247-7e64-472a-acb1-e7f2de5d0d04",
    "status": "completed",
    "video_url": "https://example.com/output.mp4",
    "status_update_time": 1762780536,
    "progress": 100,
    "prompt": "cat fish --mode=custom",
    "ratio": "3:2",
    "model": "grok-3",
    "thumbnail_url": "https://example.com/thumb.webp"
  }
  ```
</ResponseExample>

部分渠道还会返回 `asset_id`、`video_file_id`、`trace_id` 等扩展字段，请以实际响应为准。

## 认证

```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">
  任务状态，常见值包括 `processing`、`completed`、`failed`、`unknown`。
</ResponseField>

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

<ResponseField name="status_update_time" type="integer">
  状态最近更新时间（Unix 时间戳）。
</ResponseField>

<ResponseField name="progress" type="integer">
  任务进度百分比，部分响应包含。
</ResponseField>

<ResponseField name="prompt" type="string">
  提交时的提示词回显。
</ResponseField>

<ResponseField name="ratio" type="string">
  视频比例回显，例如 `3:2`。
</ResponseField>

<ResponseField name="thumbnail_url" type="string">
  缩略图地址，完成后可能出现。
</ResponseField>

## 相关接口

* [Grok 视频概览](./overview)
* [创建视频](./unified-generation)
* [视频Remix](./unified-remix)
* [视频Extend](./unified-extend)
* [视频Extensions](./unified-extensions)
* [Grok 任务查询（OpenAI 格式）](./query)
