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

# Sora Video Generation — Query Task Status and Result

> GET /v1/result/{id} — Poll for Sora video task status. Returns video_url when completed. Download the MP4 within 1 day before the link expires.

After you create a Sora video generation task, use this endpoint to check its status and retrieve the download URL once generation is complete. Pass the `id` returned by the [Create Video Task](/api-reference/video/sora-create) endpoint as the path parameter, and keep polling until `status` is `"completed"` or `"failed"`.

<Note>
  Video generation is **asynchronous** and typically takes several minutes. Do not expect an immediate result — continue polling at the recommended interval until the task reaches a terminal status.
</Note>

## Endpoint

```
Base URL:  https://zcbservice.aizfw.cn/kyyReactApiServer
Endpoint:  GET /v1/result/{id}
Full URL:  https://zcbservice.aizfw.cn/kyyReactApiServer/v1/result/{id}
```

All requests must include your API key as a Bearer token:

```
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/sora-create) endpoint (e.g. `sora_abc123def456`).
</ParamField>

## Response Fields

<ResponseField name="id" type="string">
  Unique identifier of the video generation task.
</ResponseField>

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

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

<ResponseField name="model" type="string">
  The model used for generation (e.g. `"openAiSora2Plus"`).
</ResponseField>

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

  * `queued` — task is in the queue, waiting to be processed
  * `processing` — the Sora model is actively generating the video
  * `completed` — generation succeeded; `video_url` is populated
  * `failed` — generation failed; see `error` for details
</ResponseField>

<ResponseField name="video_url" type="string">
  A direct download URL for the generated video (MP4 format). Only present when `status` is `"completed"`. The URL is valid for **1 day** — download and store the video before it expires.
</ResponseField>

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

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

## Status Flow

| Step | Status       | Meaning                                        |
| ---- | ------------ | ---------------------------------------------- |
| 1    | `queued`     | Task created and added to the processing queue |
| 2    | `processing` | Sora model is generating the video             |
| 3    | `completed`  | Video is ready; retrieve it via `video_url`    |
| —    | `failed`     | An error occurred; inspect the `error` field   |

## Polling Recommendations

<Tip>
  Poll every **30–60 seconds**. Video generation takes significantly longer than image generation — polling too frequently wastes quota and may trigger rate limits.
</Tip>

* Stop polling as soon as `status` is `"completed"` or `"failed"`.
* Use exponential back-off if you encounter `429 Too Many Requests` responses.

### Generation Time Estimates

| Video Length  | Estimated Time |
| ------------- | -------------- |
| 4 s           | \~1–3 minutes  |
| 8 s (typical) | \~2–5 minutes  |
| 12 s          | \~3–8 minutes  |

## Video URL Notes

<Warning>
  The `video_url` is only valid for **1 day** after the task completes. Download and save the file to your own storage system promptly — after expiry you will not be able to retrieve the video.
</Warning>

* Format: **MP4**
* The URL is a pre-signed temporary link; do not share it publicly as a permanent link.

## Code Examples

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

  ```python Python theme={null}
  import time
  import requests

  BASE_URL = "https://zcbservice.aizfw.cn/kyyReactApiServer"
  API_KEY = "YOUR_API_KEY"
  TASK_ID = "sora_abc123def456"

  headers = {"Authorization": f"Bearer {API_KEY}"}

  while True:
      response = requests.get(
          f"{BASE_URL}/v1/result/{TASK_ID}",
          headers=headers,
      )
      data = response.json()
      status = data["status"]
      print(f"Status: {status}")

      if status == "completed":
          print(f"Video URL: {data['video_url']}")
          break
      elif status == "failed":
          print(f"Generation failed: {data.get('error')}")
          break

      # Poll every 30 seconds
      time.sleep(30)
  ```
</CodeGroup>

**Example response — processing:**

```json theme={null}
{
  "id": "sora_abc123def456",
  "object": "video.generation",
  "created": 1761635478,
  "model": "openAiSora2Plus",
  "status": "processing",
  "video_url": null,
  "error": null
}
```

**Example response — completed:**

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