Create a video task
Queues a Kling render on your account and answers right away with a `task_id`; the video itself is not ready yet. Credits for the clip are held from this moment. Follow progress with `GET /v1/tasks/{task_id}`. There is no idempotency key, so resending a request that already succeeded starts a second video.
/v1/videos/generationsA secret key from Settings → API keys, sent as a Bearer token. Call the API with it from your own server only.
In: header
Which Kling model renders the clip; kling_v4 (Kling 4.0) is the recommended default. The Models page lists the inputs, lengths and resolutions of each one. The motion control models are available in the web app only.
"kling_v4" | "kling_o3_text_to_video" | "kling_v3_text_to_video" | "kling_v3_image_to_video"What should happen on screen, up to 2,500 characters. Required on every model except kling_v3_image_to_video, where the first frame alone is enough. On kling_v4 reference runs, name references by position: @Image 1, @Image 2…
1 <= length <= 2500Clip length in seconds: 3 to 30 on kling_v4, 4 to 15 on the Kling 3.0 and Kling O3 models (10 at most when Kling O3 gets a video). Without it the clip is 5 seconds and priced as such.
3 <= value <= 30Output resolution: 720p (default) or 1080p on every model, plus 4k on kling_v3_text_to_video and kling_v3_image_to_video. Higher resolutions may need a paid plan.
"720p" | "1080p" | "4k"Frame shape for text to video: 16:9 (default), 9:16 or 1:1, plus 21:9 on kling_v4. A run that starts from an image takes the shape of that image, and kling_v3_image_to_video does not accept this field.
"16:9" | "9:16" | "1:1" | "21:9"Kling 3.0 and Kling O3 only: render sound with the picture, on unless you send false. Kling 4.0 always renders sound and refuses this field. Kling O3 video to video keeps the sound of the source clip, so only false is accepted there.
HTTPS links to JPEG, PNG or WebP images. One image is the first frame and two are the first and last frame. kling_v4 also takes three to ten images as references (or one or two with reference_mode). kling_o3_text_to_video and kling_v3_image_to_video take at most two (the latter needs at least one); kling_v3_text_to_video takes none. With a Kling O3 video, the images are extra references.
One HTTPS link to an MP4 or MOV clip, kling_o3_text_to_video only: the clip is edited or restyled following the prompt (video to video). Video references on kling_v4 and the motion control models are available in the web app only.
kling_v4 only. Treat one or two images as references (a character, a product, a style) instead of first and last frame. Needs at least one image.
Response Body
curl -X POST "https://kling4.video/v1/videos/generations" \ -H "Authorization: Bearer sk_sd_example" \ -H "Content-Type: application/json" \ -d '{ "model": "kling_v4", "prompt": "A paper boat drifts down a rain-soaked city gutter, low tracking shot, neon reflections", "duration": 5, "quality": "720p" }'{
"task_id": "Vq3x8LmZ2tR9bK_wP0sYd",
"status": "pending",
"created_at": "2026-10-20T09:12:04.000Z"
}{
"error": {
"code": "invalid_request",
"message": "Request body must contain valid JSON.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid, expired, or revoked.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "insufficient_credits",
"message": "This request requires 15 credits, but only 6 are available.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "plan_upgrade_required",
"message": "This model or resolution is not included in your plan.",
"param": "model",
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "invalid_request",
"message": "Content-Type must be application/json.",
"param": "content-type",
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "invalid_request",
"message": "Unsupported model.",
"param": "model",
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "API rate limit exceeded. Try again later.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "internal_error",
"message": "The request could not be completed.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "provider_error",
"message": "The video provider could not start this task. Try again later.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "service_unavailable",
"message": "Video generation is temporarily unavailable.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}Models and inputs
The Kling model IDs the Kling4 API accepts, with Kling 4.0 as the default, what each one takes as input, which lengths and resolutions it renders, and how your media decides the generation mode.
Get a video task GET
Reads one video task on your account, including tasks started in the web app. Keep polling while `status` is `pending` or `processing`, waiting a little longer between calls as the render goes on. Once the task is `completed`, `output.video_url` links to the file that Kling4 stored for you.