Hent en Kling-oppgave
Spørr en Kling-videogenereringsoppgave etter task_id, og returner status, fremdrift og resultatmetadata for polling.
Hva du bør kontrollere først
task.task_status; Motion Control-oppgaver brukersubmitted,processing,succeed, ellerfailedtask.task_result.videos[0].urlnår en videooppgave lykkestask.task_status_msgeller andre returnerte detaljfelt når en oppgave avsluttes tidligcode,message, ogrequest_idnår svaret bruker standard innpakning
Mønster for polling
Opprett oppgaven fra det tilsvarende endepunktet
Spørr etter oppgaven til den når en terminaltilstand
succeed og failed.Fortsett til neste trinn i arbeidsflyten
Vanlige kombinasjoner av stier
Autorisasjoner
Bearer token authentication. Use your CometAPI key.
Stien-parametere
Resource type. One of: images, videos, audio.
Sub-action matching the resource type. For images: generations, kolors-virtual-try-on. For videos: text2video, image2video, motion-control, lip-sync, effects, multi-image2video, multi-elements. For audio: text-to-audio, video-to-audio.
Task ID
Svar
Current Kling task state.
- Option 1
- Option 2
A query can return the task object directly or inside the standard response envelope. Normalize both shapes before reading task fields.
Kling task ID.
Current task state. Compatible Motion Control tasks use submitted, processing, succeed, or failed.
Failure or status detail when returned.
Additional task metadata. The object can be empty.
Absent on an initial submitted task, commonly empty while processing or after failure, and populated when a task succeeds.
Watermark information when returned by a compatible workflow.
Task creation timestamp in milliseconds.
Last task update timestamp in milliseconds.
Final unit deduction value, when returned.
Final balance deduction values, when returned.