# Kling Video V4

> Run Kling Video V4 by klingai online or via API. $0.157/s at 720p, $0.235/s at 1080p, no setup.

**URL:** https://inference.sh/apps/klingai/video-v4
**Last updated:** 2026-11-11

---

Kling V4.0 video generation. Text-to-video and image-to-video with start and end frames, 3-30s billed per second, 720p or 1080p, native audio and automatic shot-splitting.

- app: `klingai/video-v4`
- maker: [klingai](https://inference.sh/apps/klingai.md)
- category: [video](https://inference.sh/apps/category/video.md)
- input → output: text → video, image → video
- tasks: [text to video](https://inference.sh/apps/tag/text-to-video.md), [image to video](https://inference.sh/apps/tag/image-to-video.md), [native audio](https://inference.sh/apps/tag/native-audio.md)
- price: $0.157/s at 720p, $0.235/s at 1080p
- runs via: api, javascript and python sdk, belt cli, mcp

## video-v4 API Guide

### About
kling v4.0 video generation. text-to-video and image-to-video with start and end frames, 3-30s billed per second, 720p or 1080p, native audio and automatic shot-splitting.

### Get an API Key
Create one in [settings → api keys](https://app.inference.sh/settings/keys). The examples read it from `INFERENCE_API_KEY`.

```bash
export INFERENCE_API_KEY="inf_your_key"
```

### 1. Calling the API

#### Install the Client

```bash
pip install inferencesh
```

#### Run and Get Result
Submit a request and wait for the final result.

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## version @4q459ahe pinned
result = client.run({
        "app": "klingai/video-v4@4q459ahe",
        "input": {
            "prompt": "A cinematic drone shot sweeping over a coastal city at golden hour, waves crashing against the harbor"
        }
    })

print(result["output"])
```

#### Stream Live Updates
Get real-time progress updates as the task runs.

```python
import os
from inferencesh import inference

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## version @4q459ahe pinned
## stream=True yields updates as they arrive
for update in client.run({
        "app": "klingai/video-v4@4q459ahe",
        "input": {
            "prompt": "A cinematic drone shot sweeping over a coastal city at golden hour, waves crashing against the harbor"
        }
    }, stream=True):
    if update.get("progress"):
        print(f"progress: {update['progress']}%")
    if update.get("output"):
        print(f"output: {update['output']}")
```

#### Run in the Background
Start the task and get its id back right away, then check on it with `GET /tasks/{id}`. It is done when `status` is 10 (completed), 11 (failed) or 12 (cancelled).

```python
import os
from inferencesh import inference, TaskStatus

client = inference(api_key=os.environ["INFERENCE_API_KEY"])

## returns as soon as the task is created
task = client.run({
        "app": "klingai/video-v4@4q459ahe",
        "input": {
            "prompt": "A cinematic drone shot sweeping over a coastal city at golden hour, waves crashing against the harbor"
        }
    }, wait=False)

## later: read its current state
state = client.tasks.get(task["id"]).data
if state["status"] == TaskStatus.COMPLETED:
    print(state["output"])
```

### 2. Files

#### Automatic Upload

```python
## local file paths are automatically uploaded
result = client.run({
    "app": "klingai/video-v4@4q459ahe",
    "input": {
        "image": "/path/to/local/image.png",  # detected & uploaded
        "audio": "https://example.com/audio.mp3",  # url passed through
    }
})
```

#### Manual Upload

```python
## upload and get a hosted URL
file = client.files.upload("/path/to/file.png")
print(file.uri)  # https://cloud.inference.sh/...
```

### 3. Schema

#### Input
- **prompt** (string) *required*: Text prompt describing the video content. A duration set here takes precedence over one named in the prompt.
- **image** (string): Start frame image for image-to-video. Formats: jpg, jpeg, png. Max 30MB, min 300px per side, aspect ratio between 2:5 and 5:2.
- **end_image** (string): End frame image. Requires image to be set as start frame.
- **resolution** (string): Video resolution.
- **aspect_ratio** (string): Video aspect ratio. Text-to-video only; with an image the video follows the image.
- **duration** (integer): Video duration in seconds (3-30). Billed per second.

#### Output
- **video** (string): The generated video file.

## other video apps

- [Pika H3 Flex (self-hosted)](https://inference.sh/apps/pika/pika-h3-flex-oss.md): GPU time, billed per millisecond
- [Pika H3 Flex Upscale](https://inference.sh/apps/pika/pika-h3-flex-upscale.md): $0.05-$0.14/sec (480p src), $0.03-$0.12/sec (768p src); 1080p/2K/4K targets
- [Pika H3 Flex Reference to Video](https://inference.sh/apps/pika/pika-h3-flex-reference.md): $0.06/sec 480p, $0.12/sec 768p, $0.15/sec 1080p, $0.16/sec 2k, $0.20/sec 4k (output+input video sec). Stems: $0.001/sec
- [Pika H3 Flex](https://inference.sh/apps/pika/pika-h3-flex.md): $0.02/sec 480p, $0.04/sec 768p, $0.07/sec 1080p, $0.08/sec 2K, $0.16/sec 4K; stems +$0.001/stem-sec
- [Gemini Omni 1.2 Flash](https://inference.sh/apps/google/gemini-omni-1-2-flash.md): $0.0232/sec 360p, $0.0695/sec 720p, $0.1043/sec 1080p, $0.2085/sec 4K, plus $1.50/M input and $9.00/M thinking tokens

## faq

### how much does Kling Video V4 cost?

$0.157/s at 720p, $0.235/s at 1080p. you pay per run from your inference shell credits. no subscription is required.

### how do I run Kling Video V4 via api?

call klingai/video-v4 with the javascript or python sdk, the rest api, or `belt app run klingai/video-v4` from a terminal. the api reference on this page lists every input.

### who makes Kling Video V4?

Kling Video V4 is made by klingai and runs on inference shell. every klingai app is listed at https://inference.sh/apps/klingai.

### can my agent use Kling Video V4?

yes. agents call it as a tool through the inference shell mcp server (https://api.inference.sh/mcp), the belt cli or the sdk, and pay per run like you do.

### what are the alternatives to Kling Video V4?

other video apps on inference shell include Pika H3 Flex (self-hosted), Pika H3 Flex Upscale, Pika H3 Flex Reference to Video, Pika H3 Flex. they run through the same api, so switching is a one-line change.
