Отримання завдання Kling
Надсилайте запит щодо завдання генерації відео Kling за task_id і повертайте його статус, перебіг виконання та метадані результату для опитування.
Що перевірити насамперед
task.task_status; для завдань Motion Control використовуйтеsubmitted,processing,succeed, абоfailedtask.task_result.videos[0].urlколи завдання відео успішно завершуєтьсяtask.task_status_msgабо інші повернуті поля з докладними відомостями, коли завдання завершується достроковоcode,message, а такожrequest_id, коли відповідь використовує стандартну оболонку
Шаблон опитування
Створіть завдання за допомогою відповідної кінцевої точки
Опитуйте, доки завдання не досягне кінцевого стану
succeed і failed.Перейдіть до наступного кроку робочого процесу
Поширені пари шляхів
Авторизації
Bearer token authentication. Use your CometAPI key.
Параметри шляху
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
Відповідь
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.