promptstringrequired
Describe subject, action, camera and light.
kwaivgi/kling-video/v4/flash/text-to-videoKling V4 Flash Text to Video by Kuaishou turns a text prompt into a 3-20 second 720p video at a lower price than Kling V4.
Try the model
What would you like to do next?
Select an example to load its inputs and result into the playground.
{
"aspect_ratio": "16:9",
"prompt": "Elegant luxury resort film, one continuous camera move with no cuts: from an unmade bed, out through open glass doors, across a teak deck and down to the waterline as a guest dives in for the first swim of the day just as the sun breaks the horizon. Soft golden light, gentle lens flare, sound of waves and birds."
}{
"aspect_ratio": "16:9",
"prompt": "A small paper boat sails across a rain puddle on a city sidewalk at dusk, neon signs reflect and ripple in the water, raindrops patter around it and a tram bell rings in the distance, low camera at water level."
}Kling V4 Flash text-to-video is the faster, lower-cost tier of Kling V4: write a scene and get back a 3–20 second 720p clip with sound.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Describe subject, action, camera and light. |
aspect_ratio | 16:9 / 9:16 / 1:1 / 21:9 | 16:9 | Output frame shape. |
duration | 3–20 | 5 | Output length in seconds. |
Billed per output second: $0.094 at 720p.
| Output | Price |
|---|---|
| 5s (default) | $0.47 |
| 10s | $0.94 |
| 20s | $1.88 |
| Failed runs are not charged. |
Other Kling V4 Flash endpoints: kwaivgi/kling-video/v4/flash/text-to-video, kwaivgi/kling-video/v4/flash/image-to-video, kwaivgi/kling-video/v4/flash/reference-to-video, kwaivgi/kling-video/v4/flash/video-edit. For 1080p or clips up to 30 seconds, use Kling V4 (kwaivgi/kling-video/v4/text-to-video and its siblings).
Start building
Submit this model through the SandBase Unified Run API.
# The quoted heredoc keeps Unicode and shell metacharacters unchanged.
result=$(curl --fail-with-body --silent \
-X POST "https://api.sandbase.ai/v1/run" \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
-H "Content-Type: application/json" \
--data-binary @- <<'SANDBASE_JSON'
{
"model": "kwaivgi/kling-video/v4/flash/text-to-video",
"prompt": "A detective in a black trench coat stands on a rooftop in the rain, looking through a telescope at the street below.",
"duration": 5,
"aspect_ratio": "16:9"
}
SANDBASE_JSON
)
run_id=$(printf '%s' "$result" | jq -r .id)
for attempt in $(seq 1 120); do
status=$(printf '%s' "$result" | jq -r .status)
case "$status" in completed|failed|timeout) break ;; esac
sleep 2
result=$(curl --fail-with-body --silent \
-H "Authorization: Bearer $SANDBASE_API_KEY" \
"https://api.sandbase.ai/v1/run/$run_id")
done
status=$(printf '%s' "$result" | jq -r .status)
[ "$status" = completed ] || { echo "Generation ended: $status" >&2; exit 1; }
printf '%s\n' "$result"Create a SandBase API key and set it in your server environment. All requests use Bearer authentication.
export SANDBASE_API_KEY="YOUR_API_KEY"Keep the key on your server. Do not expose it in browser code or commit it to a repository.
POST to /v1/run with this model ID and its inputs. The request example above includes submission and polling.
Use the returned run ID to poll until the status is completed, failed or timeout. Read output only after completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Pass a publicly accessible file URL in the model’s image, video or audio field. Supported formats and limits are shown beside each Playground input.
Use the upload or replace control on supported image fields in the Playground. Video URL fields accept a hosted driving video; they do not imply video-upload support.
promptstringrequiredDescribe subject, action, camera and light.
durationintegerOutput length in seconds (3-20).
Default: 5
Minimum: 3
Maximum: 20
aspect_ratiostringOutput frame shape.
Default: "16:9"
Possible values: "16:9", "9:16", "1:1", "21:9"
{
"model": "kwaivgi/kling-video/v4/flash/text-to-video",
"prompt": "A detective in a black trench coat stands on a rooftop in the rain, looking through a telescope at the street below.",
"duration": 5,
"aspect_ratio": "16:9"
}A completed run exposes its result in output. The following is the model’s saved example, not a new generation.
[
{
"url": "https://static.sandbase.ai/examples/79bf908a-a650-4831-9195-97d003cbfeac/output/6a0241e6-ddaa-4c3e-9e2a-3b3593ab5967.mp4"
}
]