Kling video generation
Kling AI video generation service with text and image input.
This is only a basic call example. See the full docs for more parameters and advanced usage.
View DocsKling Video API
Create videos from text or reference images, and choose a model to suit your project.
Text-to-video
Choose an available model and describe the scene, action, and camera shots.
Images and multiple shots
Prepare reference materials and corresponding parameters for your chosen model.
Asynchronous results
Save the task_id after submission and retrieve the video file when complete.
Start with your first request
Get a Key, copy the request, and view the corresponding JSON response below.
export ACEDATACLOUD_API_KEY="YOUR_API_KEY"
curl --request POST "https://api.acedata.cloud/kling/videos" \
--header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
--header "Content-Type: application/json" \
--data '{
"action": "text2video",
"model": "kling-v3",
"mode": "std",
"duration": 5,
"prompt": "A small sailboat crossing a calm lake at sunrise.",
"async": true
}'Below is an excerpt of key fields from the current API response. The task ID, usage, and generated content depend on the values returned by your request.
{
"task_id": "20068983-0cc9-4c6a-aeb6-9c6a3c668be0"
}Query the original task and retrieve results
Use the task ID returned upon submission to check progress and retrieve the final result.
curl --request POST "https://api.acedata.cloud/kling/tasks" \
--header "Authorization: Bearer $ACEDATACLOUD_API_KEY" \
--header "Content-Type: application/json" \
--data '{"action": "retrieve", "id": "20068983-0cc9-4c6a-aeb6-9c6a3c668be0"}'The following illustrates the fields for a task in progress. Continue querying the same ID until completion.
{
"id": "20068983-0cc9-4c6a-aeb6-9c6a3c668be0",
"type": "videos",
"finished_at": null
}The following is an excerpt of key fields from the existing API response. Refer to the values returned by your request for the task ID, usage, and generated content.
{
"id": "20068983-0cc9-4c6a-aeb6-9c6a3c668be0",
"type": "videos",
"started_at": 1740969535.393,
"finished_at": 1740969852.463,
"elapsed": 317.07,
"response": {
"success": true,
"task_id": "20068983-0cc9-4c6a-aeb6-9c6a3c668be0",
"video_url": "https://cdn.acedata.cloud/assets/examples/gemini/04a043bd-6b23-4b4e-945c-ce48158c3eee-3a89912507c7.mp4",
"state": "succeed"
}
}Support for image input, sound, and multiple shots depends on the selected model. Prepare your assets according to the relevant parameter descriptions.
Read the video or audio track URL returned in response. If the task fails, read the error message and end the query process.
API calls and costs
Refer to the current API and pricing page for request parameters, available models, and costs. If you encounter authentication, balance, or quota errors, check the Key's associated application, validity period, and usage restrictions. Retain the trace_id when troubleshooting requests.
Integrate the Kling Video API into your application
Continue to the complete guide for parameters, result fields, and error handling.
The official motion control feature of Kling, for specific usage methods, refer to the official documentation: https://app.klingai.com/cn/dev/document-api/apiReference/model/motionControl
This API can be used to query Kling's video generation tasks.
This API can generate videos by inputting prompt words and the first and last frame images.
Kling lip-sync API — sync a character's mouth in a video to audio or text.
Kling talking-photo API — make a still portrait speak from audio or text.
Kling Goods Studio generation with asynchronous task delivery.
Kling Video Commerce generation with asynchronous task delivery.
Packages
We offer various credit packages. The more you purchase, the higher the discount you receive.
up to46% OFFPrice
No Pricing Information