# Kling 4.0

> Kling 4.0은 Kuaishou의 영상 모델로, 720p, 1080p 또는 4K 해상도로 3초에서 30초 길이의 클립을 생성합니다. 프롬프트, 첫 프레임과 마지막 프레임, 또는 참조 이미지, 영상, 오디오를 바탕으로 생성할 수 있습니다. Studio에서 열면 해상도와 길이를 선택하고 생성하기 전에 가격을 확인할 수 있습니다.

Kling 4.0 모델은 Kuaishou에서 개발한 AI 영상 생성기입니다. 모델 ID kuaishou/kling-4.0를 지정해 Kerox API로 호출하거나, 코드 작성 없이 Studio에서 생성할 수 있습니다. Kerox에서는 구독 없이 $0.1413 / 초 (공식 가격 대비 10% 할인)부터 이용할 수 있습니다.

## 요금

| 모델 | ID | 결제 방식 | Kerox 요금 | 할인 |
| --- | --- | --- | --- | --- |
| Kling 4.0 | `kuaishou/kling-4.0` | 초당 | 4K: $0.4941, 720p: $0.1413, 1080p: $0.2115 | 공식 가격보다 10% 저렴 |

- [Kling 4.0 가격](https://kerox.ai/ko/pricing#pricing-kuaishou/kling-4.0)
- [Kling 4.0 API 문서](https://kerox.ai/ko/docs/models/kuaishou/kling-4.0)
- [Kling 4.0](https://kerox.ai/ko/models/kuaishou/kling-4.0)

## Kling 4.0 소개

Kling 4.0은 Kuaishou가 개발한 영상 생성 모델로, Kling 시리즈의 최신 모델입니다. Kuaishou는 이 모델이 안정적인 움직임과 화면과 소리가 어우러지는 결과물로 전문가 수준의 제작에 한 걸음 다가섰다고 소개합니다. 아래 내용은 Kuaishou 공식 사이트를 바탕으로 정리했습니다.

### Kuaishou가 소개하는 Kling 4.0

- **전문 제작을 위한 설계.** Kuaishou는 Kling 4.0으로 전문가 수준의 영상 제작이 가능해졌다고 설명합니다.
- **안정적인 움직임.** 역동적인 장면에서도 움직임이 흔들리지 않으며, 화면과 소리가 사실감 있게 어우러지는 것으로 소개됩니다.
- **더 넓어진 카메라 제어.** Kuaishou는 지원하는 촬영 방식으로 고속 액션, 연속 동작, 트래킹 샷, 피사체 주위를 도는 오비트 샷, 클로즈업을 꼽습니다.
- **표현력 있는 캐릭터.** 섬세한 표정과 몸짓을 생생하게 담아내는 것으로 소개됩니다.
- **최대 10장의 이미지 입력.** Kuaishou의 제작 노트에 따르면 영상을 생성할 때 최대 10장의 이미지를 참고 자료로 활용할 수 있습니다.

Kerox에서 Kling 4.0은 720p, 1080p, 4K 해상도로 3~30초 길이의 영상을 16:9, 9:16, 1:1, 21:9 비율로 생성합니다. 요청 하나에 첫 프레임과 마지막 프레임을 넣을 수 있습니다. 또는 참조 이미지는 최대 10장, 참조 영상은 최대 5개, 오디오 클립은 최대 3개까지 넣을 수 있습니다. Kerox에서는 아직 기존 영상을 편집하거나 연장할 수 없습니다.

## Kling 4.0 사용 방법

1. **충전하기** $5부터 충전할 수 있습니다. 구독할 필요가 없으며 잔액은 만료되지 않습니다.
2. **영상 설정하기** 프롬프트를 작성하고 해상도, 길이, 화면 비율을 선택합니다. 필요하면 프레임이나 참조 파일을 추가합니다. 생성을 시작하기 전에 선택한 설정의 가격이 표시됩니다.
3. **생성하고 다운로드하기** 생성을 시작하면 금액이 보류되고, 영상이 완성되면 정산됩니다. 생성에 실패하면 전액 환불됩니다.

## Kling 4.0 활용 예시

- **텍스트 영상 변환.** 프롬프트만으로 3~30초 길이의 클립을 생성합니다.
- **참조 이미지 기반 영상.** 피사체, 제품 또는 배경 이미지를 최대 10장까지 넣고 원하는 컷을 설명합니다.
- **이미지 영상 변환.** 첫 프레임에서 시작하거나 첫 프레임과 마지막 프레임을 지정합니다.
- **4K 롱테이크.** 한 번의 생성으로 해상도는 4K까지, 길이는 30초까지 만들 수 있어 한 장면을 온전히 담기에 충분합니다.
- **참조 영상 기반 클립.** 참조 영상을 추가해 모션을 반영하고, 원하면 참조 영상의 원본 사운드를 결과물에 포함할 수 있습니다.

## Kling 4.0 vs Kerox의 다른 모델

이 모델들은 모두 같은 잔액을 공유하며 동일한 API를 사용합니다. 모델을 바꾸려면 모델 ID를 변경하고, 전환할 모델이 지원하는 설정만 사용하면 됩니다. 시작 가격은 표에서 확인할 수 있습니다.

| 모델 | 선택하면 좋은 경우 | 시작 가격 |
| --- | --- | --- |
| [Kling 4.0](https://kerox.ai/ko/models/kuaishou/kling-4.0) | 720p, 1080p 또는 4K 해상도로 3~30초 길이의 클립을 생성합니다. 긴 클립이 필요하거나 1080p 또는 4K 해상도가 필요할 때 적합합니다. | 4K: $0.4941, 720p: $0.1413, 1080p: $0.2115 |
| [Kling 4.0 Flash](https://kerox.ai/ko/models/kuaishou/kling-4.0-flash) | Kling 4.0의 Flash 모델로, 720p 해상도의 3~20초 클립을 생성합니다. 레퍼런스 이미지와 영상은 지원하지만 레퍼런스 오디오는 지원하지 않습니다. 초안 작업이나 대량 생성에 적합합니다. | 720p: $0.0846 |
| [Seedance 2.5](https://kerox.ai/ko/models/bytedance/seedance-2.5) | ByteDance의 영상 모델로, 최대 1080p 해상도의 4~30초 클립을 생성하며 레퍼런스 이미지를 최대 30장까지 사용할 수 있습니다. 레퍼런스가 많이 필요한 클립이나, 모델이 생성하는 사운드를 필요에 따라 끌 수 있어야 하는 클립에 적합합니다. | 약 $0.0977 / 초부터 (480p) |
| [Magi-2](https://kerox.ai/ko/models/sand-ai/magi-2) | Sand AI의 영상 모델로, 1080p 해상도에서 사운드를 포함해 최대 30초까지 생성합니다. 대사나 사운드가 있는 긴 1080p 클립에 적합합니다. | 1080p: $0.1000 |
| [Seedance 2.0](https://kerox.ai/ko/models/bytedance/seedance-2.0) | ByteDance의 영상 모델로, 4~15초 클립을 생성하며 4K 출력을 지원합니다. 짧은 4K 클립에 적합합니다. | 약 $0.0668 / 초부터 (480p) |
| [MiniMax H3](https://kerox.ai/ko/models/minimax/h3) | MiniMax의 영상 모델로, 768p 또는 2K 해상도의 4~15초 클립을 생성합니다. 같은 프롬프트를 다른 제작사의 모델로 시험해 볼 때 적합합니다. | 2K: $0.0650, 768p: $0.0400 |
| [Wan 3.0](https://kerox.ai/ko/models/alibaba/wan-3.0) | Alibaba의 영상 모델로, 최대 1080p 해상도의 2~30초 클립을 생성합니다. 3초보다 짧은 클립에 적합합니다. | 480p: $0.0400, 720p: $0.0800, 1080p: $0.1600 |

## FAQ

### Kling 4.0 가격은 얼마입니까?

Kerox에서 Kling 4.0 모델은 $0.1413 / 초부터 (공식 가격 대비 10% 할인) 이용할 수 있습니다. 생성 건당 결제하며, 실패한 생성에는 요금이 부과되지 않습니다. 모든 옵션은 이 페이지의 가격표에서 확인할 수 있습니다.

### Kling 4.0 모델에서 API를 사용할 수 있습니까?

네. 모델 ID kuaishou/kling-4.0로 Kerox API에 작업을 제출한 뒤, 작업 상태를 폴링하거나 작업 완료 시 Webhook 알림을 받을 수 있습니다. Kling 4.0의 API 문서에서 모든 파라미터와 코드 예제를 확인할 수 있습니다.

### 코드 작성 없이 온라인에서 Kling 4.0 모델을 사용할 수 있습니까?

네. Kerox Studio에서 Kling 4.0 모델을 열고 프롬프트를 작성하면 브라우저에서 생성할 수 있습니다. Studio와 API는 같은 잔액을 사용합니다.

### Kling 4.0 모델을 사용하려면 구독이 필요합니까?

아니요. 요금제나 월 요금이 없습니다. 최소 $5부터 충전할 수 있으며, 생성한 만큼만 결제합니다.

### Kling 4.0 사용 방법은 무엇입니까?

Kerox에 로그인한 후 Studio에서 Kling 4.0 모델을 열고 프롬프트를 작성하면 브라우저에서 생성할 수 있습니다. 코드에서 사용하려면 API 키를 만든 후 모델 ID kuaishou/kling-4.0로 작업을 제출하면 됩니다.

### Kling 4.0은 무료입니까?

Kerox에서는 Kling 4.0을 무료로 이용할 수 없습니다. 현재 무료 플랜이나 무료 체험은 제공하지 않습니다. $5부터 충전하고 생성한 만큼만 결제하면 됩니다.

### Kling 4.0 영상은 얼마나 길게 만들 수 있습니까?

한 번 생성할 때 3초부터 30초까지 초 단위로 설정할 수 있습니다. 기본값은 5초입니다. Kling 4.0 Flash는 최대 20초입니다.

### Kling 4.0은 4K를 지원합니까?

네. Kerox에서 Kling 4.0은 720p, 1080p 또는 4K 해상도로 영상을 생성합니다. 이 모델은 출력 1초당 해상도별 요금으로 과금되므로, 4K 클립은 같은 클립을 720p로 생성할 때보다 비용이 더 많이 듭니다. 위 요금표에서 해상도별 대표 클립의 가격 예시를 확인할 수 있습니다.

### Kling 4.0과 Kling 4.0 Flash의 차이점은 무엇입니까?

길이, 해상도, 지원하는 입력 유형이 다릅니다. Kling 4.0은 720p, 1080p 또는 4K로 3~30초 길이의 영상을 생성하며, 참조 이미지, 영상, 오디오를 입력으로 받습니다. Kling 4.0 Flash는 720p로만 3~20초 길이의 영상을 생성하며, 참조 이미지와 영상은 받지만 오디오는 받지 않습니다. 요금도 모델마다 다르며, 위의 비교표에서 각 모델의 현재 시작 가격을 확인할 수 있습니다.

### Kling 4.0에서 참조 이미지, 영상, 오디오를 사용할 수 있습니까?

네. 한 요청에 이미지는 최대 10개, 영상은 합계 30초 이내로 최대 5개, 오디오 클립은 각 5~30초 길이로 최대 3개까지 포함할 수 있습니다. 첫 프레임 또는 마지막 프레임은 같은 요청에서 참조 파일과 함께 사용할 수 없습니다. 참조 영상의 소리를 사용하려면 `keep_original_sound`를 true로 설정합니다.

### 참조 영상을 사용하면 Kling 4.0의 가격이 어떻게 달라집니까?

초당 요금과 요금이 부과되는 길이가 모두 달라집니다. 참조 영상을 사용하면 초당 요금은 낮아지지만, 생성된 영상의 길이에 출력 영상과 참조 영상 중 더 긴 쪽의 길이를 더한 만큼 요금이 부과됩니다. 생성을 시작하기 전에 Studio와 견적 엔드포인트에서 실제 요청에 대한 총액을 확인할 수 있으며, 위의 요금표에 두 요금이 모두 나와 있습니다.


---

## Request example

Submit a task and get its id at once; get the result by polling (below) or by [webhook](https://kerox.ai/ko/docs/webhooks.md). `webhook_url` and `metadata` are optional. To use a webhook, provide your own public HTTPS address in `webhook_url`. Every field is in [Submit a task](https://kerox.ai/ko/docs/tasks.md#submit-body).

Set `KEROX_API_KEY` first. Polling requires Bash, curl and jq. For Python, run `pip install requests` first.

### cURL

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/tasks \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "a red fox running through fresh snow, cinematic lighting",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
  }
}'
```

### Python

```python
import os
import requests

resp = requests.post(
    "https://api.kerox.ai/v1/tasks",
    headers={
        "Authorization": f"Bearer {os.environ['KEROX_API_KEY']}",
        "Content-Type": "application/json",
    },
    json={
        "model": "kuaishou/kling-4.0",
        "input": {
            "prompt": "a red fox running through fresh snow, cinematic lighting",
            "resolution": "720p",
            "duration": 5,
            "aspect_ratio": "16:9",
        },
    },
    timeout=60,
)
resp.raise_for_status()
task = resp.json()
print(task["id"], task["status"])  # Save the id for polling
```

### Node.js

```javascript
const res = await fetch('https://api.kerox.ai/v1/tasks', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.KEROX_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    "model": "kuaishou/kling-4.0",
    "input": {
      "prompt": "a red fox running through fresh snow, cinematic lighting",
      "resolution": "720p",
      "duration": 5,
      "aspect_ratio": "16:9"
    }
  }),
});
const task = await res.json();
if (!res.ok) throw new Error(JSON.stringify(task));
console.log(task.id, task.status); // Save the id for polling
```

### Go

```go
package main

import (
	"bytes"
	"fmt"
	"io"
	"net/http"
	"os"
	"time"
)

func main() {
	body := []byte(`{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "a red fox running through fresh snow, cinematic lighting",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
  }
}`)
	req, _ := http.NewRequest("POST", "https://api.kerox.ai/v1/tasks", bytes.NewReader(body))
	req.Header.Set("Authorization", "Bearer "+os.Getenv("KEROX_API_KEY"))
	req.Header.Set("Content-Type", "application/json")
	client := &http.Client{Timeout: 60 * time.Second}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()
	out, _ := io.ReadAll(resp.Body)
	if resp.StatusCode >= 400 {
		fmt.Fprintln(os.Stderr, string(out))
		os.Exit(1)
	}
	fmt.Println(string(out))
}
```

### Reference image

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/tasks \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "Show the red paper sailboat under warm copper lights",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "images": [
      "https://cdn.kerox.ai/assets/samples/kling-4.0/paper-sail-frame.jpg"
    ]
  }
}'
```

### First frame

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/tasks \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "Track the red paper sailboat as it drifts across the pool",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "first_frame": "https://cdn.kerox.ai/assets/samples/kling-4.0/paper-sail-frame.jpg"
  }
}'
```

### First and last frames

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/tasks \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "Circle the red paper sailboat and return to the starting view",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "first_frame": "https://cdn.kerox.ai/assets/samples/kling-4.0/paper-sail-frame.jpg",
    "last_frame": "https://cdn.kerox.ai/assets/samples/kling-4.0/paper-sail-frame.jpg"
  }
}'
```

### Reference video

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/tasks \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "Use the camera motion of Video 1 for a flyover of a rocky coastline",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "videos": [
      "https://cdn.kerox.ai/assets/samples/kling-4.0-flash/motion-reference.mp4"
    ]
  }
}'
```

### Reference audio

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/tasks \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "Show a dinosaur at dusk and time its roar to Audio 1",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "audios": [
      "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3"
    ]
  }
}'
```

## Parameters

The [parameter names](https://kerox.ai/ko/docs/models.md) mean the same on every model.

| Parameter | Type | Required | Default | Values | Description | Example |
| --- | --- | --- | --- | --- | --- | --- |
| `prompt` | string | Yes | — | at least one non-whitespace character; at least 1 characters | Text describing what to generate. | `"A lighthouse at dawn"` |
| `keep_original_sound` | boolean | No | — | true, false | Use the sound from the reference video. Requires videos. | `true` |
| `images` | string \| string[] | No | — | one public HTTPS URL; one string or an array of 1–10 items | Images for the model to draw on, in the order the prompt refers to them. | `"https://example.com/photo.png"` |
| `videos` | string \| string[] | No | — | one public HTTPS URL; one string or an array of 1–5 items; Model file limits: Up to five MP4 or MOV files, at most 30 seconds in total. Duration must be readable. Total reference seconds are rounded up. | Videos for the model to draw on, in the order the prompt refers to them. | `"https://example.com/clip.mp4"` |
| `audios` | string \| string[] | No | — | one public HTTPS URL; one string or an array of 1–3 items; Model file limits: Up to three clips of 5–30 seconds each. | Audio clips for the model to draw on, in the order the prompt refers to them. | `"https://example.com/music.wav"` |
| `first_frame` | string | No | — | one public HTTPS URL; Model file limits: JPEG or PNG. An end frame requires a first frame. Frames cannot be combined with reference media. | The image a video starts from. | `"https://example.com/start.png"` |
| `last_frame` | string | No | — | one public HTTPS URL; Model file limits: JPEG or PNG. An end frame requires a first frame. Frames cannot be combined with reference media. | The image a video ends on. Needs `first_frame`. | `"https://example.com/end.png"` |
| `aspect_ratio` | string | No | — | 16:9, 9:16, 1:1, 21:9, auto | Width to height of the output. | `"16:9"` |
| `resolution` | string | No | `"720p"` | 720p, 1080p, 4K | Output resolution tier. The exact pixels follow from it and `aspect_ratio`. | `"720p"` |
| `duration` | integer | No | `5` | 3–30 | Length of the output in whole seconds. | `5` |
| `n` | integer | No | `1` | 1 | How many outputs one task may produce. | `1` |

- last_frame requires first_frame
- keep_original_sound requires videos
- When first_frame: omit images or videos or audios
- When aspect_ratio = "auto": supply images or videos or audios

Use a public HTTPS URL directly for images, audio and video. For local media, upload with `POST /v1/files` and pass the returned `url`. For upload MIME and size limits, see [Files & inputs](https://kerox.ai/ko/docs/files.md#presigned).

Not supported yet: `watermark`.

## Polling and output

Poll `GET /v1/tasks/{id}`, or pass `webhook_url` when you submit and receive the same task object when it finishes: see [Webhooks](https://kerox.ai/ko/docs/webhooks.md) for the setup. Output files expire at `expires_at` (7 days after completion), so download anything you want to keep. See every task field in [Tasks & polling](https://kerox.ai/ko/docs/tasks.md#submit-response).

Set `TASK_ID` to the `id` returned on submission. The script waits up to 10 minutes, prints `error` on failure and downloads every `outputs[].url` on success.

```bash
(
  set -eu
  # Set TASK_ID to the id returned by the submit request.
  : "${TASK_ID:?Set TASK_ID}"
  deadline=$((SECONDS + 600))
  while (( SECONDS < deadline )); do
    task=$(curl --fail-with-body --silent --show-error --max-time "$((deadline - SECONDS))" https://api.kerox.ai/v1/tasks/"$TASK_ID" \
      -H "Authorization: Bearer $KEROX_API_KEY")
    case $(jq -er .status <<< "$task") in
      succeeded)
        if ! jq -e '.outputs | length > 0' <<< "$task" >/dev/null; then
          echo "Result files are unavailable." >&2
          exit 1
        fi
        i=0
        while IFS= read -r url; do
          file_path=${url%%\?*}
          filename="output-${i}.${file_path##*.}"
          curl --fail-with-body --silent --show-error --max-time 120 "$url" -o "$filename"
          printf "%s\n" "$filename"
          i=$((i + 1))
        done < <(jq -r '.outputs[].url' <<< "$task")
        exit 0 ;;
      failed) jq -c .error <<< "$task" >&2; exit 1 ;;
      processing) sleep 2 ;;
      *) echo "Unexpected task status." >&2; exit 1 ;;
    esac
  done
  echo "Poll timed out. Keep TASK_ID to check again later." >&2
  exit 1
)
```

### Success response JSON

Actual charges depend on your account price and task result.

```json
{
  "id": "task_01JD8X9B4Q2M7T8N3K5P6R1S0V",
  "object": "task",
  "model": "kuaishou/kling-4.0",
  "status": "succeeded",
  "source": "api",
  "format": "unified",
  "input": {
    "prompt": "a red fox running through fresh snow, cinematic lighting",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
  },
  "outputs": [
    {
      "type": "video",
      "url": "https://cdn.kerox.ai/t/task_01JD8X9B4Q2M7T8N3K5P6R1S0V/5f2b8c1e9d3a4f6b8a7c0d1e2f3a4b5c/0.mp4",
      "content_type": "video/mp4",
      "duration": 5
    }
  ],
  "outputs_deleted": false,
  "error": null,
  "cost": {
    "amount": "0.7065",
    "currency": "USD",
    "status": "settled"
  },
  "metadata": null,
  "warnings": [],
  "created_at": "2026-11-20T08:00:00Z",
  "started_at": "2026-11-20T08:00:01Z",
  "completed_at": "2026-11-20T08:01:10Z",
  "expires_at": "2026-11-27T08:01:10Z"
}
```

## Pricing

| Tier | Official / second | Kerox / second | Below official price |
| --- | --- | --- | --- |
| 4K | $0.5490 | $0.4941 | 10% |
| 720p | $0.1570 | $0.1413 | 10% |
| 1080p | $0.2350 | $0.2115 | 10% |

- **With a reference video**, bill output seconds + max(output seconds, total reference seconds) at `4K` $0.2961/s (official $0.3290); `720p` $0.0846/s (official $0.0940); `1080p` $0.1269/s (official $0.1410).

### Estimate before submitting

The returned `amount` is what submitting would hold. An estimate creates no task and charges nothing. When `exact` is `false`, the final charge may differ from the hold.

### Without a reference video

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/estimate \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "a red fox running through fresh snow, cinematic lighting",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9"
  }
}'
```

### With a reference video

```bash
curl --fail-with-body -X POST https://api.kerox.ai/v1/estimate \
  -H "Authorization: Bearer $KEROX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kuaishou/kling-4.0",
  "input": {
    "prompt": "a red fox running through fresh snow, cinematic lighting",
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "videos": [
      "https://cdn.kerox.ai/assets/samples/seedance-2.0/sea-stacks-fog.mp4"
    ]
  }
}'
```

## Common usage

| Clip | Official price | Kerox | You save |
| --- | --- | --- | --- |
| 5 s · 4K | $2.7450 | $2.4705 | 10% |
| 10 s · 4K | $5.4900 | $4.9410 | 10% |
| 15 s · 4K | $8.2350 | $7.4115 | 10% |
| 5 s · 720p | $0.7850 | $0.7065 | 10% |
| 10 s · 720p | $1.5700 | $1.4130 | 10% |
| 15 s · 720p | $2.3550 | $2.1195 | 10% |
| 5 s · 1080p | $1.1750 | $1.0575 | 10% |
| 10 s · 1080p | $2.3500 | $2.1150 | 10% |
| 15 s · 1080p | $3.5250 | $3.1725 | 10% |

- **$10 gets you**: 70 seconds of 720p video

## Input schema (JSON)

### Parameters (`unified.input_schema`)

```json
{
  "type": "object",
  "allOf": [
    {
      "if": {
        "required": [
          "first_frame"
        ],
        "properties": {
          "first_frame": true
        }
      },
      "then": {
        "not": {
          "anyOf": [
            {
              "required": [
                "images"
              ],
              "properties": {
                "images": true
              }
            },
            {
              "required": [
                "videos"
              ],
              "properties": {
                "videos": true
              }
            },
            {
              "required": [
                "audios"
              ],
              "properties": {
                "audios": true
              }
            }
          ]
        }
      }
    },
    {
      "if": {
        "required": [
          "aspect_ratio"
        ],
        "properties": {
          "aspect_ratio": {
            "const": "auto"
          }
        }
      },
      "then": {
        "anyOf": [
          {
            "required": [
              "images"
            ],
            "properties": {
              "images": true
            }
          },
          {
            "required": [
              "videos"
            ],
            "properties": {
              "videos": true
            }
          },
          {
            "required": [
              "audios"
            ],
            "properties": {
              "audios": true
            }
          }
        ]
      }
    }
  ],
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "required": [
    "prompt"
  ],
  "properties": {
    "prompt": {
      "type": "string",
      "pattern": "\\S",
      "minLength": 1,
      "description": "Text describing what to generate.",
      "x-label-en": "Prompt",
      "x-label-zh": "提示词",
      "x-tier": "common"
    },
    "keep_original_sound": {
      "type": "boolean",
      "description": "Use the sound from the reference video. Requires videos.",
      "x-label-en": "Keep original sound",
      "x-label-zh": "保留参考视频原声",
      "x-tier": "advanced"
    },
    "images": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^https://"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^https://"
          },
          "maxItems": 10,
          "minItems": 1
        }
      ],
      "description": "Images for the model to draw on, in the order the prompt refers to them.",
      "x-label-en": "Reference images",
      "x-label-zh": "参考图",
      "x-tier": "common"
    },
    "videos": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^https://"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^https://"
          },
          "maxItems": 5,
          "minItems": 1
        }
      ],
      "description": "Videos for the model to draw on, in the order the prompt refers to them.",
      "x-label-en": "Reference videos",
      "x-label-zh": "参考视频",
      "x-tier": "advanced"
    },
    "audios": {
      "oneOf": [
        {
          "type": "string",
          "pattern": "^https://"
        },
        {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^https://"
          },
          "maxItems": 3,
          "minItems": 1
        }
      ],
      "description": "Audio clips for the model to draw on, in the order the prompt refers to them.",
      "x-label-en": "Reference audio",
      "x-label-zh": "参考音频",
      "x-tier": "advanced"
    },
    "first_frame": {
      "type": "string",
      "pattern": "^https://",
      "description": "The image a video starts from.",
      "x-label-en": "First frame",
      "x-label-zh": "首帧",
      "x-tier": "common"
    },
    "last_frame": {
      "type": "string",
      "pattern": "^https://",
      "description": "The image a video ends on. Needs `first_frame`.",
      "x-label-en": "Last frame",
      "x-label-zh": "尾帧",
      "x-tier": "advanced"
    },
    "aspect_ratio": {
      "enum": [
        "16:9",
        "9:16",
        "1:1",
        "21:9",
        "auto"
      ],
      "type": "string",
      "description": "Width to height of the output.",
      "x-label-en": "Aspect ratio",
      "x-label-zh": "画面比例",
      "x-tier": "common"
    },
    "resolution": {
      "enum": [
        "720p",
        "1080p",
        "4K"
      ],
      "type": "string",
      "default": "720p",
      "description": "Output resolution tier. The exact pixels follow from it and `aspect_ratio`.",
      "x-label-en": "Resolution",
      "x-label-zh": "分辨率",
      "x-tier": "common"
    },
    "duration": {
      "type": "integer",
      "default": 5,
      "maximum": 30,
      "minimum": 3,
      "description": "Length of the output in whole seconds.",
      "x-label-en": "Duration",
      "x-label-zh": "时长",
      "x-tier": "common"
    },
    "n": {
      "type": "integer",
      "const": 1,
      "default": 1,
      "description": "How many outputs one task may produce.",
      "x-label-en": "Number of outputs",
      "x-label-zh": "生成数量",
      "x-tier": "advanced"
    }
  },
  "x-unsupported": [
    "watermark"
  ],
  "dependentRequired": {
    "last_frame": [
      "first_frame"
    ],
    "keep_original_sound": [
      "videos"
    ]
  },
  "additionalProperties": false
}
```
