> ## 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 用最多 10 张参考图、5 个参考视频和 7 个主体引导生成 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 参考生视频根据参考图、参考视频和可复用主体（element）生成 3–20 秒的 720p 视频，让角色、服装和场景保持一致。在提示词中按顺序引用每个参考素材，如 `@Image1`、`@Video1` 或 `@Element1`。

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/reference-to-video** — Kling 4.0 Flash 参考生视频，基于图片、视频和主体，3–20 秒，720p。

## 功能

* 最多 10 张参考图、5 个参考视频和 7 个主体，合计最多 15 个素材。
* 主体可由同一对象的 2–4 张图片或一个视频构成。
* 可通过 `image_urls` 指定首帧。
* 3–20 秒，720p，五种宽高比。

## 输入模式

至少提供一种参考输入，可以组合使用：

* **参考图**（`reference_image_urls`）：用 `@Image1`、`@Image2`… 引用。
* **参考视频**（`reference_video_urls`）：用 `@Video1`、`@Video2`… 引用。按输入视频计费。
* **主体**（`kling_elements`）：用 `@Element1`、`@Element2`… 引用。视频主体按输入视频计费。

在 `image_urls` 中放一张图片可固定开场画面。

## 必填参数

* `prompt` (string)：场景描述，去除首尾空白后 1–26,000 个字符。
* `reference_image_urls`、`reference_video_urls`、`kling_elements` 至少提供一项。

## 可选参数

* `reference_image_urls` (string\[])：最多 10 个公开的 HTTP(S) 图片 URL。
* `reference_video_urls` (string\[])：最多 5 个公开的 HTTP(S) 视频 URL，每个 3–20 秒。
* `kling_elements` (object\[])：最多 7 个主体，其中视频主体最多 3 个。每个主体二选一：
  * `element_input_urls` (string\[])：该主体的 2–4 个图片 URL。
  * `element_input_video_urls` (string\[])：该主体的恰好 1 个视频 URL，3–8 秒。
* `image_urls` (string\[])：一个首帧图片 URL。
* `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/reference-to-video/v1/01/output.mp4))。

## 注意事项

* 限制：首帧加参考图 ≤ 10；全部素材（首帧、参考图、参考视频、主体）≤ 15；视频主体 ≤ 3。
* 输入视频（MP4、MOV 或 WebM，每个最大 100 MB）在提交时下载并测量时长，须包含视频轨。参考视频和源视频为 3–20 秒，主体视频为 3–8 秒，全部输入视频合计最多 20 秒。
* 每个主体只接收 `element_input_urls` 或 `element_input_video_urls`；主体中的其他键（如 `voice_id`）返回 400。
* `model` 和 `callback_url` 放在请求根级，与 `input` 并列。`input` 接收上文列出的字段，其他字段返回 400。
* 积分在提交时预扣。只含图片和文本的请求按输出秒数以 720p 费率计费。含输入视频（参考视频、视频主体或源视频）的请求按输入视频费率计费，计费秒数 = 输出时长 + max(输出时长, 全部输入视频总时长向上取整)。任务失败全额退还。当前费率见[定价页](https://vidgo.ai/apis/api-pricing)。


## OpenAPI

````yaml zh/api-manual/video-series/kwaivgi-kling-v4-0-flash-reference-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 用最多 10 张参考图、5 个参考视频和 7 个主体引导生成 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 Reference to Video
      summary: 提交 Kling 4.0 Flash 参考生视频 任务
      operationId: submitKling40FlashReferenceToVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              reference-images:
                summary: 两张参考图
                value:
                  model: kwaivgi/kling-v4.0-flash/reference-to-video
                  input:
                    prompt: >-
                      Documentary medium tracking shot at golden dawn: the woman
                      field sound recordist from the first reference image walks
                      carefully across the steaming dark basalt geothermal plain
                      from the second reference image, raising her grey furry
                      handheld microphone toward a bubbling turquoise mineral
                      pool while white steam drifts past in cool morning air.
                      Preserve her exact face, curly hair, olive jacket,
                      headphones, and recorder bag. Audio: hissing geothermal
                      steam and crunching volcanic gravel.
                    reference_image_urls:
                      - >-
                        https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-01.jpg
                      - >-
                        https://cdn.vidgo.ai/apis/models/bytedance/seedream-v5.0-flash/edit/v1/01/input-02.jpg
                    duration: 5
                    resolution: 720p
                    aspect_ratio: '16:9'
      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/reference-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: >-
                场景描述。按顺序引用参考素材，如 @Image1、@Video1 或 @Element1。去除首尾空白后 1–26,000
                个字符。
            reference_image_urls:
              type: array
              maxItems: 10
              items:
                type: string
                format: uri
                description: 使用公开可访问的 HTTP(S) 下载链接。
              description: 最多 10 张参考图，在提示词中用 @Image1、@Image2 等引用。
            reference_video_urls:
              type: array
              maxItems: 5
              items:
                type: string
                format: uri
                description: 使用公开可访问的 HTTP(S) 下载链接。
              description: >-
                最多 5 个参考视频，在提示词中用 @Video1、@Video2 等引用。每个视频 3–20 秒，最大 100
                MB（MP4、MOV 或 WebM）。
            kling_elements:
              type: array
              maxItems: 7
              items:
                type: object
                additionalProperties: false
                properties:
                  element_input_urls:
                    type: array
                    minItems: 2
                    maxItems: 4
                    items:
                      type: string
                      format: uri
                    description: 同一角色或物体的 2–4 张公开可访问的 HTTP(S) 图片。
                  element_input_video_urls:
                    type: array
                    minItems: 1
                    maxItems: 1
                    items:
                      type: string
                      format: uri
                    description: 恰好 1 个公开可访问的 HTTP(S) 主体视频，3–8 秒。
                description: 一个主体。element_input_urls 和 element_input_video_urls 二选一。
              description: 最多 7 个主体（可复用的角色或物体），其中视频主体最多 3 个。在提示词中用 @Element1、@Element2 等引用。
            image_urls:
              type: array
              maxItems: 1
              items:
                type: string
                format: uri
                description: 使用公开可访问的 HTTP(S) 下载链接。
              description: 可选首帧：一张作为视频开场的图片。
            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: Y1YTHP960WY5Z9OE
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-25T11:17:22'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: 错误信息。参见[错误码](/zh/api-manual/error-codes)。
          example: >-
            reference-to-video requires reference_image_urls,
            reference_video_urls or kling_elements
  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.