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

# Kling 4.0 Text to Video API

> Kling 4.0 with native audio. Up to 30s and 4K output; text-to-video and single start-frame image-to-video.

[← Kling](https://docs.creatify.ai/api-documentation/ai-generation/models/kling.md)

**Model name:** `kling-video/v4/text-to-video`\
**Generation type:** `text_to_video`\
**Endpoint:** [`POST /api/asset_generator/`](https://docs.creatify.ai/api-reference/ai-generation/post-ai-generation)

## Pricing

| Duration | 720p | 1080p | 2k | 4k |
| - | - | - | - | - |
| 3s | **2.5** | **3.5** | **4.0** | **6.5** |
| 4s | **3.0** | **4.5** | **5.5** | **8.5** |
| 5s | **3.5** | **5.5** | **6.5** | **10.5** |
| 6s | **4.5** | **6.5** | **8.0** | **13.0** |
| 7s | **5.0** | **7.5** | **9.0** | **15.0** |
| 8s | **6.0** | **8.5** | **10.5** | **17.0** |
| 9s | **6.5** | **9.5** | **11.5** | **19.0** |
| 10s | **7.0** | **10.5** | **13.0** | **21.0** |
| 11s | **8.0** | **12.0** | **14.0** | **23.5** |
| 12s | **8.5** | **13.0** | **15.5** | **25.5** |
| 13s | **9.5** | **14.0** | **16.5** | **27.5** |
| 14s | **10.0** | **15.0** | **18.0** | **29.5** |
| 15s | **10.5** | **16.0** | **19.0** | **31.5** |
| 16s | **11.5** | **17.0** | **20.5** | **34.0** |
| 17s | **12.0** | **18.0** | **21.5** | **36.0** |
| 18s | **13.0** | **19.0** | **23.0** | **38.0** |
| 19s | **13.5** | **20.0** | **24.0** | **40.0** |
| 20s | **14.0** | **21.0** | **25.5** | **42.0** |
| 21s | **15.0** | **22.5** | **26.5** | **44.5** |
| 22s | **15.5** | **23.5** | **28.0** | **46.5** |
| 23s | **16.5** | **24.5** | **29.0** | **48.5** |
| 24s | **17.0** | **25.5** | **30.5** | **50.5** |
| 25s | **17.5** | **26.5** | **31.5** | **52.5** |
| 26s | **18.5** | **27.5** | **33.0** | **55.0** |
| 27s | **19.0** | **28.5** | **34.5** | **57.0** |
| 28s | **20.0** | **29.5** | **35.5** | **59.0** |
| 29s | **20.5** | **30.5** | **37.0** | **61.0** |
| 30s | **21.0** | **31.5** | **38.0** | **63.0** |

Prices are per output. When a request asks for several outputs, the charge is this price times the number of outputs.

## Quick start

```bash cURL theme={null}
curl --request POST \
  --url https://api.creatify.ai/api/asset_generator/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-ID: your-api-id' \
  --header 'X-API-KEY: your-api-key' \
  --data '{
    "model_name": "kling-video/v4/text-to-video",
    "input_params": {
      "prompt": "A slow cinematic tracking shot along a sunlit coastal road."
    }
  }'
```

```python Python theme={null}
import requests

response = requests.post(
    "https://api.creatify.ai/api/asset_generator/",
    headers={"X-API-ID": "your-api-id", "X-API-KEY": "your-api-key"},
    json={
        "model_name": "kling-video/v4/text-to-video",
        "input_params": {
            "prompt": "A slow cinematic tracking shot along a sunlit coastal road."
        },
    },
)
print(response.json()["id"])
```

## Input parameters

Send these fields in `input_params`.

**prompt** `string` *required*

Prompt

Maximum characters: `2500`.

**duration** `string` (default: 5)

The duration of the generated video in seconds

Allowed values: `"3"`, `"4"`, `"5"`, `"6"`, `"7"`, `"8"`, `"9"`, `"10"`, `"11"`, `"12"`, `"13"`, `"14"`, `"15"`, `"16"`, `"17"`, `"18"`, `"19"`, `"20"`, `"21"`, `"22"`, `"23"`, `"24"`, `"25"`, `"26"`, `"27"`, `"28"`, `"29"`, `"30"`.

**resolution** `string` (default: 720p)

Output resolution (720p, 1080p, 2K, 4K).

Allowed values: `"720p"`, `"1080p"`, `"2k"`, `"4k"`.

**aspect\_ratio** `string` (default: 16:9)

The aspect ratio of the generated video frame

Allowed values: `"16:9"`, `"9:16"`, `"1:1"`, `"21:9"`.

> **Complete JSON schema**
>
> ```json theme={null}
> {
>   "$schema": "http://json-schema.org/draft-07/schema#",
>   "required": [
>     "prompt"
>   ],
>   "properties": {
>     "prompt": {
>       "type": "string",
>       "title": "Prompt",
>       "maxLength": 2500
>     },
>     "duration": {
>       "enum": [
>         "3",
>         "4",
>         "5",
>         "6",
>         "7",
>         "8",
>         "9",
>         "10",
>         "11",
>         "12",
>         "13",
>         "14",
>         "15",
>         "16",
>         "17",
>         "18",
>         "19",
>         "20",
>         "21",
>         "22",
>         "23",
>         "24",
>         "25",
>         "26",
>         "27",
>         "28",
>         "29",
>         "30"
>       ],
>       "type": "string",
>       "title": "Duration",
>       "default": "5",
>       "description": "The duration of the generated video in seconds"
>     },
>     "resolution": {
>       "enum": [
>         "720p",
>         "1080p",
>         "2k",
>         "4k"
>       ],
>       "type": "string",
>       "title": "Resolution",
>       "default": "720p",
>       "description": "Output resolution (720p, 1080p, 2K, 4K).",
>       "x-advance-settings": true
>     },
>     "aspect_ratio": {
>       "enum": [
>         "16:9",
>         "9:16",
>         "1:1",
>         "21:9"
>       ],
>       "type": "string",
>       "title": "Aspect Ratio",
>       "default": "16:9",
>       "description": "The aspect ratio of the generated video frame"
>     }
>   }
> }
> ```

## Response

The request returns the task with `status: "initializing"`. Poll [GET /api/asset\_generator/\{id}/](https://docs.creatify.ai/api-reference/ai-generation/get-ai-generation-.md) until `status` is `done` or `failed`, or pass a `webhook_url` to be notified. A finished task lists its files in `assets` and the credits it charged in `credits_used`.


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