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

> Generate from up to 10 reference images and 5 reference videos 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/reference-to-video`\
**Generation type:** `image_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/reference-to-video",
    "input_params": {
      "prompt": "The woman from the reference image talks to the camera in a bright café, with the gestures of the reference video.",
      "image_urls": [
        "https://d35ghwdno3nak3.cloudfront.net/tutorial/avatar-aurora/recommendation-4.jpg"
      ],
      "video_urls": [
        "https://d35ghwdno3nak3.cloudfront.net/tutorial/asset-generator/sample-video.mp4"
      ]
    }
  }'
```

```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/reference-to-video",
        "input_params": {
            "prompt": "The woman from the reference image talks to the camera in a bright café, with the gestures of the reference video.",
            "image_urls": [
                "https://d35ghwdno3nak3.cloudfront.net/tutorial/avatar-aurora/recommendation-4.jpg"
            ],
            "video_urls": [
                "https://d35ghwdno3nak3.cloudfront.net/tutorial/asset-generator/sample-video.mp4"
            ]
        },
    },
)
print(response.json()["id"])
```

## Input parameters

Send these fields in `input_params`.

**prompt** `string` *required*

Reference images as @Image1, @Image2 and videos as @Video1, @Video2 in order.

Maximum characters: `2500`.

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

Output duration in seconds (3-30s). Does not trim input videos.

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

**start\_image\_url** `string`

Optional first frame. Counts toward the 10 image limit.

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

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

Reference images, referenced as @Image1, etc. Max 10 including the start image.

Maximum items: `10`.

**video\_urls** `string[]`

Reference videos, referenced as @Video1, etc. Max 5, each 3-30s and 30s combined. MP4/MOV, max 300MiB, 3-30s, 700-4553px, aspect ratio 0.40-2.50, about 24-60 fps.

Maximum items: `5`.

> **Complete JSON schema**
>
> ```json theme={null}
> {
>   "$schema": "http://json-schema.org/draft-07/schema#",
>   "required": [
>     "prompt"
>   ],
>   "properties": {
>     "prompt": {
>       "type": "string",
>       "title": "Prompt",
>       "maxLength": 2500,
>       "description": "Reference images as @Image1, @Image2 and videos as @Video1, @Video2 in order.",
>       "x-support-types": [
>         "mentions"
>       ]
>     },
>     "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": "Output duration in seconds (3-30s). Does not trim input videos."
>     },
>     "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."
>     },
>     "start_image_url": {
>       "type": "string",
>       "title": "Start Image",
>       "timeout": 20,
>       "min_width": 300,
>       "min_height": 300,
>       "description": "Optional first frame. Counts toward the 10 image limit.\n\nJPEG/PNG. Max file size: 30MiB, Min width: 300px, Min height: 300px, Min aspect ratio: 0.40, Max aspect ratio: 2.50, Timeout: 20.0s",
>       "max_file_size": 31457280,
>       "min_aspect_ratio": 0.4,
>       "max_aspect_ratio": 2.5,
>       "x-ui-name": "start_image"
>     },
>     "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 including the start image.",
>       "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"
>       }
>     },
>     "video_urls": {
>       "type": "array",
>       "title": "Reference Videos",
>       "maxItems": 5,
>       "items": {
>         "type": "string",
>         "limit_description": "Max 300MiB, 3-30s each, MP4/MOV, 700-4553px, aspect ratio 0.40-2.50, about 24-60 fps. 30s combined."
>       },
>       "description": "Reference videos, referenced as @Video1, etc. Max 5, each 3-30s and 30s combined. 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,
>       "max_total_duration": 30
>     }
>   }
> }
> ```

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