> ## 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 (edit video) Video to Video API

> Edit or re-create an input video with optional reference images, with native audio. Up to 30s and 4K.

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

**Model name:** `kling-video/v4/video-to-video/edit`\
**Generation type:** `video_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.

These prices assume no billable reference inputs. The charge goes up for each second of reference video (up to 15 seconds).

## Quick start

The example uses sample media from our CDN. Swap in publicly accessible URLs for your own files.

```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/video-to-video/edit",
    "input_params": {
      "prompt": "Change the setting to a bright café while she keeps talking.",
      "video_url": "https://d35ghwdno3nak3.cloudfront.net/tutorial/asset-generator/sample-video.mp4",
      "duration": "5"
    }
  }'
```

```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/video-to-video/edit",
        "input_params": {
            "prompt": "Change the setting to a bright café while she keeps talking.",
            "video_url": "https://d35ghwdno3nak3.cloudfront.net/tutorial/asset-generator/sample-video.mp4",
            "duration": "5"
        },
    },
)
print(response.json()["id"])
```

## Input parameters

Send these fields in `input_params`.

**prompt** `string` *required*

Reference the source video as @Video1 and reference images as @Image1, etc.

Maximum characters: `2500`.

**video\_url** `string` *required*

Video to edit. MP4/MOV, max 300MiB, 3-30s, 700-4553px, aspect ratio 0.40-2.50, about 24-60 fps.

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

Desired output duration in seconds (3-30s). Required; does not trim the input video.

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"`.

**image\_urls** `string[]`

Reference images, referenced as @Image1, etc. Max 10.

Maximum items: `10`.

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

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

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

> **Complete JSON schema**
>
> ```json theme={null}
> {
>   "$schema": "http://json-schema.org/draft-07/schema#",
>   "required": [
>     "prompt",
>     "video_url",
>     "duration"
>   ],
>   "properties": {
>     "prompt": {
>       "type": "string",
>       "title": "Prompt",
>       "maxLength": 2500,
>       "description": "Reference the source video as @Video1 and reference images as @Image1, etc.",
>       "x-support-types": [
>         "mentions"
>       ]
>     },
>     "video_url": {
>       "type": "string",
>       "title": "Source Video",
>       "description": "Video to edit. MP4/MOV, max 300MiB, 3-30s, 700-4553px, aspect ratio 0.40-2.50, about 24-60 fps.",
>       "max_file_size": 314572800,
>       "min_duration": 3,
>       "max_duration": 30,
>       "min_width": 700,
>       "max_width": 4553,
>       "min_height": 700,
>       "max_height": 4553,
>       "min_aspect_ratio": 0.4,
>       "max_aspect_ratio": 2.5,
>       "timeout": 30
>     },
>     "image_urls": {
>       "type": "array",
>       "title": "Reference Images",
>       "timeout": 20,
>       "maxItems": 10,
>       "min_width": 300,
>       "min_height": 300,
>       "description": "Reference images, referenced as @Image1, etc. Max 10.",
>       "max_file_size": 31457280,
>       "min_aspect_ratio": 0.4,
>       "max_aspect_ratio": 2.5,
>       "items": {
>         "type": "string",
>         "limit_description": "JPEG/PNG. Max file size: 30MiB, Min width: 300px, Min height: 300px, Min aspect ratio: 0.40, Max aspect ratio: 2.50, Timeout: 20.0s"
>       }
>     },
>     "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": "Desired output duration in seconds (3-30s). Required; does not trim the input video."
>     },
>     "resolution": {
>       "enum": [
>         "720p",
>         "1080p",
>         "2k",
>         "4k"
>       ],
>       "type": "string",
>       "title": "Resolution",
>       "default": "720p",
>       "description": "Output resolution (720p, 1080p, 2K, 4K).",
>       "x-advance-settings": true
>     }
>   }
> }
> ```

## 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.