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.
The API serves Kling video models through the official Kling API. Put one of the IDs below in model; kling_v4 (Kling 4.0) is the recommended default. Kling4 routes the request to a matching upstream endpoint behind the scenes, so the ID you send stays the same even when that routing changes.
| Model ID | Model | Good for | Images | Video refs | Length | Resolution (default) |
|---|---|---|---|---|---|---|
kling_v4 | Kling 4.0 | Default: text, image and reference to video | 10 | none | 3 to 30 s | 720p or 1080p (720p) |
kling_o3_text_to_video | Kling O3 | Text or frames to video, or video to video | 2 | 1 | 4 to 15 s | 720p or 1080p (720p) |
kling_v3_text_to_video | Kling 3.0 | Text to video | none | none | 4 to 15 s | 720p to 4K (720p) |
kling_v3_image_to_video | Kling 3.0 Image | First frame, or first and last frame, to video | 2 | none | 4 to 15 s | 720p to 4K (720p) |
The numbers under Images and Video refs are maximums per request. A value outside a model's length or resolution range is refused with 422, and the message spells out the limit.
Video references on kling_v4 and the motion control models (kling_v3_motion_control, kling_v2_6_motion_control) are available in the web app only for now: their price follows the length of the reference clip, which the API cannot measure yet. A request that uses them is refused with 422. Tasks you start with them in the web app can still be read with GET /v1/tasks/{task_id}.
What your plan unlocks
Some models or resolutions may need a paid plan. A request your plan does not cover returns 403 plan_upgrade_required. The pricing page lists what each plan includes.
These checks run before a task exists, so a refused request never reserves credits.
How the inputs pick a mode
There is no mode field. The model and the media arrays you fill decide the workflow:
| You send | The task runs as |
|---|---|
| Only a prompt | Text to video |
| One image | Image to video, with the image as the first frame |
| Two images | First and last frame |
Three or more images on kling_v4 | Reference to video |
One video_urls entry on kling_o3_text_to_video | Video to video, guided by the prompt |
To use one or two images as references (say, a character and a product) instead of frames, add reference_mode: true. Only kling_v4 accepts it, and the request needs at least one image.
In a kling_v4 reference request, refer to your references by position in the prompt: @Image 1 is the first entry of image_urls, @Image 2 the second, and so on. For example: "The mascot from @Image 1 holds the bottle from @Image 2 on the counter from @Image 3."
With a kling_o3_text_to_video video, any images you add are used as extra references, and the output is 10 seconds at most.
Media links
Pass media as links, not file uploads. Every URL has to:
- use
https://(Base64 strings anddata:URLs are rejected), - contain no username or password,
- resolve to a public address;
localhost, private network ranges and hostnames that do not resolve are refused.
A rejected link returns 422 invalid_request with param: "media_url".
Other request fields
aspect_ratioaccepts16:9,9:16and1:1on every text-to-video model, and21:9as well onkling_v4. Image-to-video runs take the frame shape from the first image, andkling_v3_image_to_videorefuses the field.generate_audioapplies to Kling 3.0 and Kling O3. It is on unless you sendfalse. Kling 4.0 always generates sound and refuses the field. Kling O3 video to video keeps the sound of the source clip, so onlyfalseis accepted there.promptcan be up to 2,500 characters on every Kling model. Longer prompts fail with422 prompt_too_long. It is required everywhere exceptkling_v3_image_to_video, where the first frame alone is enough.- The request body is strict: a field the API does not know about is rejected with
422, andparamtells you which one.
Authentication
How Kling4 API keys work, where to keep them, how to rotate them without downtime, and the request limits that apply to each key.
Create a video task POST
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.