# Kling 4.0 Flash

Kling 4.0 Flash is the lighter member of Kuaishou's Kling 4.0 family. On SeedRouter it covers text to video and reference-based generation: up to 10 reference images, up to 5 reference videos and up to 7 elements (named subjects built from 2–4 images or one short video), each mentioned in the prompt. Every clip is 3–20 seconds at 720p with sound. Send the request, keep the returned task ID, and read the finished video from the task. Media goes in as URLs.

## Model IDs

| Model ID          | Inputs                                             | Resolution | Length       |
| ----------------- | -------------------------------------------------- | ---------- | ------------ |
| `kling-4-0-flash` | text, reference images, reference videos, elements | `720p`     | 3–20 seconds |

See the [model page](https://seedrouter.ai/models/kling-4-0-flash#pricing) for current prices.

## Quick example

```bash
curl https://api.seedrouter.ai/v1/videos/generations \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-4-0-flash",
    "prompt": "A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.",
    "duration": 5,
    "aspect_ratio": "16:9"
  }'
```

```python
import os
import requests

response = requests.post(
    "https://api.seedrouter.ai/v1/videos/generations",
    headers={"Authorization": f"Bearer {os.environ['SEEDROUTER_API_KEY']}"},
    json={
        "model": "kling-4-0-flash",
        "prompt": "A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.",
        "duration": 5,
        "aspect_ratio": "16:9",
    },
    timeout=60,
)
response.raise_for_status()
task_id = response.json()["id"]
```

```javascript
const response = await fetch('https://api.seedrouter.ai/v1/videos/generations', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.SEEDROUTER_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    model: 'kling-4-0-flash',
    prompt: 'A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.',
    duration: 5,
    aspect_ratio: '16:9',
  }),
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
const { id: taskId } = await response.json();
```

```go
package main

import (
    "encoding/json"
    "fmt"
    "net/http"
    "os"
    "strings"
    "time"
)

func main() {
    body := strings.NewReader(`{
      "model": "kling-4-0-flash",
      "prompt": "A paper boat drifts down a rain-filled city gutter at dusk, the camera skimming the water beside it past glowing shop windows, raindrops ticking on the surface. No text, no logos.",
      "duration": 5,
      "aspect_ratio": "16:9"
    }`)
    req, err := http.NewRequest("POST", "https://api.seedrouter.ai/v1/videos/generations", body)
    if err != nil { panic(err) }
    req.Header.Set("Authorization", "Bearer " + os.Getenv("SEEDROUTER_API_KEY"))
    req.Header.Set("Content-Type", "application/json")
    client := &http.Client{Timeout: 60 * time.Second}
    res, err := client.Do(req)
    if err != nil { panic(err) }
    defer res.Body.Close()
    if res.StatusCode != http.StatusOK { panic(res.Status) }
    var task struct { ID string `json:"id"` }
    if err := json.NewDecoder(res.Body).Decode(&task); err != nil { panic(err) }
    fmt.Println(task.ID)
}
```

## Endpoint

```text
POST https://api.seedrouter.ai/v1/videos/generations
```

| Header        | Value                 |
| ------------- | --------------------- |
| Authorization | `Bearer YOUR_API_KEY` |
| Content-Type  | `application/json`    |

The response is a task (`{"id": "task_...", "status": "processing"}`), not the finished video. Poll `GET /v1/tasks/{task_id}` for the result. Keep API keys in server-side code.

## Parameters

| Field                 | Type        | Default  | Notes                                                                                                                               |
| --------------------- | ----------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `model`               | string      | required | `kling-4-0-flash`                                                                                                                   |
| `prompt`              | string      | required | Up to 8,000 characters. Mention materials as `@image_1`, `@video_1` or `@<element name>` (see Mentions).                            |
| `duration`            | integer     | `5`      | 3–20 seconds of output.                                                                                                             |
| `resolution`          | enum        | `720p`   | `720p` is the only output.                                                                                                          |
| `aspect_ratio`        | enum        | by input | `auto`, `16:9`, `9:16`, `1:1`, `21:9`. Left out: `auto` when any reference material is given, `16:9` otherwise.                     |
| `image_urls`          | URL list    | none     | Reference images, up to 10, mentioned as `@image_1`, `@image_2`, … in order.                                                        |
| `video_urls`          | URL list    | none     | Reference videos, up to 5, mentioned as `@video_1`, `@video_2`, … Billed at the video-input rate.                                   |
| `keep_original_sound` | boolean     | `false`  | Keep the reference videos' own audio. Only takes effect with `video_urls`; without reference videos the clip always gets new sound. |
| `elements`            | object list | none     | Subjects for this request, up to 7, mentioned as `@name` (see Elements).                                                            |

Every clip comes with sound; there is no sound switch. There are no first, middle or last frame fields, no `negative_prompt`, `watermark` or standalone `voices` field: bind a voice to an element with `voice_url`. The schema is strict: unknown fields are rejected rather than ignored. `callback_url` is not available; poll the task instead.

## Mentions

Every material you send is optional; with none, the request is plain text to video. Once you send materials, point at them from the prompt:

| Material     | Mention                   | Limit                                        |
| ------------ | ------------------------- | -------------------------------------------- |
| `image_urls` | `@image_1`, `@image_2`, … | 10 images                                    |
| `video_urls` | `@video_1`, `@video_2`, … | 5 videos                                     |
| `elements`   | `@name`                   | 7 elements, at most 3 of them video elements |

Every `@` followed by a letter, digit, underscore or Chinese character must name a material of this request, or the request is rejected before anything is charged. Names are matched longest first and without regard to case. A name that ends in a letter, digit or underscore cannot run straight into another one: `@image_12` with a single image is rejected; write `@image_1 2` or `@image_1,`.

Reference videos plus video elements are at most 5, and images, videos and elements together at most 15.

```json
{
  "model": "kling-4-0-flash",
  "prompt": "The dancer from @image_1 performs the routine of @video_1 on a rooftop at dusk",
  "image_urls": ["https://example.com/dancer.png"],
  "video_urls": ["https://example.com/routine.mp4"],
  "keep_original_sound": false,
  "duration": 8
}
```

## Elements

An element is a named subject you can reuse in the prompt. There are two kinds:

| Field         | Image element                                                                                   | Video element                                                                      |
| ------------- | ----------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------- |
| `name`        | required                                                                                        | required                                                                           |
| `type`        | `image` (default)                                                                               | `video`                                                                            |
| `image_urls`  | 2–4 views, the first being the main view                                                        | not accepted                                                                       |
| `video_url`   | not accepted                                                                                    | one 3–8 second single-shot video of a character, shortest side at least 700 pixels |
| `tag`         | `character`, `animal`, `prop`, `costume`, `scene`, `effect` or `others`; inferred when left out | `character` only                                                                   |
| `description` | up to 100 characters                                                                            | up to 100 characters                                                               |
| `voice_url`   | reference audio; characters only (`tag` `character` or left out)                                | reference audio; left out, the video's own speech is used                          |

Names are 1–20 letters, digits, underscores or Chinese characters, unique without regard to case. `image_N`, `video_N`, `keyframe_N`, `object_N`, `audio_N`, `first_frame` and `last_frame` are reserved.

```json
{
  "model": "kling-4-0-flash",
  "prompt": "@Mira opens the shop door and greets the morning crowd",
  "elements": [
    {
      "name": "Mira",
      "image_urls": ["https://example.com/mira-front.png", "https://example.com/mira-side.png"],
      "tag": "character",
      "description": "baker in a flour-dusted apron"
    }
  ],
  "aspect_ratio": "9:16",
  "duration": 6
}
```

## Media inputs

Images, videos and audio are public HTTP(S) URLs. Base64 data URIs are not accepted: upload the files to your own storage and pass their URLs. Reference videos and video elements together must be 2–20 seconds long; their length is read when the request is accepted, and a video whose length cannot be read is rejected before anything is charged.

## Pricing dimensions

Check the [model pricing section](https://seedrouter.ai/models/kling-4-0-flash#pricing) for current rates. Kling 4.0 Flash is billed per second of 720p video:

```text
text, reference images, image elements:   cost = duration × standard rate
reference videos or video elements:       cost = (output + max(output, input)) × video-input rate
```

`input` is the summed length of the reference videos and video elements, rounded up to whole seconds. It is measured when the request is accepted, so the amount reserved is the amount charged. Example: a 5-second clip guided by a 7.2-second reference video bills 5 + 8 = 13 seconds; with a 3-second reference video it bills 5 + 5 = 10 seconds. Failed tasks are not charged.

## Output schema

Submission returns the task:

```json
{"id": "task_...", "model": "kling-4-0-flash", "status": "processing", "created_at": 1789689600}
```

### Get the task

```text
GET https://api.seedrouter.ai/v1/tasks/{task_id}
```

Poll every 10–20 seconds until `status` is `completed` or `failed`. A network timeout while polling does not mean generation failed: keep the task ID and resume checking it. Do not create another task to check progress.

### Completed task

```json
{
  "id": "task_...",
  "model": "kling-4-0-flash",
  "status": "completed",
  "created_at": 1789689600,
  "finished_at": 1789689800,
  "output": {
    "video_url": "https://static.seedrouter.ai/media/tasks/task_example/0.mp4"
  }
}
```

In our tests 5-second clips came back as MP4 (H.264) at 1280 × 720 with a stereo AAC track, 91–103 seconds after submission; the file runs about one frame longer than `duration` (5.04 seconds for 5).

## Errors

Requests rejected before a task is created return an HTTP error with an `error` object and are not charged. A task that fails after acceptance returns HTTP 200 when queried, with `status: "failed"` and an `error` object.

See the [shared error catalog](https://seedrouter.ai/docs/api/errors) for codes, HTTP statuses, and retry guidance.

```json
{
  "id": "task_...",
  "model": "kling-4-0-flash",
  "status": "failed",
  "error": {
    "code": 60001,
    "message": "The request was rejected by the content policy. Please revise the prompt or input images."
  }
}
```

If submission itself times out, check your tasks before submitting again: the first request may have been accepted.

## Tips

* Describe subject, place, camera move, light and sound; the clip's audio follows the prompt.
* Use Flash to try prompts, ratios and references cheaply, then move the shot that works to [Kling 4.0](https://seedrouter.ai/docs/kling-4-0) when you need 1080p, keyframes, editing or extension.
* Give a recurring character an element with two or three clear views instead of one reference image.
* Add `no text, no logos` to keep invented marks out.

## Related

* [Kling 4.0 Flash Playground and pricing](https://seedrouter.ai/models/kling-4-0-flash)
* [Kling 4.0 API reference](https://seedrouter.ai/docs/kling-4-0)
* [Download OpenAPI](https://seedrouter.ai/docs/kling-4-0-flash.openapi.json)
* [Copyable Markdown](https://seedrouter.ai/docs/kling-4-0-flash.md)
