> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Kling 4.0 Flash Text to Video

> The Kling 4.0 Flash Text to Video API turns a prompt of up to 26,000 characters into a 3–20 second 720p video in five aspect ratios.

> [!TIP]
>
> 1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
> 2. Regardless of whether `callback_url` is provided, you can retrieve the result through the unified [Query Task Status](https://docs.vidgo.ai/api-manual/task-management/status.md) endpoint.

Kling 4.0 Flash Text to Video generates a 3–20 second 720p video from a text prompt. Describe the action, camera movement, lighting and sound cues in one prompt and choose from five aspect ratios, a fast fit for drafts, social clips and batch production.

Kling 4.0 Flash is the faster 720p tier of Kuaishou's Kling 4.0 video model. Vidgo exposes it as four model IDs: [Text to Video](https://docs.vidgo.ai/api-manual/video-series/kwaivgi-kling-v4-0-flash-text-to-video.md), [Image to Video](https://docs.vidgo.ai/api-manual/video-series/kwaivgi-kling-v4-0-flash-image-to-video.md), [Reference to Video](https://docs.vidgo.ai/api-manual/video-series/kwaivgi-kling-v4-0-flash-reference-to-video.md) and [Video Edit](https://docs.vidgo.ai/api-manual/video-series/kwaivgi-kling-v4-0-flash-video-edit.md).

## Models

* **kwaivgi/kling-v4.0-flash/text-to-video** — Text-to-video with Kling 4.0 Flash, 3–20 seconds at 720p.

## Features

* Prompts up to 26,000 characters for detailed action, camera, lighting and sound direction.
* Any whole-second duration from 3 to 20 seconds.
* Five aspect ratios: `auto`, `16:9`, `9:16`, `1:1`, `21:9`.
* 720p output in a single pass.

## Required parameters

* `prompt` (string): Scene description, 1–26,000 characters after trimming.

## Optional parameters

* `duration` (integer): Output length, `3`–`20` seconds. Default `5`.
* `resolution` (string): `720p`. Default `720p`.
* `aspect_ratio` (string): `auto`, `16:9`, `9:16`, `1:1` or `21:9`. Default `16:9`.

## Output

The finished task returns one 720p MP4 video in the `files` array of [Query Task Status](https://docs.vidgo.ai/api-manual/task-management/status.md) and the callback payload.

## Examples

* **Wildlife tracking shot**: a red fox trots across a snowy Hokkaido pine clearing at blue hour, 5 seconds, `16:9` ([result](https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4)).
* **Vertical close-up**: a potter's hands raise a stoneware vase on a spinning wheel, 5 seconds, `9:16` ([result](https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/02/output.mp4)).

## Notes

* `duration` takes whole numbers (or integer strings) from 3 to 20.
* Put `model` and `callback_url` at the request root, next to `input`. `input` accepts the fields listed above; other fields return 400.
* Credits are reserved at submission and scale with the output duration at the 720p rate. A failed task is refunded in full. See the [pricing page](https://vidgo.ai/apis/api-pricing) for current rates.


## OpenAPI

````yaml api-manual/video-series/kwaivgi-kling-v4-0-flash-text-to-video.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Kling 4.0 Flash Text to Video
  description: >-
    The Kling 4.0 Flash Text to Video API turns a prompt of up to 26,000
    characters into a 3–20 second 720p video in five aspect ratios.
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Kling 4.0 Flash Text to Video
      summary: Submit Kling 4.0 Flash Text to Video Task
      operationId: submitKling40FlashTextToVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              wildlife-tracking-shot:
                summary: Landscape wildlife tracking shot
                value:
                  model: kwaivgi/kling-v4.0-flash/text-to-video
                  input:
                    prompt: >-
                      Wildlife documentary tracking shot at blue hour in a snowy
                      Hokkaido pine clearing: a wild red fox trots smoothly
                      across deep untouched powder snow, leaving crisp paw
                      prints, warm breath misting in the freezing air. Midway it
                      pauses, ears pivoting sharply as a clump of snow slips off
                      a dark cedar bough behind it. Natural twilight, steady
                      lateral tracking camera, no cuts. Audio: soft crunching
                      snow footsteps, gentle winter wind through pine needles.
                      No text, no logos, no watermarks.
                    duration: 5
                    resolution: 720p
                    aspect_ratio: '16:9'
              vertical-close-up:
                summary: Vertical close-up
                value:
                  model: kwaivgi/kling-v4.0-flash/text-to-video
                  input:
                    prompt: >-
                      Vertical documentary close-up inside a quiet rural
                      ceramics workshop: an artisan's wet clay-covered hands
                      gently raise the rim of a tall stoneware vase on a
                      smoothly spinning wooden wheel. Fine water droplets
                      glisten on the clay as dust motes drift through warm
                      late-afternoon window shafts. Shallow depth of field, slow
                      steady push-in. Audio: rhythmic wooden wheel hum and soft
                      wet clay slip. No logos, no readable text, no watermarks.
                    duration: 5
                    resolution: 720p
                    aspect_ratio: '9:16'
      responses:
        '200':
          description: >-
            Task submission result. A task ID identifies asynchronous work;
            generation may still be running.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: kwaivgi/kling-v4.0-flash/text-to-video
        callback_url:
          type: string
          format: uri
          description: Optional webhook URL for completion or failure notifications.
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 26000
              description: >-
                Scene description: action, camera movement, lighting and sound
                cues. 1–26,000 characters after trimming.
            duration:
              type: integer
              minimum: 3
              maximum: 20
              default: 5
              description: Output length in whole seconds, 3–20.
            resolution:
              type: string
              enum:
                - 720p
              default: 720p
              description: Output resolution. Kling 4.0 Flash outputs 720p video.
            aspect_ratio:
              type: string
              enum:
                - auto
                - '16:9'
                - '9:16'
                - '1:1'
                - '21:9'
              default: '16:9'
              description: Output aspect ratio. `auto` picks one from the prompt.
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: WEGGOG5CV8XNKEN5
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-25T11:13:02'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Error message. See [Error Codes](/api-manual/error-codes).
          example: prompt must contain 1-26000 characters
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use `Authorization: Bearer VIDGO_API_KEY`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.