AGTCloud API Docs
GuidesAPI ReferenceIntegrations and resourcesUpdate and help
Video generationKling

Retrieve video

Retrieve status and results for native Kling 4.0 text-to-video, image-to-video, and Omni tasks.

Query using data.id from the creation response. Once successful, read the video URL from outputs and save promptly. The platform returns only tasks accessible to the current user.

GET/kling/tasks/{task_id}

Retrieve one Kling 4.0 task belonging to the current user, including text-to-video, image-to-video, and Omni. Use the system task ID, not options.external_task_id. Status is submitted, processing, succeeded, or failed. Stopping polling does not cancel a task. billing exposes only the task's list price and currency, not account billing or internal charge details.

Authorization

bearerAuth
AuthorizationBearer <token>

Use a platform API Key: Authorization: Bearer your-api-key.

In: header

Path Parameters

task_id*string

System task ID returned by creation. New task IDs are strings; do not convert to numbers and risk losing precision.

Length1 <= length

Response Body

application/json

application/json

application/json

billing.list_price is the list price in the stated currency, not the final platform charge. Pricing may arrive after the video result; a missing price does not mean the task is free.

Status and saving results

data in the retrieval response is a task array, even when querying a single task ID. The request's code differs from the task's status; check task status before using results.

statusMeaning
submittedSubmitted, awaiting processing
processingProcessing; query again later
succeededGeneration succeeded; read the video from outputs
failedGeneration failed; read the task's message and stop polling

A video result has type set to video; id is the video ID and duration is seconds returned as a string. url is a hotlink-protected video URL. For watermarked output, check the returned watermark_url.

Upstream results are deleted after 30 days. Download and save them promptly. This retention rule does not guarantee that a hotlink-protected URL stays valid for 30 days.

Retrieval errors and task failures

SituationWhat to check
HTTP 400, task_not_existUse the system task ID returned at creation; check the API Key and site; do not use options.external_task_id
HTTP 401, Invalid tokenCheck Bearer authentication and Key validity; missing and invalid Keys may produce the same error
HTTP 200, task status: "failed"Retrieval succeeded but generation failed; read the task's message and stop polling

HTTP error responses may differ from a successful data[] response. Do not interpret HTTP 400/401 as task status failed, and stop polling on authentication errors or nonexistent tasks.