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

# Grok: Query Video Generation Task Status and Result

> GET /v1/result/{id} — Poll for Grok video generation status. Returns video_url on completion. Supports all four Grok model variants.

Use this endpoint to poll the status of a Grok video generation task and retrieve the output URL once generation completes. Because video generation is asynchronous, you should call this endpoint periodically after submitting a task via [Create Video Task](/api-reference/video/grok-create). Stop polling when `status` reaches `completed` or `failed`.

## Endpoint

```
GET /v1/result/{id}
```

## Authentication

```
Authorization: Bearer YOUR_API_KEY
```

## Path Parameters

<ParamField path="id" type="string" required>
  The unique task identifier returned by the [Create Video Task](/api-reference/video/grok-create) endpoint. This is the `id` field in the creation response.
</ParamField>

## Response Fields

<ResponseField name="id" type="string">
  The unique task identifier.
</ResponseField>

<ResponseField name="object" type="string">
  Object type. Always `"video"`.
</ResponseField>

<ResponseField name="created" type="integer">
  Unix timestamp of when the task was created.
</ResponseField>

<ResponseField name="model" type="string">
  The model used for this task (e.g., `grok_video3`, `grok_video3_pro`, `grok_video3_max`, or `grok_video3_stable`).
</ResponseField>

<ResponseField name="status" type="string">
  Current task status:

  * `queued` — task is waiting in the processing queue
  * `processing` — the Grok model is actively generating the video
  * `completed` — generation finished; `video_url` is populated
  * `failed` — generation failed; see `error` for details
</ResponseField>

<ResponseField name="video_url" type="string">
  Temporary download URL for the generated video. Only present when `status` is `"completed"`. `null` while the task is pending or processing.
</ResponseField>

<ResponseField name="actualDuration" type="number">
  Actual output duration of the generated video in seconds. Only present when `status` is `"completed"`.
</ResponseField>

<ResponseField name="error" type="string">
  Error message describing the failure reason. Only present when `status` is `"failed"`.
</ResponseField>

## Task Status Flow

**`queued`** → **`processing`** → **`completed`** or **`failed`**

| Status       | Meaning                                       |
| ------------ | --------------------------------------------- |
| `queued`     | Task accepted, waiting to be processed        |
| `processing` | Grok model is actively generating the video   |
| `completed`  | Video ready — retrieve via `video_url`        |
| `failed`     | An error occurred — check `error` for details |

## Polling Advice

<Tip>
  **Recommended polling interval: 30–60 seconds.**

  Generation time depends on the model, requested duration, and number of reference images:

  * Longer durations (e.g., 20–30s with `grok_video3_max`) will take more time
  * More reference images generally increases processing time
  * `grok_video3_pro` (fixed 10s, per-call billing) is typically faster than variable-duration models at long durations

  Stop polling as soon as `status` is `completed` or `failed`. Polling too frequently may trigger rate limiting.
</Tip>

## Result URL Notes

<Warning>
  The `video_url` is a **temporary download link**. Download and persist the video to your own storage as soon as generation completes — the link will expire and become inaccessible.
</Warning>

* If the prompt or reference images violate content policies, the task will return `failed` status
* Tasks with many reference images or long durations may take noticeably longer to process

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://zcbservice.aizfw.cn/kyyReactApiServer/v1/result/video_grok_1234567890 \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

  ```python Python (Polling Loop) theme={null}
  import requests
  import time

  task_id = "video_grok_1234567890"
  headers = {"Authorization": "Bearer YOUR_API_KEY"}

  while True:
      response = requests.get(
          f"https://zcbservice.aizfw.cn/kyyReactApiServer/v1/result/{task_id}",
          headers=headers,
      )
      result = response.json()
      status = result["status"]

      print(f"Status: {status}")

      if status == "completed":
          print("Video URL:", result["video_url"])
          print("Actual duration:", result["actualDuration"], "seconds")
          break
      elif status == "failed":
          print("Error:", result["error"])
          break

      time.sleep(30)
  ```
</CodeGroup>

### Example Responses

**While processing:**

```json theme={null}
{
  "id": "video_grok_1234567890",
  "object": "video",
  "created": 1774836724,
  "model": "grok_video3_max",
  "status": "processing",
  "video_url": null,
  "error": null
}
```

**On completion:**

```json theme={null}
{
  "id": "video_grok_1234567890",
  "object": "video",
  "created": 1774836724,
  "model": "grok_video3_max",
  "status": "completed",
  "video_url": "https://cdn.example.com/video_grok_1234567890.mp4",
  "actualDuration": 10,
  "error": null
}
```

**On failure:**

```json theme={null}
{
  "id": "video_grok_1234567890",
  "object": "video",
  "created": 1774836724,
  "model": "grok_video3_max",
  "status": "failed",
  "video_url": null,
  "error": "Reference image could not be accessed."
}
```
