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

# Grok Task Query

> Query Grok video task progress, results, and error information using `GET /v1/videos/{task_id}`.

# Grok Task Query

OpenAI-format query entry point. If the task was submitted via `POST /v1/video/create`, please use [Query Task](./unified-query).

After a Grok series task is submitted, poll the status via `GET /v1/videos/{task_id}`.

* The API path is `GET /v1/videos/{task_id}`.
* After the task is completed, the result URL can usually be read from `video_url` or `output.url`.
* If directly downloading `video_url` fails, fall back to `GET /v1/videos/{task_id}/content`.

## Method and Path

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

## Request Example

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

  ```python theme={null}
  import requests

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

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

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

## Response Example

<ResponseExample>
  ```json 200 - Processing theme={null}
  {
    "id": "video_abc123",
    "object": "video",
    "model": "grok-video-3",
    "status": "processing",
    "progress": 42,
    "created_at": 1735689600,
    "completed_at": 0,
    "expires_at": 1735776000,
    "seconds": "6",
    "size": "720P",
    "remixed_from_video_id": "",
    "error": {
      "message": "",
      "code": ""
    },
    "video_url": ""
  }
  ```

  ```json 200 - Completed theme={null}
  {
    "id": "video_abc123",
    "object": "video",
    "model": "grok-video-3",
    "status": "completed",
    "progress": 100,
    "created_at": 1735689600,
    "completed_at": 1735689900,
    "expires_at": 1735776000,
    "seconds": "6",
    "size": "720P",
    "remixed_from_video_id": "",
    "error": {
      "message": "",
      "code": ""
    },
    "video_url": "https://example.com/video.mp4"
  }
  ```

  ```json 200 - Failed theme={null}
  {
    "id": "video_abc123",
    "object": "video",
    "model": "grok-video-3",
    "status": "failed",
    "progress": 100,
    "created_at": 1735689600,
    "completed_at": 1735689700,
    "expires_at": 1735776000,
    "seconds": "6",
    "size": "720P",
    "remixed_from_video_id": "",
    "error": {
      "message": "Content policy violation",
      "code": "content_policy"
    },
    "video_url": ""
  }
  ```
</ResponseExample>

## Authentication

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

## Path Parameters

<ParamField body="task_id" type="string" required>
  Video task ID.
</ParamField>

## Response

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

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

<ResponseField name="progress" type="integer">
  Progress percentage.
</ResponseField>

<ResponseField name="completed_at" type="integer">
  Completion timestamp.
</ResponseField>

<ResponseField name="expires_at" type="integer">
  Result expiration timestamp.
</ResponseField>

<ResponseField name="seconds" type="string">
  Output duration.
</ResponseField>

<ResponseField name="size" type="string">
  Output resolution tier.
</ResponseField>

<ResponseField name="video_url" type="string">
  Video URL. When completed, this field will be read first, or `output.url` will be read for compatibility.
</ResponseField>

<ResponseField name="error" type="object">
  Failure reason object.
</ResponseField>

## Polling Recommendations

The implementation will obtain the result URL in the following order:

1. `output.url`
2. `video_url`
3. `url`
4. `detail.url`

If directly downloading the returned video URL fails, fall back to:

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

## Related APIs

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