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

# Kling Task Query

> Query the status and result of any Kling generation task — video, image, lip sync, and virtual try-on.

The Kling Task Query endpoint checks the status of any Kling generation task and retrieves the result. This is the shared query endpoint for all Kling models (Omni, text-to-video, image-to-video, etc.).

## Key Points

* **Universal query** — Works for all Kling task types: video, image, lip sync, virtual try-on
* **Asynchronous workflow** — Create a task first, then poll this endpoint until completion
* **Action parameter** — Must match the task type of the original creation request
* **Progress tracking** — Returns progress percentage and status updates

## Action Types

| Action                  | Description                        |
| ----------------------- | ---------------------------------- |
| `text2video`            | Text-to-video and Omni video tasks |
| `image2video`           | Image-to-video tasks               |
| `generations`           | Image generation tasks             |
| `lip-sync`              | Lip sync video tasks               |
| `kolors-virtual-try-on` | Virtual try-on image tasks         |

## Quick Example

<CodeGroup>
  ```bash cURL theme={null}
  curl https://ai.alad.com/kling/v1/videos/text2video/860260753860210752 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

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

  task_id = "860260753860210752"
  action = "text2video"

  while True:
      response = requests.get(
          f"https://ai.alad.com/kling/v1/videos/{action}/{task_id}",
          headers={"Authorization": "Bearer YOUR_API_KEY"}
      )

      result = response.json()
      status = result["data"]["status"]
      progress = result["data"]["progress"]
      print(f"Status: {status}, Progress: {progress}")

      if status in ["SUCCESS", "FAILED"]:
          break

      time.sleep(5)

  if status == "SUCCESS":
      videos = result["data"]["data"]["data"]["task_result"]["videos"]
      for video in videos:
          print(f"Video URL: {video['url']}")
  ```
</CodeGroup>

## Response Fields

| Field                        | Type    | Description                                            |
| ---------------------------- | ------- | ------------------------------------------------------ |
| `code`                       | string  | Response code (`success`)                              |
| `data.task_id`               | string  | Task ID                                                |
| `data.status`                | string  | `SUBMITTED`, `PROCESSING`, `SUCCESS`, or `FAILED`      |
| `data.progress`              | string  | Progress percentage (e.g. `10%`, `100%`)               |
| `data.submit_time`           | integer | Submission Unix timestamp                              |
| `data.start_time`            | integer | Processing start Unix timestamp                        |
| `data.finish_time`           | integer | Completion Unix timestamp                              |
| `data.data.data.task_result` | object  | Contains `videos` or `images` array with download URLs |

<Card title="API Reference" icon="code" href="/en/api-reference/model-api/kuaishou/kling-task-query">
  View the interactive API Playground for Kling Task Query.
</Card>
