Generate Video
To initiate a video generation request with the Kling API, use the following curl
command:
curl --location 'https://api.unifically.com/kling/v1/videos/generations' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "2.1-master",
"image_url": "https://website.com/pbxt/MNRY6P3cH0BLYtBDWyAHHeidbK/cat-mario.jpg",
"prompt": "A cute cat with mario uniform, throws the dough at the wall with force",
"duration": 5, // 5s or 10s
"aspect_ratio": "16:9",
"origin_task_id": "TASKID", optional, task id to extend video or lip_sync
"negative_prompt": "" // optional
"effect": "", optional, "squish", "expansion"
}'
Pricing for Available Models
2.1-master
, image to video: $0.48 for 5s img-to-video, $0.96 for 10s img-to-video2.1-master,
text to video: $0.48 for 5s text-to-video, $0.96 for 10s text-to-video2.1-pro
, image to video: $0.48 for 5s img-to-video, $0.96 for 10s img-to-video2.5-pro
, image to video: $0.16 for 5s img-to-video, $0.33 for 10s img-to-video2.5-pro
, image to video: $0.16 for 5s img-to-video, $0.33 for 10s img-to-video
Choose the model based on your budget and feature requirements. Default: 5s
If you dont provide image_url request will become text to video, with image_url, its image to video.
Be sure to replace YOUR_API_KEY
with your API key. Adjust other parameters such as prompt
and duration
as needed for your specific request.
Example API Response
After sending a request to the API, you will receive a response similar to the following:
{
"code": 200,
"data": {
"task_id": "ba32a511-429f-40f2-a477-9ae5c0c2b061",
"status": "pending",
"output": {},
"error": {}
}
}
This response indicates that your video generation request has been successfully initiated. The id
can be used to track the status of the video generation process.
Last updated