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

# Query Task

> Use `GET /v1/video/query` to query Grok unified video task status and results.

# Query Task

After a Grok unified video task is submitted, query its progress and results via `GET /v1/video/query`. The query parameter uses `id`, whose value is the task ID returned by [Create Video](./unified-generation).

* The route entry point is `GET /v1/video/query`.
* The task ID is passed via the Query parameter `id`, and its format is usually `grok:...`.
* After completion, `video_url` will include an accessible URL; while processing, it may be `null`.

## Method and Path

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

## Request Example

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

## Response Example

<ResponseExample>
  ```json 200 - Processing theme={null}
  {
    "id": "grok:05c8e247-7e64-472a-acb1-e7f2de5d0d04",
    "status": "processing",
    "video_url": null,
    "status_update_time": 1762780400,
    "progress": 50
  }
  ```

  ```json 200 - Completed 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>

Some channels may also return extended fields such as `asset_id`, `video_file_id`, and `trace_id`; please refer to the actual response.

## Authentication

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

## Query Parameters

<ParamField query="id" type="string" required>
  Task ID, which is the same as the `id` returned by the creation API.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Task ID.
</ResponseField>

<ResponseField name="status" type="string">
  Task status. Common values include `processing`, `completed`, `failed`, and `unknown`.
</ResponseField>

<ResponseField name="video_url" type="string | null">
  Video result URL. May be `null` when the task is not yet complete.
</ResponseField>

<ResponseField name="status_update_time" type="integer">
  The most recent status update time (Unix timestamp).
</ResponseField>

<ResponseField name="progress" type="integer">
  Task progress percentage, included in some responses.
</ResponseField>

<ResponseField name="prompt" type="string">
  Echo of the submitted prompt.
</ResponseField>

<ResponseField name="ratio" type="string">
  Echo of the video ratio, for example `3:2`.
</ResponseField>

<ResponseField name="thumbnail_url" type="string">
  Thumbnail URL, may appear after completion.
</ResponseField>

## Related APIs

* [Grok Video Overview](./overview)
* [Create Video](./unified-generation)
* [Video Remix](./unified-remix)
* [Video Extend](./unified-extend)
* [Video Extensions](./unified-extensions)
* [Grok Task Query (OpenAI Format)](./query)
