> ## 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 Video Edit

> Kling 4.0 Flash video edit. Change an existing clip of **3 to 20 seconds** with a prompt — swap outfits, restyle the scene, regrade the colors — optionally guided by up to **10 style reference images**. 720p only. The output keeps the aspect ratio and the original audio of your video.

Refer to the source video in `prompt` as `<<<video_1>>>` and to reference images as `<<<image_1>>>`, `<<<image_2>>>` … in the order of `image_urls`.

**Pricing** — in tokens (USD at $0.02/token), billed on **output seconds + max(source video seconds, output seconds)**:

| resolution | tokens/s | USD/s |
|---|---|---|
| 720p | 3.7143 | $0.074286 |

The source video length is measured from your file before any tokens are charged, and rounded up to a whole second. With the default `duration: "auto"` the output is as long as the source, so a request is billed for twice the source length. Reference images are not charged.

Examples:

- 5-second source, `duration` auto: 10 billed seconds, 37.14 tokens (= $0.7428)
- 10-second source, `duration` 20: 40 billed seconds, 148.57 tokens (= $2.9714)

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

**Not accepted by this model** (rejected before any tokens are charged): source videos longer than 20 seconds (they are not trimmed), `ratio` / `aspect_ratio` (the output follows the source video), `sound` / `generate_audio` (the output always keeps the audio of your video), `negative_prompt`, `seed`, `image_url` / `image_end_url` / `keyframes`, and 1080p / 4K.



## OpenAPI

````yaml api-reference/video-generations/openapi-kling-4-0-flash-edit.json POST /api/v1/videos/generations
openapi: 3.1.0
info:
  title: GoEnhance API - Kling 4.0 Flash Video Edit
  description: >-
    Video editing 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 Video Edit
      description: >-
        Kling 4.0 Flash video edit. Change an existing clip of **3 to 20
        seconds** with a prompt — swap outfits, restyle the scene, regrade the
        colors — optionally guided by up to **10 style reference images**. 720p
        only. The output keeps the aspect ratio and the original audio of your
        video.


        Refer to the source video in `prompt` as `<<<video_1>>>` and to
        reference images as `<<<image_1>>>`, `<<<image_2>>>` … in the order of
        `image_urls`.


        **Pricing** — in tokens (USD at $0.02/token), billed on **output seconds
        + max(source video seconds, output seconds)**:


        | resolution | tokens/s | USD/s |

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

        | 720p | 3.7143 | $0.074286 |


        The source video length is measured from your file before any tokens are
        charged, and rounded up to a whole second. With the default `duration:
        "auto"` the output is as long as the source, so a request is billed for
        twice the source length. Reference images are not charged.


        Examples:


        - 5-second source, `duration` auto: 10 billed seconds, 37.14 tokens (=
        $0.7428)

        - 10-second source, `duration` 20: 40 billed seconds, 148.57 tokens (=
        $2.9714)


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


        **Not accepted by this model** (rejected before any tokens are charged):
        source videos longer than 20 seconds (they are not trimmed), `ratio` /
        `aspect_ratio` (the output follows the source video), `sound` /
        `generate_audio` (the output always keeps the audio of your video),
        `negative_prompt`, `seed`, `image_url` / `image_end_url` / `keyframes`,
        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 video edit (one source video, optional style
                reference images).


                **Pricing** — per billed second (output + max(source, output)):


                - 720p — 3.7143 tokens ($0.074286)
              properties:
                model:
                  type: string
                  enum:
                    - kling-4-0-flash-edit
                  description: Model name. Must be `kling-4-0-flash-edit` on this page.
                prompt:
                  type: string
                  maxLength: 2500
                  description: >-
                    Editing instructions. Required, up to 2500 characters. Refer
                    to the source video as `<<<video_1>>>` and to reference
                    images as `<<<image_1>>>` …; a number with no matching asset
                    is rejected.
                video_urls:
                  type: array
                  minItems: 1
                  maxItems: 1
                  items:
                    type: string
                    format: uri
                  description: >-
                    The video to edit — exactly one URL. 3 to 20 seconds (longer
                    videos are rejected, not trimmed). MP4 or MOV, up to 200MB,
                    height 700-4553px.
                image_urls:
                  type: array
                  maxItems: 10
                  items:
                    type: string
                    format: uri
                  description: >-
                    Optional style reference image URLs (up to 10).
                    `<<<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.
                duration:
                  oneOf:
                    - type: integer
                      minimum: 3
                      maximum: 20
                    - type: string
                      enum:
                        - auto
                  default: auto
                  description: >-
                    Output duration: `"auto"` (default) matches the source
                    video, or any integer from 3 to 20 seconds. Billing uses
                    output + max(source, output) seconds.
                resolution:
                  type: string
                  enum:
                    - 720p
                  default: 720p
                  description: >-
                    Output resolution. Kling 4.0 Flash only supports 720p.
                    `quality` is accepted as a compatible alias.
                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
                - video_urls
            example:
              model: kling-4-0-flash-edit
              prompt: >-
                Replace the coat worn by the person in <<<video_1>>> with the
                style in <<<image_1>>>
              video_urls:
                - https://your-cdn.com/original.mp4
              image_urls:
                - https://your-cdn.com/coat-style.jpg
      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.