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

# Videos API: Query Video Generation Task Status and Result

> GET /v1/result/{id} — Poll for Videos model generation status. Returns video_url and actualDuration on completion. Poll every 30–60 seconds.

Use this endpoint to poll the status of a Videos model video generation task and retrieve the output URL once complete. Video generation is asynchronous — after submitting a task via [Create Video Task](/api-reference/video/videos-create), call this endpoint periodically until `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/videos-create) endpoint. Use the exact value of the `id` field from 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., `videos` or `videos_fast`).
</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">
  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` | Videos 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.**

  Most tasks complete within a few minutes. Tasks using multiple reference images or videos may take longer due to additional processing. Stop polling as soon as `status` is `completed` or `failed` — excessive polling may trigger rate limiting.
</Tip>

## Result URL Notes

<Warning>
  The `video_url` is a **temporary download link**. Save the video to your own storage immediately after generation completes — the URL will expire and become inaccessible.
</Warning>

* Tasks that fail content policy checks will return `status: "failed"` immediately
* Tasks with heavier reference media (more images, longer videos) will take longer to complete

## Code Examples

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

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

  task_id = "video_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")
          # Download and store the video before the URL expires
          break
      elif status == "failed":
          print("Error:", result["error"])
          break

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

### Example Responses

**While processing:**

```json theme={null}
{
  "id": "video_1234567890",
  "object": "video",
  "created": 1761635478,
  "model": "videos",
  "status": "processing",
  "video_url": null,
  "error": null
}
```

**On completion:**

```json theme={null}
{
  "id": "video_1234567890",
  "object": "video",
  "created": 1761635478,
  "model": "videos",
  "status": "completed",
  "video_url": "https://cdn.example.com/video_1234567890.mp4",
  "actualDuration": 5,
  "error": null
}
```

**On failure:**

```json theme={null}
{
  "id": "video_1234567890",
  "object": "video",
  "created": 1761635478,
  "model": "videos",
  "status": "failed",
  "video_url": null,
  "error": "Reference video exceeds maximum total duration of 15 seconds."
}
```
