> ## 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 Reference to Video

> The Kling 4.0 Flash Reference to Video API guides 3–20 second 720p videos with up to 10 reference images, 5 reference videos and 7 elements.

> [!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 Reference to Video generates a 3–20 second 720p video guided by reference images, reference videos and reusable subjects (elements), so characters, outfits and settings stay consistent. Cite each reference in the prompt by its position, such as `@Image1`, `@Video1` or `@Element1`.

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/reference-to-video** — Reference-to-video with Kling 4.0 Flash from images, videos and elements, 3–20 seconds at 720p.

## Features

* Up to 10 reference images, 5 reference videos and 7 elements, 15 assets in total.
* Elements built from 2–4 images or one video of the same subject.
* Optional start frame via `image_urls`.
* 3–20 seconds at 720p in five aspect ratios.

## Input modes

Send at least one reference input; you can combine them:

* **Reference images** (`reference_image_urls`): cite as `@Image1`, `@Image2`, ….
* **Reference videos** (`reference_video_urls`): cite as `@Video1`, `@Video2`, …. Billed as input video.
* **Elements** (`kling_elements`): cite as `@Element1`, `@Element2`, …. Video-based elements are billed as input video.

Add `image_urls` with one image to fix the opening frame.

## Required parameters

* `prompt` (string): Scene description, 1–26,000 characters after trimming.
* At least one of `reference_image_urls`, `reference_video_urls` or `kling_elements`.

## Optional parameters

* `reference_image_urls` (string\[]): Up to 10 public HTTP(S) image URLs.
* `reference_video_urls` (string\[]): Up to 5 public HTTP(S) video URLs, each 3–20 seconds.
* `kling_elements` (object\[]): Up to 7 elements, at most 3 video-based. Each element has exactly one of:
  * `element_input_urls` (string\[]): 2–4 image URLs of the subject.
  * `element_input_video_urls` (string\[]): exactly 1 video URL of the subject, 3–8 seconds.
* `image_urls` (string\[]): One start-frame image URL.
* `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

* **Character and location references**: a field sound recordist from the first image walks across the steaming geothermal plain from the second image at dawn, 5 seconds, `16:9` ([result](https://cdn.vidgo.ai/apis/models/kwaivgi/kling-v4.0-flash/reference-to-video/v1/01/output.mp4)).

## Notes

* Limits: start frame plus reference images ≤ 10; all assets (start frame, reference images, reference videos, elements) ≤ 15; video-based elements ≤ 3.
* Input videos (MP4, MOV or WebM, up to 100 MB each) are downloaded and measured at submission and must contain a video track. Reference and source videos run 3–20 seconds, element videos 3–8 seconds, and all input videos together add up to at most 20 seconds.
* Each element takes `element_input_urls` or `element_input_video_urls`; any other key in an element (such as `voice_id`) returns 400.
* 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. Requests with images and text only are billed per output second at the 720p rate. Requests with input videos (reference videos, video elements or a source video) use the input-video rate on billed seconds = output duration + the larger of the output duration and the total input video length (rounded up to whole seconds). 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-reference-to-video.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Kling 4.0 Flash Reference to Video
  description: >-
    The Kling 4.0 Flash Reference to Video API guides 3–20 second 720p videos
    with up to 10 reference images, 5 reference videos and 7 elements.
  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 Reference to Video
      summary: Submit Kling 4.0 Flash Reference to Video Task
      operationId: submitKling40FlashReferenceToVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              reference-images:
                summary: Two reference images
                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: >-
            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/reference-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. Cite references by position, such as @Image1,
                @Video1 or @Element1. 1–26,000 characters after trimming.
            reference_image_urls:
              type: array
              maxItems: 10
              items:
                type: string
                format: uri
                description: Use a publicly accessible HTTP(S) download URL.
              description: >-
                Up to 10 reference images, cited in the prompt as @Image1,
                @Image2, and so on.
            reference_video_urls:
              type: array
              maxItems: 5
              items:
                type: string
                format: uri
                description: Use a publicly accessible HTTP(S) download URL.
              description: >-
                Up to 5 reference videos, cited in the prompt as @Video1,
                @Video2, and so on. Each video runs 3–20 seconds, up to 100 MB
                (MP4, MOV or 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 publicly accessible HTTP(S) images of the same
                      character or object.
                  element_input_video_urls:
                    type: array
                    minItems: 1
                    maxItems: 1
                    items:
                      type: string
                      format: uri
                    description: >-
                      Exactly 1 publicly accessible HTTP(S) video of the
                      subject, 3–8 seconds.
                description: >-
                  One element. Provide exactly one of element_input_urls or
                  element_input_video_urls.
              description: >-
                Up to 7 elements (reusable subjects), at most 3 of them
                video-based. Cite them in the prompt as @Element1, @Element2,
                and so on.
            image_urls:
              type: array
              maxItems: 1
              items:
                type: string
                format: uri
                description: Use a publicly accessible HTTP(S) download URL.
              description: 'Optional start frame: one image that opens the video.'
            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: 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: Error message. See [Error Codes](/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: 'Use `Authorization: Bearer VIDGO_API_KEY`.'

````

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