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

# Kling 4.0 Flash Reference to Video

> Kling 4.0 Flash reference-to-video. Guide generation with up to **10 reference images** (style, scene, subject) and up to **5 reference videos** (motion, camera work and other features to imitate — the videos are not edited). 720p only, single takes of up to **20 seconds**.

**Audio** — every generated video comes with a native audio track. It is always on: the model has no switch for it, so `sound` / `generate_audio` are rejected.

Refer to your assets in `prompt` as `<<<image_1>>>`, `<<<image_2>>>`, `<<<video_1>>>` …, numbered from 1 in the order of `image_urls` and `video_urls`. At least one image or video is required.

**Pricing** — in tokens (USD at $0.02/token). With reference images only, the price is the same as Kling 4.0 Flash and only the generated seconds are billed. With reference videos, a lower per-second rate applies to **output seconds + max(total reference video seconds, output seconds)**:

| references | tokens/s | USD/s | billed seconds |
|---|---|---|---|
| images only | 5.5715 | $0.11143 | output |
| with reference videos | 3.7143 | $0.074286 | output + max(reference videos, output) |

The total reference video length is measured from your files before any tokens are charged, and rounded up to a whole second. Reference images are not charged.

Examples:

- 5 seconds with reference images only: 27.86 tokens (= $0.5572)
- 5 seconds with an 8-second reference video: 13 billed seconds, 48.29 tokens (= $0.9658)
- 10 seconds with a 5-second reference video: 20 billed seconds, 74.29 tokens (= $1.4858)

Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use `custom_callback_url`) to get the generated video.

**Not accepted by this model** (rejected before any tokens are charged): `image_url` / `image_end_url` / `keyframes` (use [Kling 4.0 Flash](/api-reference/video-generations/kling-4-0-flash) for a first frame), reference audio, `sound` / `generate_audio` (audio is always generated), `negative_prompt`, `seed`, `model_params.multi_shot`, and 1080p / 4K.



## OpenAPI

````yaml api-reference/video-generations/openapi-kling-4-0-flash-refs.json POST /api/v1/videos/generations
openapi: 3.1.0
info:
  title: GoEnhance API - Kling 4.0 Flash Reference to Video
  description: >-
    Reference-to-video with Kling 4.0 Flash. Same endpoint as the other Kling
    models; the model is selected by model.
  version: 1.0.0
servers:
  - url: https://api.goenhance.ai
