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

# Vidu: Query Video Generation Task Status and Result

> GET /v1/result/{id} — Poll for Vidu video generation status. Returns video_url and totalTokens on completion. Generated URLs are valid for 24 hours.

Use this endpoint to check the status of a Vidu video generation task and retrieve the result once it completes. Video generation is asynchronous — you should poll this endpoint periodically after submitting a task via [Create Video Task](/api-reference/video/vidu-create) until the 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/vidu-create) endpoint in the `id` field.
</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. `viduq3-pro` or `viduq3-turbo`).
</ResponseField>

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

  * `queued` — task is waiting in the processing queue
  * `processing` — the 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">
  Direct download URL for the generated video (MP4 format). Only present when `status` is `"completed"`. `null` while 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="totalTokens" type="number">
  Total token count consumed by this task. Populated after completion.
</ResponseField>

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

## Task Status Flow

The task moves through the following states:

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

| Status       | Meaning                                                   |
| ------------ | --------------------------------------------------------- |
| `queued`     | Task accepted and waiting to be picked up by the model    |
| `processing` | Vidu model is actively generating the video               |
| `completed`  | Generation succeeded — retrieve the video via `video_url` |
| `failed`     | Generation encountered an error — check the `error` field |

## Polling Advice

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

  Estimated generation times by model:

  * `viduq3-turbo` — typically **2–4 minutes**
  * `viduq3-pro` — typically **3–6 minutes**

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

## Video URL Notes

<Warning>
  Generated video URLs are valid for **24 hours** only. Download and store the video file in your own storage system as soon as generation completes — the URL will become inaccessible after expiry.
</Warning>

* Videos are delivered in **MP4** format
* The URL is a direct download link — no additional authentication required

## Code Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://zcbservice.aizfw.cn/kyyReactApiServer/v1/result/video_fd35ee52-2a98-44a6-b930-29a88ce9b8fd \
    --header 'Authorization: Bearer YOUR_API_KEY'
  ```

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

  task_id = "video_fd35ee52-2a98-44a6-b930-29a88ce9b8fd"
  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("Duration:", result["actualDuration"], "seconds")
          break
      elif status == "failed":
          print("Error:", result["error"])
          break

      time.sleep(30)  # Wait 30 seconds before next poll
  ```
</CodeGroup>

### Example Responses

**While processing:**

```json theme={null}
{
  "id": "video_fd35ee52-2a98-44a6-b930-29a88ce9b8fd",
  "object": "Video",
  "created": 1774836724,
  "model": "viduq3-pro",
  "status": "processing",
  "video_url": null,
  "totalTokens": null,
  "error": null
}
```

**On completion:**

```json theme={null}
{
  "id": "video_fd35ee52-2a98-44a6-b930-29a88ce9b8fd",
  "object": "Video",
  "created": 1774836724,
  "model": "viduq3-pro",
  "status": "completed",
  "video_url": "https://cdn.example.com/video_fd35ee52.mp4",
  "actualDuration": 5,
  "totalTokens": 1500,
  "error": null
}
```

**On failure:**

```json theme={null}
{
  "id": "video_fd35ee52-2a98-44a6-b930-29a88ce9b8fd",
  "object": "Video",
  "created": 1774836724,
  "model": "viduq3-pro",
  "status": "failed",
  "video_url": null,
  "totalTokens": null,
  "error": "Content policy violation: prompt contains restricted content."
}
```
