# KwaiVGI Kling V4 Reference to Video API

> Kling V4 Reference to Video by Kuaishou generates a 3-30 second video that keeps characters, objects and motion from reference images and videos.

Source: https://www.sandbase.ai/models/kwaivgi/kling-video/v4/reference-to-video
API reference: https://www.sandbase.ai/models/kwaivgi/kling-video/v4/reference-to-video/docs

## Facts

- Provider: KwaiVGI
- Type: Video model
- Model ID: `kwaivgi/kling-video/v4/reference-to-video`
- Price: From $1.18 per run
- Capabilities: reference to video
- Billing: pay per use from one SandBase balance; no provider account or subscription needed

## Call it

- Unified Run API: `POST https://api.sandbase.ai/v1/run`

```bash
curl -X POST https://api.sandbase.ai/v1/run \
  -H "Authorization: Bearer $SANDBASE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model": "kwaivgi/kling-video/v4/reference-to-video",
  "prompt": "@Element1 and @Element2 are having dinner at the table in @Image1",
  "duration": 5,
  "resolution": "1080p"
}'
```

The response returns a run id; poll `GET https://api.sandbase.ai/v1/run/{id}` until the status is `completed` or `failed`.

## FAQ

### How do I call KwaiVGI Kling V4 Reference to Video through SandBase?

Create a SandBase API key, then send requests with the model ID "kwaivgi/kling-video/v4/reference-to-video" to Unified Run API (/v1/run) at https://api.sandbase.ai. The request examples on this page show the exact payload.

### Do I need a separate KwaiVGI account?

No. One SandBase API key and balance gives you access to KwaiVGI Kling V4 Reference to Video and the other models in the catalog; you do not need to sign up with KwaiVGI separately.

## README

### Kling V4 Reference to Video
Kling V4 reference-to-video keeps characters, objects and motion from reference images and videos in a new 3–30 second clip.
#### Fields
| Field | Type | Default | Notes |
|---|---|---|---|
| `prompt` | string, required | — | Refer to inputs as `@Image1`, `@Video1`, … |
| `images` | image URL[] | — | Up to 10 reference images. |
| `videos` | video URL[] | — | Up to 5 reference videos, 3–30s each, 30s combined. |
| `voice_ids` | string[] | — | Up to 2 custom voice IDs. Create one at [Kling Create Voice](https://www.sandbase.ai/model/kwaivgi/kling-video/create-voice). Not combinable with `videos`. |
| `aspect_ratio` | `21:9` / `16:9` / `9:16` / `1:1` | — | Leave empty to follow the references. |
| `resolution` | `720p` / `1080p` | `1080p` | Output resolution. |
| `duration` | 3–30 | 5 | Output length in seconds. |
#### Billing
Without reference videos: $0.157 per output second at 720p, $0.235 at 1080p.
With reference videos: $0.094 (720p) or $0.141 (1080p) per second of output plus input, where the input side counts at least as long as the output. The quote before submission assumes 30 seconds of reference video when the length cannot be read.
| Request | Price |
|---|---|
| 5s, 1080p, images only (default) | $1.175 |
| 5s, 720p, images only | $0.785 |
| 5s, 1080p, 8s reference video | $1.833 |
| 10s, 720p, 4s reference video | $1.88 |
Failed runs are not charged.
#### Prompting
- Name each reference in the prompt, e.g. "@Image1 walks into the scene from @Video1".
- To make a character speak in a cloned voice, upload a 5–30 second recording at [Kling Create Voice](https://www.sandbase.ai/model/kwaivgi/kling-video/create-voice) to get a `voice_id`, pass its ID in `voice_ids`, and write the line in the prompt, e.g. "The man from @Image1 says: \"Welcome back.\"". Every clip has a soundtrack; without `voice_ids` the voice is chosen by the model.
#### Limits
- Clips are 3–30 seconds; reference videos 3–30 seconds.
#### Also on SandBase
Other Kling V4 endpoints: `kwaivgi/kling-video/v4/text-to-video`, `kwaivgi/kling-video/v4/image-to-video`, `kwaivgi/kling-video/v4/reference-to-video`, `kwaivgi/kling-video/v4/video-edit`.
