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

# Kling 4.0 Flash Video Edit

> Video editing in the Flash series for scene restyling, object changes, and reference-guided revisions. It combines source footage with image, video, or subject references to shape the resulting scene.



## OpenAPI

````yaml /media-model-api/kling/kling-v2v.json post /kling/kling-4.0-flash-video-edit
openapi: 3.1.0
info:
  description: The video-to-video models API from Kling AI.
  version: 1.0.0
  contact:
    name: Modellix Support
    email: support@modellix.ai
  title: Kling Video-to-Video Models API
servers:
  - url: https://api.modellix.ai/api/v1
    description: The video-to-video models API from Kling AI.
security:
  - bearerAuth: []
paths:
  /kling/kling-4.0-flash-video-edit:
    post:
      summary: Kling 4.0 Flash Video Edit
      description: >-
        Video editing in the Flash series for scene restyling, object changes,
        and reference-guided revisions. It combines source footage with image,
        video, or subject references to shape the resulting scene.
      operationId: kling4FlashVideoEditAsync
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Kling4FlashVideoEditRequest'
            examples:
              basic:
                summary: Kling 4.0 Flash Video Edit
                value:
                  prompt: >-
                    Edit @video_1. Remove the person in the foreground. Keep
                    everything else unchanged.
                  duration: 5
                  resolution: 720p
                  video: https://example.com/source.mp4
                  audio: native
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AsyncTaskResponse'
              example:
                code: 0
                message: success
                data:
                  status: pending
                  task_id: task-kling4-example
                  model_id: model-123
                  get_result:
                    method: GET
                    url: https://api.modellix.ai/api/v1/tasks/task-kling4-example
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  schemas:
    Kling4FlashVideoEditRequest:
      type: object
      additionalProperties: false
      required:
        - prompt
        - video
      properties:
        prompt:
          type: string
          minLength: 1
          maxLength: 26000
          description: >-
            Required non-whitespace prompt. Up to 26,000 English characters or
            11,000 non-English characters. Mixed prompts must satisfy
            English/26000 + non-English/11000 <= 1. Reference labels follow
            input order: @image_1, @video_1 and @element_1.
          example: >-
            Edit @video_1. Remove the person in the foreground. Keep everything
            else unchanged.
        duration:
          type: integer
          description: >-
            Optional output duration in seconds (3-20). When omitted, duration
            is inferred from the prompt and inputs. Final billing uses the
            output duration reported for the completed task.
          example: 5
          minimum: 3
          maximum: 20
        resolution:
          type: string
          enum:
            - 720p
            - 1080p
            - 2k
            - 4k
          default: 720p
          description: >-
            Output resolution. 720p is native; 1080p, 2k and 4k are upscaled
            outputs.
        first_frame_image:
          type: string
          format: uri
          pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
          minLength: 1
          description: Publicly accessible first keyframe image URL. Optional.
          example: https://example.com/frame.png
        video:
          type: string
          format: uri
          pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
          minLength: 1
          description: >-
            Required base video URL for editing (MP4/MOV). All supplied video
            inputs together must fit within 20 seconds, with a minimum video
            duration of 3 seconds. Media validity is checked by the upstream
            service.
          example: https://example.com/source.mp4
        reference_images:
          type: array
          minItems: 1
          maxItems: 10
          items:
            type: string
            format: uri
            pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
            minLength: 1
          description: >-
            Reference image URLs, ordered after the optional first keyframe. At
            most 10 images including that keyframe.
        reference_videos:
          type: array
          minItems: 1
          maxItems: 4
          items:
            type: string
            format: uri
            pattern: ^[Hh][Tt][Tt][Pp][Ss]?://[^\s]+$
            minLength: 1
          description: >-
            Additional motion or camera reference video URLs (MP4/MOV). At most
            4 in addition to the base video; total input video duration must not
            exceed 20 seconds.
        subject_ids:
          type: array
          minItems: 1
          maxItems: 7
          items:
            type: string
            minLength: 1
          description: >-
            Existing subject IDs available through this model's channel,
            referenced as @element_1, @element_2, and so on. This endpoint does
            not create subjects.
        audio:
          type: string
          enum:
            - native
            - original
          default: native
          description: >-
            native generates new audio; original preserves the source video
            audio and disables generated audio.
        aspect_ratio:
          type: string
          enum:
            - adaptive
            - '21:9'
            - '16:9'
            - '9:16'
            - '1:1'
          default: adaptive
          description: Output aspect ratio. adaptive follows the source video.
      description: >-
        Kling 4.0 Flash Video Edit request. Media inputs must be accessible
        HTTP(S) URLs; base64 and data URIs are not accepted. Images, videos and
        subjects combined must not exceed 15 references.
    AsyncTaskResponse:
      type: object
      required:
        - code
        - message
        - data
      properties:
        code:
          type: integer
          description: Response code, 0 indicates success
          example: 0
        message:
          type: string
          description: Response message
          example: success
        data:
          type: object
          required:
            - status
            - task_id
            - model_id
          properties:
            status:
              type: string
              enum:
                - pending
                - processing
              description: Task status
              example: pending
            task_id:
              type: string
              description: Unique task identifier
              example: task-v2v-abc123
            model_id:
              type: string
              description: Model ID
              example: model-123
            get_result:
              type: object
              description: API information to query the task result
              properties:
                method:
                  type: string
                  description: HTTP method
                  example: GET
                url:
                  type: string
                  description: Full URL to query the task result
                  example: https://api.modellix.ai/api/v1/tasks/task-v2v-abc123
          description: Detailed data about the submitted asynchronous task.
    ErrorResponse:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: integer
          description: Error code (equals HTTP status code)
          example: 400
        message:
          type: string
          description: 'Error message in format ''Category: detail'''
          example: 'Invalid parameters: prompt is required when multi_shot is false'
  responses:
    BadRequest:
      description: Invalid request parameters
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 400
            message: 'Invalid parameters: prompt is required when multi_shot is false'
    Unauthorized:
      description: Unauthorized - Invalid or missing API Key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 401
            message: 'Authentication failed: invalid API key'
    TooManyRequests:
      description: Too many requests - Rate limit exceeded
      headers:
        X-RateLimit-Limit:
          description: Maximum requests per minute
          schema:
            type: integer
            example: 100
        X-RateLimit-Remaining:
          description: Remaining quota in current window
          schema:
            type: integer
            example: 0
        X-RateLimit-Reset:
          description: Rate limit window reset time (Unix timestamp)
          schema:
            type: integer
            example: 1704067260
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 429
            message: >-
              Rate limit exceeded: 100 requests per minute, retry after 60
              seconds
    InternalServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            code: 500
            message: Internal server error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API Key authentication. Format: `Bearer YOUR_API_KEY`.'

````

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