> ## Documentation Index
> Fetch the complete documentation index at: https://docs.geekai.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling 4.0

Kuaishou's Kling 4.0 generates realistic 3–30-second shots with stable fast motion, tracking, and orbiting cameras. Keyframe mode accepts up to 10 frames, including first, last, and intermediate frames anywhere on the timeline. Combine up to 15 images, videos, elements, and voices to reproduce appearance, motion, camera work, and pacing, or edit expressions, actions, and backgrounds in an existing clip. It generates synchronized stereo sound with multilingual lip sync, accepts prompts up to 8,000 tokens, and outputs 720p or 1080p with support for 21:9 ultrawide framing for ads, short films, drama, and e-commerce.

### Model parameters

* Model ID: `kling-video-4.0`
* Current pricing: [Kling 4.0](https://geekai.co/models/kling-video-4.0)
* Endpoint: `https://geekai.co/api/v1/videos/generations`
* Parameters: [Video API reference](https://docs.geekai.co/en/api/video/generations.md)
* Authentication: [Get an API key](https://geekai.co/user/api_keys)

> [!NOTE]
>
> The following video API parameters are not supported:
>
> * `negative_prompt`
> * `size`
> * `quality`
> * `fps`

Kling 4.0 supports these aspect ratios (`aspect_ratio`):

* `16:9`: landscape
* `9:16`: portrait
* `1:1`: square
* `21:9`: ultrawide
* `adaptive`: choose the ratio automatically from the prompt.

> [!NOTE]
>
> Do not pass `aspect_ratio` for image-to-video.

Kling 4.0 supports a `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 video
* `image-to-video`: image to video using a first frame, first and last frames, or first, intermediate, and last frames
* `omni-video`: reference generation using up to 10 images, five videos, three voices, and seven elements, with no more than 15 assets in total

Kling 4.0 accepts `resolution` values of `720p` and `1080p` (default: `720p`).

### Pricing

Kling 4.0 pricing depends on resolution and duration:

| Model | Resolution | Reference video supplied? | Price (CNY per second) |
| - | - | - | - |
| Kling 4.0 | 720p | No | 1.0 |
| Kling 4.0 | 1080p | No | 1.5 |
| Kling 4.0 | 720p | Yes | 0.6 |
| Kling 4.0 | 1080p | Yes | 0.9 |

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.

For example, a `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](https://docs.geekai.co/en/docs/model_price.md), multiply the listed price by the channel's discount multiplier.

### Text to video

Describe the video in text:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "text-to-video",
    "model": "kling-video-4.0",
    "prompt": "A kitten yawns at the camera",
    "async": true
}'
```

The JSON response includes a task ID. Poll the [video result endpoint](https://docs.geekai.co/en/api/video/result.md) until the status is `succeed`. The response then includes the video URL:

```json theme={null}
{
    "task_id": "5b36a98e-e202-43f8-8a28-cecdc83020b8",
    "task_status": "succeed",
    "video_result": [
        {
            "url": "https://static.geekai.co/video/2026/01/15/c07071e78203f406b0a607a2120adc11.mp4"
        }
    ]
}
```

### Image to video

**First frame**

Pass one image in `image` to generate a video starting from that frame:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "image-to-video",
    "model": "kling-video-4.0",
    "prompt": "A drone races through intricate obstacles or natural wonders for an immersive flight",
    "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_i2v.png",
    "async": true
}'
```

**First and last frames**

Pass the first and last frame images in `image` and `image_tail`:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "image-to-video",
    "model": "kling-video-4.0",
    "prompt": "The girl in the image looks at the camera and says \"Cheese!\" as the camera orbits 360 degrees",
    "image": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_first_frame.jpeg",
    "image_tail": "https://ark-project.tos-cn-beijing.volces.com/doc_image/seepro_last_frame.jpeg",
    "async": true
}'
```

To add intermediate frames as in the official API, pass an array in `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 in `images`:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "omni-video",
    "model": "kling-video-4.0",
    "prompt": "The boy in glasses and a blue T-shirt from @Image1 and the corgi from @Image2 sit on the lawn from @Image3, in 3D cartoon style",
    "images": [
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_1.png",
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_2.png",
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/seelite_ref_3.png"
    ],
    "async": true
}'
```

You can pass `images` together with first and last frames in `image` and `image_tail`.

**Multimodal references**

Supply reference images, video, and audio together:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "omni-video",
    "model": "kling-video-4.0",
    "prompt": "Use video 1’s first-person framing throughout and audio 1 as the music. Make a first-person ad for Seedance’s limited-edition Apple of Peace fruit tea. Begin with image 1: your hand picks a dew-covered Aksu red apple with a crisp tapping sound. At 2–4 seconds, cut to your hand dropping apple pieces, ice and tea into a shaker. Shake hard; sync the clinking ice and shaker to a lively drumbeat. Voice-over: ‘Freshly cut, freshly shaken.’ At 4–6 seconds, show the layered tea pouring into a clear cup, your hand piping milk foam on top and attaching a pink label. Move in on the layers of foam and tea. At 6–8 seconds, lift the cup from image 2 toward the viewer, label clearly visible. Voice-over: ‘Take a refreshing sip.’ Freeze on image 2. Use the same female voice throughout.",
    "images": [
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic1.jpg",
        "https://ark-project.tos-cn-beijing.volces.com/doc_image/r2v_tea_pic2.jpg"
    ],
    "videos": [
        "https://ark-project.tos-cn-beijing.volces.com/doc_video/r2v_tea_video1.mp4"
    ],
    "audio": [
        "https://ark-project.tos-cn-beijing.volces.com/doc_audio/r2v_tea_audio1.mp3"
    ],
    "action": "reference",
    "aspect_ratio": "16:9",
    "duration": 15,
    "async": true
}'
```

