Model parameters
- Model ID:
kling-video-4.0 - Current pricing: Kling 4.0
- Endpoint:
https://geekai.co/api/v1/videos/generations - Parameters: Video API reference
- Authentication: Get an API key
The following video API parameters are not supported:
negative_promptsizequalityfps
aspect_ratio):
16:9: landscape9:16: portrait1:1: square21:9: ultrawideadaptive: choose the ratio automatically from the prompt.
Do not pass
aspect_ratio for image-to-video.duration of 3–30 seconds.
Set action to the type of task, corresponding to Kling’s text, image, and reference endpoints. An empty or incorrect value returns an error. Kling 4.0 supports:
text-to-video: text to videoimage-to-video: image to video using a first frame, first and last frames, or first, intermediate, and last framesomni-video: reference generation using up to 10 images, five videos, three voices, and seven elements, with no more than 15 assets in total
resolution values of 720p and 1080p (default: 720p).
Pricing
Kling 4.0 pricing depends on resolution and duration:
Reference video duration counts toward billing as follows:
- Input no longer than output: billable duration = output duration × 2.
- Input longer than output: billable duration = input duration + output duration.
5-second 720p video without a reference is billed for 5 seconds at 5 x 1.0 = 5 CNY. With a 3-second reference, the billable duration is 5 x 2 = 10 seconds and the charge is 10 x 0.6 = 6 CNY.
For discounted GeekAI channels, multiply the listed price by the channel’s discount multiplier.
Text to video
Describe the video in text:succeed. The response then includes the video URL:
Image to video
First frame Pass one image inimage to generate a video starting from that frame:
image and image_tail:
images. Images can be URLs or Base64 data and must meet these requirements:
- JPG, JPEG, or PNG
- Maximum file size: 30 MB per image
- Both dimensions at least 300 px; aspect ratio between 2:5 and 5:2
- No more than 10 images
Reference to video
Kling 4.0 accepts up to 15 reference assets in total: at most 10 images, five videos, three voices, and seven elements. Reference images Pass one or more reference images inimages:
images together with first and last frames in image and image_tail.
Multimodal references
Supply reference images, video, and audio together:
GeekAI distinguishes reference videos from videos to edit, corresponding to the official
base_video and feature_video. Pass reference videos in videos (type feature_video), or one video to edit in video (type base_video).audio. GeekAI calls the voice management API to convert them into voice IDs. Refer to the clips in your prompt as @Audio1, @Audio2, and so on.
You can supply custom reference elements similarly; see the Kling 3.0 documentation.
Alternatively, create voices and elements through their management APIs. Pass their IDs in extra_body.voice_list and extra_body.element_list and refer to them in the prompt:
Video editing
Pass the source video invideo to edit it according to your prompt:
Voice management
Create a custom voice with the voice management API:task_status is succeed, retrieve the custom voice ID from task_result.voices[0].voice_id and use it in subsequent tasks such as reference-based generation:
Element management
Create a custom element with the element management API:Pass the front view in
image, other reference images in images, and reference videos in the videos array. These fields differ from the official parameter format.task_status is succeed, retrieve the element ID from task_result.elements[0].element_id and use it in a video request:
