AI Model APIVideoKling Omni Video
Query Kling Omni Video Task
Dedicated route: GET https://maasunion.com/kling/v1/videos/omni/{task_id}
Upstream capability: Kling OmniVideo (/v1/videos/omni-video)
Overview
Query the status and generation result of a task using the data.task_id returned when creating the task.
The gateway currently only supports querying by the gateway task ID;
external_task_idis saved upstream, so please use thetask_idfrom the create response for queries.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
task_id | string | Yes | The data.task_id returned when creating the task |
Request Example
curl --request GET \
--url "https://maasunion.com/kling/v1/videos/omni/your-task-id" \
--header "Authorization: Bearer sk-xxxxxxxx"Response Example (Succeeded)
{
"code": 0,
"message": "string",
"request_id": "string",
"data": {
"task_id": "task_xxxxxxxx",
"task_status": "succeed",
"task_status_msg": "string",
"watermark_info": {
"enabled": false
},
"task_result": {
"videos": [
{
"id": "string",
"url": "string",
"watermark_url": "string",
"duration": "5"
}
]
},
"task_info": {
"external_task_id": "string"
},
"final_unit_deduction": "string",
"created_at": 1722769557708,
"updated_at": 1722769557708
}
}| Field | Description |
|---|---|
code | Error code; 0 means success |
message | Error or status message |
request_id | Request trace ID |
data.task_id | Gateway task ID |
data.task_status | Task status, see the table below |
data.task_status_msg | Reason shown on failure (e.g. content moderation) |
data.task_result.videos[].id | Generated video ID, globally unique |
data.task_result.videos[].url | Video download URL (anti-hotlink, valid for about 30 days; please persist in time) |
data.task_result.videos[].watermark_url | URL of the watermarked video |
data.task_result.videos[].duration | Video duration in seconds |
data.final_unit_deduction | Credits deducted upstream |
data.task_info.external_task_id | Custom task ID passed at creation |
data.created_at / updated_at | Unix millisecond timestamps |
Task Status
task_status | Meaning |
|---|---|
submitted | Submitted |
processing | Processing |
succeed | Succeeded |
failed | Failed |
Polling Recommendation
After creating a task, poll this endpoint at intervals of 10–30 seconds until task_status becomes succeed or failed.
Python Polling Example
import os
import time
import requests
TOKEN = os.environ["NEW_API_KEY"]
resp = requests.post(
"https://maasunion.com/kling/v1/videos/omni",
headers={"Authorization": f"Bearer {TOKEN}"},
json={
"model_name": "kling-video-o1",
"prompt": "A cat plays the piano",
"mode": "pro",
"aspect_ratio": "1:1",
"duration": "7",
},
)
resp.raise_for_status()
task_id = resp.json()["data"]["task_id"]
print("task_id:", task_id)
while True:
result = requests.get(
f"https://maasunion.com/kling/v1/videos/omni/{task_id}",
headers={"Authorization": f"Bearer {TOKEN}"},
).json()
status = result["data"]["task_status"]
print("status:", status)
if status == "succeed":
videos = result["data"]["task_result"]["videos"]
print("video_url:", videos[0]["url"] if videos else None)
break
if status == "failed":
print("error:", result["data"].get("task_status_msg"))
break
time.sleep(15)Error Handling
When code != 0, the request fails and message contains the error description. Common cases:
task_iddoes not exist or has expired- Invalid token or insufficient balance
- Content moderation block (see
task_status=failedandtask_status_msg)
Document updated: 2026-06-16
How is this guide?