Генеруйте відео з текстових prompt через Kling за допомогою CometAPI POST /kling/v1/videos/text2video, а потім відстежуйте статус задачі й отримуйте результати за ID задачі.
curl --request POST \
--url https://api.cometapi.com/kling/v1/videos/text2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A happy scene of a vacation on the beach."
}
'{
"code": 123,
"message": "<string>",
"request_id": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123
}
}aspect_ratio, duration або mode лише після того, як базовий сценарій запрацюєcallback_url, якщо хочете отримувати результат через push-доставку замість чистого pollingНадішліть запит на генерацію
Опитуйте стан задачі
Bearer token authentication. Use your CometAPI key.
Must be application/json.
Text prompt describing the video to generate. Maximum 500 characters.
Elements to exclude from the video. Maximum 200 characters.
Output aspect ratio (width:height). Options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.
Webhook URL to receive task status updates when the task completes.
Kling model variant to use. See the Models page for current options.
Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.
Generation mode. std for standard (faster), pro for professional (higher quality).
std, pro Output video length in seconds. Options: 5, 10.
Camera motion preset or manual configuration. Omit for automatic camera movement.
Show child attributes
Custom task id for your own tracking. Does not replace the system-generated task id but can be used to query tasks. Must be unique per user.
curl --request POST \
--url https://api.cometapi.com/kling/v1/videos/text2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "A happy scene of a vacation on the beach."
}
'{
"code": 123,
"message": "<string>",
"request_id": "<string>",
"data": {
"task_id": "<string>",
"task_status": "<string>",
"created_at": 123,
"updated_at": 123
}
}