promptstringwymagane
Text prompt for video generation. Either prompt or multi_prompt must be provided, but not both.
kwaivgi/kling-video/v3/4k/text-to-videoKling V3 4K Text to Video by Kuaishou turns a text prompt into a 3-15 second native 4K video with optional native audio.
Wypróbuj model
Co chcesz zrobić dalej?
Wybierz przykład, aby wczytać jego dane wejściowe i wynik do playgroundu.
{
"prompt": "Close-up of glowing fireflies dancing in a dark forest at twilight. Soft bioluminescent particles float through the air. Shallow depth of field, bokeh lights in background. Magical atmosphere, gentle movement."
}Kling V3 4K text-to-video: write a scene and get back a 3–15 second clip, with native audio and multi-shot control. Output is native 4K.
| Field | Type | Default | Notes |
|---|---|---|---|
prompt | string, required | — | Up to 2,500 characters. |
aspect_ratio | 16:9 / 9:16 / 1:1 | 16:9 | Output frame shape. |
duration | 3–15 | 5 | Output length in seconds. |
generate_audio | boolean | true | Generate native audio with the clip. |
multi_prompt | object[] | — | Optional list of shots, each with its own prompt and duration. |
shot_type | customize / intelligent | customize | customize follows your multi_prompt shot list; intelligent lets the model plan the cuts. |
You pay $0.42 per output second, with or without audio.
| Output | Price |
|---|---|
| 3s | $1.26 |
| 5s (default) | $2.10 |
| 10s | $4.20 |
| 15s | $6.30 |
Failed runs are not charged.
multi_prompt with one entry per shot.Other Kling V3 4K endpoints and tiers: kwaivgi/kling-video/v3/4k/image-to-video, kwaivgi/kling-video/v3/standard/text-to-video, kwaivgi/kling-video/v3/pro/text-to-video.
Zacznij tworzyć
Prześlij ten model przez 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/v3/4k/text-to-video",
"prompt": "Close-up of glowing fireflies dancing in a dark forest at twilight. Soft bioluminescent particles float through the air. Shallow depth of field, bokeh lights in background. Magical atmosphere, gentle movement.",
"duration": 5,
"shot_type": "customize",
"aspect_ratio": "16:9",
"generate_audio": true
}
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"Utwórz klucz API SandBase i ustaw go w środowisku serwera. Wszystkie żądania używają uwierzytelniania Bearer.
export SANDBASE_API_KEY="YOUR_API_KEY"Przechowuj klucz na serwerze. Nie ujawniaj go w kodzie przeglądarkowym ani nie commituj do repozytorium.
Wyślij POST do /v1/run z tym identyfikatorem modelu i jego danymi wejściowymi. Powyższy przykład żądania obejmuje wysyłanie i odpytywanie statusu.
Użyj zwróconego ID uruchomienia, aby odpytywać status do momentu completion, failed lub timeout. Odczytaj wynik dopiero po completion.
curl "https://api.sandbase.ai/v1/run/$RUN_ID" \
-H "Authorization: Bearer $SANDBASE_API_KEY"Przekaż publicznie dostępny URL pliku w polu image, video lub audio modelu. Obsługiwane formaty i limity są pokazane obok każdego pola wejściowego w Playground.
Użyj kontrolki upload lub replace w obsługiwanych polach image w Playground. Pola URL wideo akceptują hostowany film źródłowy; nie oznacza to obsługi przesyłania wideo.
promptstringwymaganeText prompt for video generation. Either prompt or multi_prompt must be provided, but not both.
durationintegerThe duration of the generated video in seconds
Domyślnie: 5
Możliwe wartości: 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15
shot_typestringThe type of multi-shot video generation. 'intelligent' lets the model automatically determine shot structure.
Domyślnie: "customize"
Możliwe wartości: "customize", "intelligent"
aspect_ratiostringThe aspect ratio of the generated image.
Domyślnie: "16:9"
Możliwe wartości: "16:9", "9:16", "1:1"
multi_promptarrayList of prompts for multi-shot video generation. If provided, overrides the single prompt and divides the video into multiple shots with specified prompts and durations.
generate_audiobooleanWhether to generate native audio for the video. Supports Chinese and English voice output. Other languages are automatically translated to English. For English speech, use lowercase letters; for acronyms or proper nouns, use uppercase.
Domyślnie: true
{
"model": "kwaivgi/kling-video/v3/4k/text-to-video",
"prompt": "Close-up of glowing fireflies dancing in a dark forest at twilight. Soft bioluminescent particles float through the air. Shallow depth of field, bokeh lights in background. Magical atmosphere, gentle movement.",
"duration": 5,
"shot_type": "customize",
"aspect_ratio": "16:9",
"generate_audio": true
}Zakończone uruchomienie udostępnia swój wynik w output. Poniżej znajduje się zapisany przykład modelu, a nie nowa generacja.
[
{
"poster": "https://static.sandbase.ai/examples/posters/b58a784a894237addece.jpg",
"source": "Kling AI official schema mirror",
"source_url": "https://kling.ai/document-api/guides/get-started/overview",
"url": "https://static.sandbase.ai/examples/a320ac54-733b-4c48-9e1c-e34183e1f2a5/output/9b7ab3bc-23c2-492c-aafe-34840d1a31a1.mp4"
}
]