security: []
paths:
  /api/v1/videos/generations:
    post:
      tags:
        - VideoGenerations
      summary: Kling 4.0 Flash Reference to Video
      description: >-
        Kling 4.0 Flash reference-to-video. Guide generation with up to **10
        reference images** (style, scene, subject) and up to **5 reference
        videos** (motion, camera work and other features to imitate — the videos
        are not edited). 720p only, single takes of up to **20 seconds**.


        **Audio** — every generated video comes with a native audio track. It is
        always on: the model has no switch for it, so `sound` / `generate_audio`
        are rejected.


        Refer to your assets in `prompt` as `<<<image_1>>>`, `<<<image_2>>>`,
        `<<<video_1>>>` …, numbered from 1 in the order of `image_urls` and
        `video_urls`. At least one image or video is required.


        **Pricing** — in tokens (USD at $0.02/token). With reference images
        only, the price is the same as Kling 4.0 Flash and only the generated
        seconds are billed. With reference videos, a lower per-second rate
        applies to **output seconds + max(total reference video seconds, output
        seconds)**:


        | references | tokens/s | USD/s | billed seconds |

        |---|---|---|---|

        | images only | 5.5715 | $0.11143 | output |

        | with reference videos | 3.7143 | $0.074286 | output + max(reference
        videos, output) |


        The total reference video length is measured from your files before any
        tokens are charged, and rounded up to a whole second. Reference images
        are not charged.


        Examples:


        - 5 seconds with reference images only: 27.86 tokens (= $0.5572)

        - 5 seconds with an 8-second reference video: 13 billed seconds, 48.29
        tokens (= $0.9658)

        - 10 seconds with a 5-second reference video: 20 billed seconds, 74.29
        tokens (= $1.4858)


        Returns an `img_uuid`; poll GET /api/v1/jobs/detail (or use
        `custom_callback_url`) to get the generated video.


        **Not accepted by this model** (rejected before any tokens are charged):
        `image_url` / `image_end_url` / `keyframes` (use [Kling 4.0
        Flash](/api-reference/video-generations/kling-4-0-flash) for a first
        frame), reference audio, `sound` / `generate_audio` (audio is always
        generated), `negative_prompt`, `seed`, `model_params.multi_shot`, and
        1080p / 4K.
      parameters:
        - name: Authorization
          in: header
          description: ''
          required: false
          example: '{{Authorization}}'
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              description: >-
                Kling 4.0 Flash reference-to-video (reference images and / or
                reference videos).


                **Pricing** — per billed second:


                - images only — 5.5715 tokens ($0.11143)

                - with reference videos — 3.7143 tokens ($0.074286)
              properties:
                model:
                  type: string
                  enum:
                    - kling-4-0-flash-refs
                  description: Model name. Must be `kling-4-0-flash-refs` on this page.
                prompt:
                  type: string
                  maxLength: 2500
                  description: >-
                    Text prompt. Required, up to 2500 characters. Refer to
                    assets as `<<<image_1>>>` / `<<<video_1>>>` (numbered from 1
                    by array order); a number with no matching asset is
                    rejected.
                image_urls:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                    format: uri
                  description: >-
                    Reference image URLs (up to 10), used as style, scene or
                    subject references. `<<<image_1>>>` is the first item.


                    Up to 10MB each, width and height at least 300px, aspect
                    ratio between 2:5 and 5:2. Smaller images are upscaled
                    automatically.
                video_urls:
                  type: array
                  maxItems: 5
                  items:
                    type: string
                    format: uri
                  description: >-
                    Reference video URLs (up to 5). `<<<video_1>>>` is the first
                    item. Each video must be at least 3 seconds, and all videos
                    together at most 20 seconds. MP4 or MOV, up to 200MB, height
                    700-4553px.


                    Adding reference videos switches billing to output +
                    max(reference videos, output) seconds at the reference-video
                    rate (see Pricing).
                duration:
                  type: integer
                  minimum: 3
                  maximum: 20
                  default: 5
                  description: Output duration in seconds, any integer from 3 to 20.
                resolution:
                  type: string
                  enum:
                    - 720p
                  default: 720p
                  description: >-
                    Output resolution. Kling 4.0 Flash only supports 720p.
                    `quality` is accepted as a compatible alias.
                ratio:
                  type: string
                  enum:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                    - '21:9'
                  default: '16:9'
                  description: Aspect ratio of the output.
                custom_callback_url:
                  type: string
                  format: uri
                  description: >-
                    Optional. A publicly accessible HTTPS URL. When the task
                    status changes (processing / success / failed), GoEnhance
                    sends a POST request to this URL. The request body is
                    identical to the response of GET /api/v1/jobs/detail. If
                    your server does not respond with HTTP 200, the notification
                    is retried up to 3 times, with a 3-second timeout per
                    attempt.
                  example: https://your-server.com/goenhance/callback
              required:
                - model
                - prompt
            example:
              model: kling-4-0-flash-refs
              prompt: >-
                The woman in <<<image_1>>> dances in a snowy forest, following
                the moves and camera of <<<video_1>>>
              image_urls:
                - https://your-cdn.com/character.jpg
              video_urls:
                - https://your-cdn.com/dance-reference.mp4
              duration: 8
              ratio: '9:16'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                  data:
                    type: object
                    properties:
                      img_uuid:
                        type: string
                      cost:
                        type: number
                        description: >-
                          Tokens deducted for this request. This is the amount
                          actually charged, so it already reflects any discount
                          active on your account and can be lower than the
                          listed price. Tokens are deducted when the task is
                          accepted, and refunded automatically if the generation
                          ends in failure.
                        example: 5.82
                    required:
                      - img_uuid
                      - cost
                required:
                  - code
                  - msg
                  - data
              examples:
                '1':
                  summary: Success
                  value:
                    code: 0
                    msg: Success
                    data:
                      img_uuid: c12b656c-747a-44fd-9c80-add79b0c52d5
                      cost: 5.82
                '2':
                  summary: Insufficient tokens
                  value:
                    code: 100
                    msg: tokens is not enough
                quota:
                  summary: API key quota exceeded
                  value:
                    code: 101
                    msg: 'API key quota exceeded: 4990 of 5000 tokens used (monthly)'
          headers: {}
        '401':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                  msg:
                    type: string
                required:
                  - code
                  - msg
              examples:
                '1':
                  summary: Unauthorized
                  value:
                    code: 401
                    msg: Unauthorized
          headers: {}
      deprecated: false
      security: []

````

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