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

# SD2 Manxue: Query Video Generation Task Status and Result

> GET /v1/result/{id} — Poll for SD2 Manxue video generation status. Returns video_url and actualDuration on completion. Result links are temporary.

Use this endpoint to poll the status of an SD2 Manxue video generation task and retrieve the output URL once complete. Video generation is asynchronous — submit a task via [Create Video Task](/api-reference/video/sd2-manxue-create), then poll this endpoint periodically until `status` reaches `completed` or `failed`. Tasks that include multiple reference images, videos, or audio files may take longer to process.

## 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/sd2-manxue-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., `sd2_manxue_1080p`, `sd2_manxue_4k`, `sd2_manxue_fast_720p`).
</ResponseField>

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

  * `queued` — task is waiting in the processing queue
  * `processing` — the SD2 Manxue 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 picked up        |
| `processing` | SD2 Manxue model is 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 with more reference media (images, videos, or audio) generally take longer to process. 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 save the video to your own storage immediately after generation completes — the URL will expire and become inaccessible after a short period.
</Warning>

* Higher resolution models (2K, 4K) may have longer generation times than 720p or 1080p models
* Tasks that fail content policy checks return `status: "failed"` immediately
* If you submitted a face or avatar reference image without first going through the asset library, the task may fail — use `asset://{assetId}` for those images

## Code Examples

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

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

  task_id = "video_sd2manxue_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 save 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_sd2manxue_1234567890",
  "object": "video",
  "created": 1761635478,
  "model": "sd2_manxue_1080p",
  "status": "processing",
  "video_url": null,
  "error": null
}
```

**On completion:**

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

**On failure:**

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