Availability Update (Verified November 25, 2026):
kling-4.0-flashis now live in production on ToAPIs at$0.094/s($0.47per 5-second clip) through the unified asynchronousPOST /v1/videos/generationsinterface. This guide has been updated from our November 5, 2026 third-party schema overview to reflect the exact verified ToAPIs contract, parameter limits, runnable async code, and live pricing.
A short-video workflow needs a usable clip, not merely a successful generation response. If a product changes shape halfway through an orbit, a vertical ad gets cropped incorrectly, or an unexpected soundtrack reaches an editor, the nominal per-second rate tells you very little. kling-4.0-flash is built for rapid 720p iteration—so the right engineering lens is predictable inputs, strict contract validation, and cost per accepted clip.
1. Kling V4 Flash features and verified ToAPIs limits
kling-4.0-flash is the fast, lower-cost short-video sibling to kling-4.0 ($0.157/s). On ToAPIs, all three generation workflows—text-to-video, first-frame image-to-video, and multi-reference / video-editing omni mode—route through a single unified endpoint (POST https://api.toapis.com/v1/videos/generations) based on the media roles you pass.
| Workflow | ToAPIs kling-4.0-flash inputs | Verified boundary |
|---|---|---|
| Text to video | Required prompt (1–8,000 Unicode chars); duration 3–20 (default 5); resolution: "720p"; aspect_ratio: 16:9, 9:16, 1:1, 21:9 | Fixed 720p; auto falls back to default ratio; unsupported keys return HTTP 400 |
| Image to video | Required prompt; image_with_roles with 1 item (role: "first_frame"); duration 3–20 | Ratio follows the first frame; single first_frame only—no middle_frame or last_frame |
| Reference / Omni video | Required prompt; image_with_roles (role: "reference_image", ≤10) and/or video_with_roles (reference_video ≤5, base_video ≤1) | Max 15 total media inputs; cannot mix keyframes with references; aspect_ratio defaults to auto (adaptive); supports metadata.keep_original_sound (bool) |
Key contract boundaries vs third-party gateways
If you previously prototyped against third-party Kling gateways, note four strict differences enforced by ToAPIs' production kling-4.0-flash adapter:
- Prompt limit is
1–8,000Unicode characters (not 26,000). Empty prompts or prompts exceeding 8,000 runes are rejected before billing. - Role-based media arrays replace
start_image_urlandelements: Useimage_with_roles(first_frameorreference_image) andvideo_with_roles(reference_videoorbase_video, plusimage_urls/video_urlsshorthand for references). All media must be HTTP(S) URLs (upload local files first viaPOST /v1/uploads/imagesorPOST /v1/uploads/videos; base64 is rejected). - Explicitly rejected fields:
elements,element_list,voices,image_list,video_list,contents,audio_with_roles,multi_shot,negative_prompt,camera_control,static_mask,dynamic_masks,metadata.sound, andmetadata.audioall return HTTP 400 so silent misconfiguration cannot happen. - Auto-assigned prompt references: ToAPIs assigns
@image_1,@image_2, … and@video_1,@video_2, … automatically in submission order. Do not use@Element1syntax.
Do not silently downgrade a 1080p or 30s requirement onto kling-4.0-flash: the adapter rejects non-720p resolutions and durations above 20s. Route those jobs explicitly to kling-4.0.
2. Validate locally and submit via ToAPIs async API
Start with strict local validation that mirrors ToAPIs' exact kling-4.0-flash rules, then submit to POST https://api.toapis.com/v1/videos/generations and poll GET /v1/videos/generations/{task_id}.
import os
import time
import requests
API_BASE = "https://api.toapis.com/v1"
ALLOWED_RATIOS = {"16:9", "9:16", "1:1", "21:9", "auto", "adaptive"}
FORBIDDEN_METADATA = {
"elements", "voices", "element_list", "video_list", "image_list",
"contents", "sound", "audio", "negative_prompt", "static_mask",
"dynamic_masks", "camera_control", "multi_shot",
}
def validate_kling_4_flash(payload: dict) -> dict:
if payload.get("model") != "kling-4.0-flash":
raise ValueError("model must be 'kling-4.0-flash'")
prompt = payload.get("prompt", "")
if not isinstance(prompt, str) or not prompt.strip() or len(prompt) > 8000:
raise ValueError("prompt must be 1 to 8000 Unicode characters")
duration = payload.get("duration", 5)
if type(duration) is not int or not 3 <= duration <= 20:
raise ValueError("duration must be an integer from 3 to 20")
if payload.get("resolution", "720p").lower() != "720p":
raise ValueError("kling-4.0-flash supports 720p only")
ratio = payload.get("aspect_ratio")
if ratio is not None and ratio.lower() not in ALLOWED_RATIOS:
raise ValueError(f"unsupported aspect_ratio: {ratio}")
images = payload.get("image_with_roles", [])
videos = payload.get("video_with_roles", [])
frames = [item for item in images if item.get("role") == "first_frame"]
ref_images = [item for item in images if item.get("role") in {"reference", "reference_image", "refer_image"}]
if len(frames) + len(ref_images) != len(images):
raise ValueError("kling-4.0-flash image_with_roles only allows first_frame or reference_image")
if frames and (ref_images or videos):
raise ValueError("first_frame cannot be combined with reference images or videos")
if len(frames) > 1 or len(images) > 10:
raise ValueError("at most 1 first_frame and 10 total images are allowed")
ref_videos = [v for v in videos if v.get("role") in {"reference", "reference_video", "feature_video"}]
base_videos = [v for v in videos if v.get("role") == "base_video"]
if len(ref_videos) > 5 or len(base_videos) > 1 or (len(images) + len(videos)) > 15:
raise ValueError("limits: <=5 reference_video, <=1 base_video, <=15 total media inputs")
metadata = payload.get("metadata") or {}
bad_meta = FORBIDDEN_METADATA.intersection(metadata)
if bad_meta:
raise ValueError(f"unsupported metadata keys: {sorted(bad_meta)}")
if "keep_original_sound" in metadata:
if not isinstance(metadata["keep_original_sound"], bool):
raise ValueError("metadata.keep_original_sound must be a boolean")
if metadata["keep_original_sound"] and not videos:
raise ValueError("keep_original_sound=true requires a reference or base video")
return payload
def submit_and_poll(payload: dict, timeout_seconds: int = 600) -> str:
validate_kling_4_flash(payload)
headers = {
"Authorization": f"Bearer {os.environ['TOAPIS_API_KEY']}",
"Content-Type": "application/json",
}
resp = requests.post(
f"{API_BASE}/videos/generations",
headers=headers,
json=payload,
timeout=30,
)
resp.raise_for_status()
task_id = resp.json()["id"]
deadline = time.monotonic() + timeout_seconds
while time.monotonic() < deadline:
poll = requests.get(
f"{API_BASE}/videos/generations/{task_id}",
headers=headers,
timeout=30,
)
poll.raise_for_status()
data = poll.json()
status = data.get("status")
if status == "completed":
return data["result"]["data"][0]["url"]
if status == "failed":
raise RuntimeError(f"Video task {task_id} failed: {data.get('error')}")
time.sleep(5)
raise TimeoutError(f"Task {task_id} exceeded {timeout_seconds}s")
if __name__ == "__main__":
job = {
"model": "kling-4.0-flash",
"prompt": (
"A single matte blue ceramic cup on a warm gray table. "
"One continuous slow camera push-in, the cup stays still. "
"Soft window light from the left, no cuts, no text."
),
"duration": 5,
"resolution": "720p",
"aspect_ratio": "9:16",
}
validate_kling_4_flash(job)
print("Validated payload ready for POST /v1/videos/generations")
# Uncomment when TOAPIS_API_KEY is set:
# print("Video URL (30-day TTL):", submit_and_poll(job))
Running the script without TOAPIS_API_KEY validates the payload locally with zero spend; uncommenting submit_and_poll(job) executes the live ToAPIs task and returns the MP4 URL.
3. Choose text, first-frame, or reference generation
Use text-to-video when composition can be explored freely—one subject, one main action, and one camera move. Changing setting, lighting, and camera motion simultaneously makes prompt failures hard to diagnose.
Use first-frame image-to-video when the opening product layout must be locked. Pass one HTTP(S) image URL in image_with_roles with role: "first_frame":
{
"model": "kling-4.0-flash",
"prompt": "Slow quarter orbit around @image_1 on a warm gray tabletop; cup stays stationary, soft window light from the left, no cuts.",
"duration": 5,
"resolution": "720p",
"image_with_roles": [
{
"url": "https://cdn.example.com/assets/blue-cup-first-frame.png",
"role": "first_frame"
}
]
}
Supplying a first_frame commits the output aspect ratio to the input image (Prepare a vertical image if you need a vertical ad). Inspect the middle and final seconds of the clip, not only the thumbnail—a strong opening frame can still drift later in the shot.
Use reference / omni video when combining appearance references with motion or video-editing inputs. Pass up to 10 reference_image entries in image_with_roles, up to 5 reference_video entries, and up to 1 base_video (for editing an existing clip) in video_with_roles, staying within 15 total media inputs:
{
"model": "kling-4.0-flash",
"prompt": "Keep the matte blue ceramic cup from @image_1 and follow the slow push-in camera motion from @video_1 in a bright studio.",
"duration": 5,
"resolution": "720p",
"aspect_ratio": "auto",
"image_with_roles": [
{
"url": "https://cdn.example.com/assets/blue-cup.png",
"role": "reference_image"
}
],
"video_with_roles": [
{
"url": "https://cdn.example.com/assets/camera-motion-ref.mp4",
"role": "reference_video"
}
],
"metadata": {
"keep_original_sound": false
}
}
Preserve the submitted array order in your job database: ToAPIs numbers media sequentially as @image_1, @image_2, … and @video_1, @video_2, …. Swapping two URLs without updating the prompt reverses their roles. Reference inputs improve visual guidance, but they are not an identity warranty—define a checklist for product silhouette, colors, logos, and motion stability.

Concept illustration of three input workflows, not a Kling V4 Flash generation result or a guarantee of reference consistency.
4. Kling V4 Flash prompts and audio control
A practical prompt separates subject, motion, camera, environment, and constraints. Start with observable facts rather than generic quality adjectives. “One blue ceramic cup, fixed on the table” gives a reviewer something concrete to verify; “amazing cinematic quality” supplies no acceptance rule.
For a product movement test with a first_frame image:

Static composition example for discussing first-frame inputs and prompt design; not a verified Kling V4 Flash output.
One matte blue ceramic cup on a warm gray tabletop.
Preserve its silhouette, handle shape and blue surface.
The cup remains stationary. The camera makes a slow quarter orbit.
Soft window light stays fixed on the left. One continuous shot.
No new objects, no cuts, no on-screen text.
This brief deliberately avoids a full 360° orbit, which forces the model to hallucinate unseen surfaces. Start with a quarter orbit, verify geometry and specular highlights, and expand camera complexity only after simpler motions pass.
For vertical social clips, reserve composition space explicitly: place the subject centrally, keep key motion away from platform UI overlays, and composite final promotional typography or legal disclaimers in your editor rather than generating text inside the clip.
For reference workflows, address assets with @image_N and @video_N: “Use @image_1 for the cup's appearance and @video_1 for the slow camera push-in; keep the background neutral.”
Audio control via metadata.keep_original_sound
In reference-video mode on ToAPIs, kling-4.0-flash exposes metadata.keep_original_sound (boolean):
metadata.keep_original_sound: true(requires at least onereference_videoorbase_video): maps to upstreamaudio: "original", preserving audio from the reference video.metadata.keep_original_sound: false(supported in reference mode): maps to upstreamaudio: "native", instructing the model to generate native audio.
Do not pass metadata.sound or metadata.audio—those legacy fields are rejected with HTTP 400. Always run a separate audio QA pass to check whether speech, ambience, or music matches your brand guidelines.
5. Design the asynchronous workflow around one paid job
On ToAPIs, video generation follows the unified async task lifecycle:
- Submit:
POST https://api.toapis.com/v1/videos/generationsreturns a task ID (id) immediately. - Poll:
GET https://api.toapis.com/v1/videos/generations/{task_id}(orGET /v1/tasks/{task_id}) transitions throughqueued,in_progress, and terminalcompletedorfailed. - Retrieve & ingest: When
status == "completed", readresult.data[0].urland copy the MP4 into your own storage before the 30-day TTL expires.
Separate submission, polling, asset ingestion, and human/automated QA in your worker architecture:
- Persist
task_idbefore acknowledging the UI: Otherwise a browser refresh can trigger a duplicate paid submission. - Never auto-retry ambiguous POST timeouts: If a submission times out on the wire, reconcile with
GET /api/v1/tasksor your idempotency mapping (GET /v1/video/requests/{client_request_id}) before creating a second job. - Retry transient polling errors safely: Polling
GETcalls are read-only; honorRetry-Afteron HTTP 429 and use capped exponential backoff with jitter on 5xx responses, while failing fast on HTTP 400 validation errors. - Check media quality separately from transport success: A downloadable MP4 that fails silhouette or framing checks is a creative rejection, not a network failure—log both metrics independently.

Concept workflow: a completed generation still requires media and continuity checks before acceptance.
6. Kling V4 Flash pricing on ToAPIs: count accepted clips
As of November 25, 2026, live ToAPIs pricing for kling-4.0-flash is $0.094/second ($1 = 200 credits), billed per output second:
Clip duration (720p) | kling-4.0-flash ($0.094/s) | kling-4.0 comparison ($0.157/s) |
|---|---|---|
| 3 seconds | $0.282 | $0.471 |
| 5 seconds (default) | $0.470 | $0.785 |
| 10 seconds | $0.940 | $1.570 |
| 20 seconds (Flash max) | $1.880 | $3.140 |
Note: Reference-video workflows can carry variant-specific pricing tiers depending on input video duration relative to output duration. Always check live account rates on the ToAPIs Pricing Page or via GET /api/v1/pricing, and track spend with GET /v1/balance and GET /api/v1/usage/summary.
Nominal per-second pricing is only the numerator. Suppose a team generates 100 five-second clips on kling-4.0-flash at $0.094/s. Total generation spend is 100 × 5 × $0.094 = $47.00:
Production scenario (100 × 5s clips at $0.094/s) | Attempts | Accepted clips | Generation spend | Cost per accepted clip |
|---|---|---|---|---|
| Controlled brief (80% acceptance) | 100 | 80 | $47.00 | $0.5875 |
| Strict continuity brief (50% acceptance) | 100 | 50 | $47.00 | $0.9400 |
The second row illustrates why prompt discipline and first-frame anchoring directly control unit economics: improving pass rate from 50% to 80% cuts effective clip cost by 37.5% without changing the model rate.
Do not treat post-hoc upscaling as equivalent to native higher-resolution generation. If final delivery requires native 1080p or durations beyond 20s, evaluate kling-4.0 ($0.157/s) directly against the same acceptance pack and compare cost per accepted clip end to end.
7. Decide whether Flash fits your delivery
Build a compact three-case acceptance pack before scaling traffic:
- Stationary product + camera move (
first_frameviaimage_with_roles). - Moving subject + locked camera (text-to-video,
9:16or16:9). - Reference-guided continuity (
reference_image+reference_videowith@image_1/@video_1and explicitmetadata.keep_original_sound).
Choose kling-4.0-flash when 720p and 3–20s clips fit your target surfaces (social ads, creative storyboarding, rapid product iteration) and you want 40% lower per-second spend than kling-4.0. Choose kling-4.0 when you need 1080p, durations up to 30s, or multi-keyframe (middle_frame / last_frame) control.
Ready to integrate? Review the live Kling V4 Flash Model Guide, browse the ToAPIs Model Catalog, check current pricing, and inspect the API documentation.
8. Technical FAQ
Does Kling V4 Flash support 4K or 30-second output?
No. On ToAPIs, kling-4.0-flash supports 720p only and integer durations from 3 to 20 seconds (default 5s). For 1080p or up to 30 seconds, use kling-4.0.
Can I supply both a start frame and an end frame?
Not on kling-4.0-flash. Its image-to-video path accepts only a single first_frame via image_with_roles and rejects middle_frame and last_frame. If you need explicit first-and-last-frame transitions, use kling-4.0 or gemini-omni-1.2-flash-preview.
Can kling-4.0-flash generate or keep audio?
Yes, in reference-video mode via metadata.keep_original_sound (true keeps original video audio; false requests native generated audio). Passing metadata.sound or metadata.audio returns a validation error.
What is the confirmed ToAPIs price?
As of November 25, 2026, kling-4.0-flash is priced at $0.094/second ($0.47 for a 5-second clip). Confirm live account rates and any reference-video tier adjustments via /pricing or GET /api/v1/pricing.
Sources and update policy
- ToAPIs Production Verification (November 25, 2026): Live
kling-4.0-flashcatalog entry,POST /api/sku/quote/batchreal-time quote ($0.094/s,$0.47per 5s),kling/adaptor.govalidation contract (1–8,000char prompt,720p,3–20s,image_with_roles/video_with_roles,@image_N/@video_N,metadata.keep_original_sound), and Kling V4 Flash Model Guide. - ToAPIs Model Catalog, Pricing Page, and API Documentation.
Revision history: Originally published November 5, 2026 based on third-party queue schemas. Updated November 25, 2026 with the live ToAPIs kling-4.0-flash contract, unified async code examples, and verified $0.094/s pricing.