ToAPIs
    HomeToAPIs
    Image GenerationGPT Image 2.6, Gemini, FLUX…Video GenerationSeedance, Veo, Kling, Sora…Chat & WritingGPT-5.6, Claude, DeepSeek…Speech & MusicVoiceover, TTS, Audio
    New ReleaseSeedance 2.5
    PricingAPI DocsMCP
    BlogAlternatives
    Log InStart Free
    All ModelsPricingAPI DocsMCPBlogAlternatives
    Log InStart Free

    Language

    1. Home
    2. Blog
    3. Video APIs
    4. Kling V4 Flash API: Features, Limits and ToAPIs Workflow
    Back to all posts
    video2026-11-058 min read

    Kling V4 Flash API: Features, Limits and ToAPIs Workflow

    Integrate Kling V4 Flash (kling-4.0-flash) on ToAPIs: 720p and 3–20s limits, 8000-char prompt, image_with_roles and video_with_roles, async polling, and $0.094/s pricing.

    ToAPIs Engineering & Evaluation Team
    Developer education
    Kling V4 FlashVideo GenerationAPI IntegrationPrompt GuidePricing
    TL;DR - Key Takeaways
    • Update (November 25, 2026): Kling V4 Flash is live on ToAPIs under model ID `kling-4.0-flash` at `$0.094/s` (`$0.47` for a 5-second clip) through the unified asynchronous `POST https://api.toapis.com/v1/videos/generations` endpoint.
    • Verified ToAPIs limits for `kling-4.0-flash`: fixed `720p` output, integer duration `3–20` seconds (default `5`), `1–8000` Unicode-character prompt, and ratios `16:9`, `9:16`, `1:1`, `21:9` (plus `auto`/`adaptive` in reference mode).
    • Use `image_with_roles` (`first_frame` only for image-to-video, or `reference_image` up to 10 images) and `video_with_roles` (`reference_video` up to 5, `base_video` up to 1; max 15 total media inputs); `elements`/`element_list` are rejected, and ToAPIs auto-assigns `@image_N` / `@video_N` references.
    • In reference-video mode, ToAPIs exposes `metadata.keep_original_sound` (boolean) to switch between `original` and `native` audio; poll `GET /v1/videos/generations/{task_id}` (`queued`, `in_progress`, `completed`, `failed`) and download `result.data[0].url` within its 30-day TTL.

    Availability Update (Verified November 25, 2026): kling-4.0-flash is now live in production on ToAPIs at $0.094/s ($0.47 per 5-second clip) through the unified asynchronous POST /v1/videos/generations interface. 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.

    WorkflowToAPIs kling-4.0-flash inputsVerified boundary
    Text to videoRequired prompt (1–8,000 Unicode chars); duration 3–20 (default 5); resolution: "720p"; aspect_ratio: 16:9, 9:16, 1:1, 21:9Fixed 720p; auto falls back to default ratio; unsupported keys return HTTP 400
    Image to videoRequired prompt; image_with_roles with 1 item (role: "first_frame"); duration 3–20Ratio follows the first frame; single first_frame only—no middle_frame or last_frame
    Reference / Omni videoRequired 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:

    1. Prompt limit is 1–8,000 Unicode characters (not 26,000). Empty prompts or prompts exceeding 8,000 runes are rejected before billing.
    2. Role-based media arrays replace start_image_url and elements: Use image_with_roles (first_frame or reference_image) and video_with_roles (reference_video or base_video, plus image_urls / video_urls shorthand for references). All media must be HTTP(S) URLs (upload local files first via POST /v1/uploads/images or POST /v1/uploads/videos; base64 is rejected).
    3. 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, and metadata.audio all return HTTP 400 so silent misconfiguration cannot happen.
    4. Auto-assigned prompt references: ToAPIs assigns @image_1, @image_2, … and @video_1, @video_2, … automatically in submission order. Do not use @Element1 syntax.

    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}.

    python
    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":

    json
    {
      "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:

    json
    {
      "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.

    Text, first-frame image and reference inputs illustrated with a blue ceramic cup

    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:

    Matte blue ceramic cup on a neutral tabletop with soft light from the left

    Static composition example for discussing first-frame inputs and prompt design; not a verified Kling V4 Flash output.

    text
    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 one reference_video or base_video): maps to upstream audio: "original", preserving audio from the reference video.
    • metadata.keep_original_sound: false (supported in reference mode): maps to upstream audio: "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:

    1. Submit: POST https://api.toapis.com/v1/videos/generations returns a task ID (id) immediately.
    2. Poll: GET https://api.toapis.com/v1/videos/generations/{task_id} (or GET /v1/tasks/{task_id}) transitions through queued, in_progress, and terminal completed or failed.
    3. Retrieve & ingest: When status == "completed", read result.data[0].url and 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_id before 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/tasks or your idempotency mapping (GET /v1/video/requests/{client_request_id}) before creating a second job.
    • Retry transient polling errors safely: Polling GET calls are read-only; honor Retry-After on 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.

    Video request, queue, generation and review leading to an accepted clip

    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)AttemptsAccepted clipsGeneration spendCost per accepted clip
    Controlled brief (80% acceptance)10080$47.00$0.5875
    Strict continuity brief (50% acceptance)10050$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:

    1. Stationary product + camera move (first_frame via image_with_roles).
    2. Moving subject + locked camera (text-to-video, 9:16 or 16:9).
    3. Reference-guided continuity (reference_image + reference_video with @image_1 / @video_1 and explicit metadata.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-flash catalog entry, POST /api/sku/quote/batch real-time quote ($0.094/s, $0.47 per 5s), kling/adaptor.go validation contract (1–8,000 char 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.

    Explore Models Mentioned in This Post

    KuaishouVIDEO

    Kling V4 Flash

    Current Rate: 18.8 credits /second
    Model GuideTry in ConsoleGet API Key
    KuaishouVIDEO

    kling-4.0

    Current Rate: 31.4 credits /second
    Model GuideTry in ConsoleGet API Key
    KuaishouVIDEO

    Kling V3 Turbo

    Current Rate: 16 credits /second
    Model GuideTry in ConsoleGet API Key
    KuaishouVIDEO

    kling-v3-omni

    Current Rate: 12 credits /second
    Model GuideTry in ConsoleGet API Key

    Related Articles

    comparison2026-11-3015 min read

    MAGI-2 vs Seedance 2.5 vs Kling 4.0: Video API Guide

    Compare MAGI-2 vs Seedance 2.5 vs Kling 4.0 on ToAPIs: unified async video API schemas, strict 400 validation rules, per-second vs per-token costs, and routing code.

    TO
    ToAPIs Engineering & Evaluation Team
    #MAGI-2
    tutorial2026-11-128 min read

    Seedance 2.5 Flash: Features, Prompts & API Guide

    Complete developer guide to Seedance 2.5 Flash (seedance-2-5-flash) on ToAPIs: 480p/720p up to 30s, generate/edit/extend modes, multimodal references, original prompts, working API code, and live per-token pricing.

    TO
    ToAPIs Engineering & Evaluation Team
    #Seedance 2.5 Flash
    tutorial2026-11-069 min read

    Gemini Omni 1.2 Flash API: ToAPIs Contract, Limits & Pricing

    Integrate Gemini Omni 1.2 Flash (gemini-omni-1.2-flash-preview) on ToAPIs at $0.20/request: 4–15s video, first/last frames or 5 references, current route limits, and Google vendor comparison.

    TO
    ToAPIs Engineering & Evaluation Team
    #Gemini Omni 1.2 Flash
    ToAPIs
    HomeToAPIs
    Enterprise AI API Gateway. Access GPT-5, Claude, Gemini and 200+ models through one unified API.

    Popular Models

    • Seedance 2.5 API
    • Seedance 2.0 API
    • Veo 3.1 Fast API
    • Kling 3.0 Turbo API
    Show moreShow less
    • GPT Image 2 API
    • Claude Opus 4.8 API
    • Nano Banana 2 API
    • Seedance 2 Mini API
    • All models

    API Categories

    • AI Image API
    • AI Video API
    • Text-to-Video API
    • Image-to-Video API
    Show moreShow less
    • AI Image Editing API
    • LLM & Reasoning API
    • All API tools →

    Alternatives

    Alternatives
    • Kie.ai alternative
    • Fal.ai alternative
    • OpenRouter alternative
    • Replicate alternative
    • Wavespeed AI alternative
    • All comparisons →

    Featured Guides

    Featured Guides
    • Seedance 2.0 vs 2.5 pricing
    • Cheapest Seedance API guide
    • MiniMax H3 integration guide
    • Free Seedance 2 API key
    • Seedance 2 API quickstart
    • All engineering posts →

    Developers & Platform

    Developers & Platform
    • API documentation
    • MCP
    • Pricing
    • Model playground
    • LLMs.txt
    • Contact support
    • Model guide directory
    Operating entity:
    鯨樞智能科技有限公司
    JINGSHU INTELLIGENT LIMITED
    Registered office:
    ROOM 5042, 5/F, YAU LEE CENTRE, NO.45, HOI YUEN ROAD, KWUN TONG, KOWLOON, HONG KONG
    PrivacyTermsAcceptable UseData DeletionData RetentionSubprocessors & RegionsBilling & RefundsCookie PolicySitemapAbout

    © 2026 ToAPIs. All rights reserved.