> ## 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 文生视频

> Kling 4.0 Flash 文生视频 API 将最多 26,000 字符的提示词生成为 3–20 秒的 720p 视频，支持五种宽高比。

> [!TIP]
>
> 1. 提交后会返回 `task_id`。如果提供了 `callback_url`，当任务状态变为 `finished` 或 `failed` 时，系统会向 `callback_url` 发送 POST 请求。
> 2. 无论是否提供 `callback_url`，都可以通过统一的[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口获取结果。

Kling 4.0 Flash 文生视频根据文本提示词生成 3–20 秒的 720p 视频。在一段提示词中描述动作、运镜、光线和声音提示，并从五种宽高比中选择，适合快速出草稿、社媒短片和批量生产。

Kling 4.0 Flash 是快手 Kling 4.0 视频模型中速度更快的 720p 版本。Vidgo 提供四个模型 ID：[文生视频](https://docs.vidgo.ai/zh/api-manual/video-series/kwaivgi-kling-v4-0-flash-text-to-video.md)、[图生视频](https://docs.vidgo.ai/zh/api-manual/video-series/kwaivgi-kling-v4-0-flash-image-to-video.md)、[参考生视频](https://docs.vidgo.ai/zh/api-manual/video-series/kwaivgi-kling-v4-0-flash-reference-to-video.md)和[视频编辑](https://docs.vidgo.ai/zh/api-manual/video-series/kwaivgi-kling-v4-0-flash-video-edit.md)。

## 模型

* **kwaivgi/kling-v4.0-flash/text-to-video** — Kling 4.0 Flash 文生视频，3–20 秒，720p。

## 功能

* 提示词最多 26,000 个字符，可详细描述动作、运镜、光线和声音。
* 时长可选 3 到 20 秒之间的任意整数秒。
* 五种宽高比：`auto`、`16:9`、`9:16`、`1:1`、`21:9`。
* 一次生成 720p 视频。

## 必填参数

* `prompt` (string)：场景描述，去除首尾空白后 1–26,000 个字符。

## 可选参数

* `duration` (integer)：输出时长，`3`–`20` 秒。默认 `5`。
* `resolution` (string)：`720p`。默认 `720p`。
* `aspect_ratio` (string)：`auto`、`16:9`、`9:16`、`1:1` 或 `21:9`。默认 `16:9`。

## 输出

任务完成后，[查询任务状态](https://docs.vidgo.ai/zh/api-manual/task-management/status.md)接口和回调内容的 `files` 数组中返回一个 720p MP4 视频。

## 示例

* **野生动物跟拍**：蓝调时刻，一只赤狐小跑穿过北海道雪中松林，5 秒，`16:9` ([结果](https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/01/output.mp4))。
* **竖屏特写**：陶艺师在转动的拉坯机上拉高一只炻器花瓶，5 秒，`9:16` ([结果](https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/text-to-video/v1/02/output.mp4))。

## 注意事项

* `duration` 接收 3 到 20 的整数（或整数字符串）。
* `model` 和 `callback_url` 放在请求根级，与 `input` 并列。`input` 接收上文列出的字段，其他字段返回 400。
* 积分在提交时预扣，按输出时长以 720p 费率计费。任务失败全额退还。当前费率见[定价页](https://vidgo.ai/apis/api-pricing)。


## OpenAPI

````yaml zh/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 文生视频
  description: Kling 4.0 Flash 文生视频 API 将最多 26,000 字符的提示词生成为 3–20 秒的 720p 视频，支持五种宽高比。
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: 生产环境服务器
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Kling 4.0 Flash Text to Video
      summary: 提交 Kling 4.0 Flash 文生视频 任务
      operationId: submitKling40FlashTextToVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              wildlife-tracking-shot:
                summary: 横屏野生动物跟拍
                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: 竖屏特写
                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: 任务提交结果。任务 ID 标识一项异步任务；生成可能仍在进行中。
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: 请求参数无效
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: 未授权
          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: 可选的 Webhook URL，用于接收完成或失败通知。
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 26000
              description: 场景描述：动作、运镜、光线和声音提示。去除首尾空白后 1–26,000 个字符。
            duration:
              type: integer
              minimum: 3
              maximum: 20
              default: 5
              description: 输出时长，3–20 的整数秒。
            resolution:
              type: string
              enum:
                - 720p
              default: 720p
              description: 输出分辨率。Kling 4.0 Flash 输出 720p 视频。
            aspect_ratio:
              type: string
              enum:
                - auto
                - '16:9'
                - '9:16'
                - '1:1'
                - '21:9'
              default: '16:9'
              description: 输出宽高比。`auto` 根据提示词自动选择。
    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: 错误信息。参见[错误码](/zh/api-manual/error-codes)。
          example: prompt must contain 1-26000 characters
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: '使用 `Authorization: Bearer VIDGO_API_KEY`。'

````

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