promptstringwajib
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.
Coba model ini
Apa yang ingin Anda lakukan selanjutnya?
Pilih contoh untuk memuat input dan hasilnya ke 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).
Mulai membangun
Kirim model ini melalui 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"Buat SandBase API key dan atur di environment server Anda. Semua permintaan menggunakan autentikasi Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Simpan key di server. Jangan tampilkan di kode browser atau commit ke repository.
POST ke /v1/run dengan ID model ini dan inputnya. Contoh permintaan di atas mencakup pengiriman dan polling.
Gunakan run ID yang dikembalikan untuk polling sampai status completed, failed, atau timeout. Baca output hanya setelah completed.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Kirim URL file yang dapat diakses publik di field image, video, atau audio model. Format dan batas yang didukung ditampilkan di samping setiap input Playground.
Gunakan kontrol upload atau replace pada field gambar yang didukung di Playground. Field URL video menerima video driving yang di-host; ini tidak berarti dukungan upload video.
promptstringwajibDescribe subject, action, camera and light.
durationintegerOutput length in seconds (3-20).
Default: 5
Minimum: 3
Maksimum: 20
aspect_ratiostringOutput frame shape.
Default: "16:9"
Nilai yang mungkin: "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"
}Run yang selesai menampilkan hasilnya di output. Berikut adalah contoh tersimpan model ini, bukan generasi baru.
[
{
"url": "https://static.sandbase.ai/examples/79bf908a-a650-4831-9195-97d003cbfeac/output/6a0241e6-ddaa-4c3e-9e2a-3b3593ab5967.mp4"
}
]