Kling Motion-Control
Create a text-to-video task and follow it through completion or failure.
Overview
Create an asynchronous text-to-video task with a supported model. Use the returned task ID to retrieve its state, or provide callback_url for terminal delivery.
Quick start
- Create an API key and set it as RUNAPI_API_KEY.
- Choose a supported model and send a POST request whose body matches that model's schema.
- Store the returned task ID, then poll until a terminal state or handle the terminal callback.
Endpoint
- Base URL
https://runapi.ai- API version
v1- Authentication
Authorization: Bearer YOUR_API_TOKEN
Supported models
Open a model page for current pricing, rate limits, and commercial-usage details.
Request schema
Fields and allowed values depend on the selected model. When supplied, callback_url receives a terminal task delivery.
kling-3.08 fields
background_sourcestringBackground source.
Allowed values:video, image
callback_urlstringWebhook URL for async notifications.
character_orientationstringCharacter orientation.
Allowed values:video, image
modelstringModel slug.
output_resolutionstringOutput resolution.
Allowed values:720p, 1080p
promptstringDescription prompt.
reference_video_urlstringReference motion video URL.
source_image_urlstringSubject image URL.
kling-v2.67 fields
callback_urlstringWebhook URL for async notifications.
character_orientationstringWhether the reference follows the video's or image's orientation.
Allowed values:video, image
modelstringModel slug.
output_resolutionstringOutput resolution.
Allowed values:720p, 1080p
promptstringOptional motion guidance prompt.
Bound:2500
reference_video_urlstringReference motion video URL (3-10 seconds with image orientation; 3-30 seconds with video orientation).
source_image_urlstringSubject image URL.
Create acceptance
POST /api/v1/kling/motion_control
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
Polling processing
GET /api/v1/kling/motion_control/:id
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "processing"
}
Polling completed
GET /api/v1/kling/motion_control/:id
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
Polling failed
GET /api/v1/kling/motion_control/:id
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": "Task processing failed.",
"id": "tsk_reference_demo",
"status": "failed"
}
Customer callback: completed
POST callback_url
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"id": "tsk_reference_demo",
"status": "completed",
"videos": [
{
"url": "https://file.runapi.ai/reference-video.mp4"
}
]
}
Customer callback: failed
POST callback_url
{
"billing": {
"refund": null,
"reservation": null,
"settlement": null
},
"error": {
"code": "generation_failed",
"message": "Task processing failed."
},
"id": "tsk_reference_demo",
"status": "failed"
}
Errors
{
"error": {
"code": "invalid_request",
"message": "A required request field is missing."
}
}
Generated Code Samples
Use cURL directly, or install an SDK for your language. Each sample submits the validated request shown in this reference.
curl -X POST https://runapi.ai/api/v1/kling/motion_control \
-H 'Authorization: Bearer YOUR_API_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"model":"kling-3.0","source_image_url":"https://file.runapi.ai/portrait.png","reference_video_url":"https://file.runapi.ai/motion.mp4"}'