> [!NOTE]
>
> 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`).

As with Seedance and MiniMax, pass one or more custom audio URLs in `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](https://docs.geekai.co/en/docs/video/kling/kling-video-v3.md#custom-elements).

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:

```json theme={null}
{
    ...
    "extra_body": {
        "voice_list": [
            {
                "id": "Audio1",
                "voice_id": "CUSTOM_VOICE_ID"
            }
            ...
        ],
        "element_list": [
            {
                "id": "Element1",
                "element_id": "CUSTOM_ELEMENT_ID"
            }
            ...
        ]
    }
}
```

For creation and retrieval, see [Voice management](https://docs.geekai.co/en/docs/video/kling/kling-4.0.md#voice-management) and [Element management](https://docs.geekai.co/en/docs/video/kling/kling-4.0.md#element-management).

### Video editing

Pass the source video in `video` to edit it according to your prompt:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "omni-video",
    "model": "kling-video-4.0",
    "prompt": "Replace the kitten in the video with a puppy and leave everything else unchanged",
    "video": "https://static.geekai.co/video/2026/04/02/f2ffbccd56d65ab172aef3706e003aa7.mp4",
    "async": true
}'
```

### Voice management

Create a custom voice with the [voice management API](https://docs.geekai.co/en/api/video/voices.md):

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/voices/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "kling-voice-v1",
    "name": "Custom voice 1",
    "url": "https://static.geekai.co/audio/2026/11/11/0f3acfd353627cf06c1c671368da51dc.mp3"
}'
```

Voice creation is asynchronous. Poll the voice result endpoint after submitting the task:

```bash theme={null}
curl --location --request GET 'https://geekai.co/api/v1/voices/{task_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY'
```

When `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:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "omni-video",
    "model": "kling-video-4.0",
    "prompt": "Use @voice_1 to recite Quiet Night Thoughts, with animated visuals depicting the poem",
    "extra_body": {
        "voice_list": [
            {
                "id": "voice_1",
                "voice_id": "<CUSTOM_VOICE_ID>"
            }
        ]
    },
    "async": true
}'
```

### Element management

Create a custom element with the [element management API](https://docs.geekai.co/en/api/video/elements.md):

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/elements/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "model": "kling-element-v2",
    "name": "Custom element 1",
    "reference_type": "image_refer",
    "image": "https://docs.qingque.cn/image/api/convert/loadimage?id=5429715788081310775fcACVlWX4tixUlJ4_9IB6cLY5&docId=eZQCqDGoymg61UKgMckSB2oMh&identityId=2Cn18n4EIHT&loadSource=true",
    "images": [
        "https://docs.qingque.cn/image/api/convert/loadimage?id=-8171406105386702772fcADvwnhMxVe7ui5iW40e9ytI&docId=eZQCqDGoymg61UKgMckSB2oMh&identityId=2Cn18n4EIHT&loadSource=true",
        "https://docs.qingque.cn/image/api/convert/loadimage?id=-2458305557636706550fcADvwnhMxVe7ui5iW40e9ytI&docId=eZQCqDGoymg61UKgMckSB2oMh&identityId=2Cn18n4EIHT&loadSource=true",
        "https://docs.qingque.cn/image/api/convert/loadimage?id=-8983666481517966162fcADvwnhMxVe7ui5iW40e9ytI&docId=eZQCqDGoymg61UKgMckSB2oMh&identityId=2Cn18n4EIHT&loadSource=true"
    ]
}'
```

> [!NOTE]
>
> 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.

Element creation is asynchronous. Poll the element result endpoint after submitting the task:

```bash theme={null}
curl --location --request GET 'https://geekai.co/api/v1/elements/{task_id}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY'
```

When `task_status` is `succeed`, retrieve the element ID from `task_result.elements[0].element_id` and use it in a video request:

```bash theme={null}
curl --location --request POST 'https://geekai.co/api/v1/videos/generations' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer $GEEKAI_API_KEY' \
--data '{
    "action": "omni-video",
    "model": "kling-video-4.0",
    "prompt": "Generate a video using the custom element @element_1",
    "extra_body": {
        "element_list": [
            {
                "id": "element_1",
                "element_id": "<CUSTOM_ELEMENT_ID>"
            }
        ]
    },
    "async": true
}'
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.