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

# Kling Image-to-Video kling-v2-1-master

> Submit a Kling image-to-video task via `/kling/v1/videos/image2video`. The request body is forwarded to the Kling official API after model mapping and public task ID injection.



## OpenAPI

````yaml api-reference/en/zmodelVideo/kling/kling-v2-1-master-image2video.json POST /kling/v1/videos/image2video
openapi: 3.0.1
info:
  title: Kling Image-to-Video Task - Submit Task (kling-v2-1-master)
  version: 1.0.0
  description: >-
    Submit a Kling image-to-video task via `/kling/v1/videos/image2video`. Uses
    model kling-v2-1-master.
servers:
  - url: https://api.powertokens.ai
    description: ''
security: []
tags:
  - name: Kling
    description: Kling native async task endpoints
paths:
  /kling/v1/videos/image2video:
    post:
      tags:
        - Kling
      summary: Kling Image-to-Video Task (kling-v2-1-master)
      description: >-
        Submit a Kling image-to-video task via `/kling/v1/videos/image2video`.
        The request body is forwarded to the Kling official API after model
        mapping and public task ID injection.
      operationId: createKlingV21MasterImage2Video
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            default: application/json
          description: Data exchange format
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KlingRequest'
            examples:
              request:
                summary: Request example
                value:
                  model_name: kling-v2-1-master
                  image: >-
                    https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-qa-test/multi-2.png
                  prompt: Camera pulls back, the girl smiles
                  negative_prompt: ''
                  duration: '5'
                  mode: pro
                  sound: 'off'
                  callback_url: ''
                  external_task_id: ''
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              examples:
                response:
                  summary: Response example
                  value:
                    code: 0
                    message: string
                    request_id: string
                    data:
                      task_id: string
                      task_info:
                        external_task_id: string
                      task_status: submitted
                      created_at: 1722769557708
                      updated_at: 1722769557708
      security:
        - bearerAuth: []
components:
  schemas:
    KlingRequest:
      type: object
      required:
        - model_name
        - prompt
        - image
      properties:
        model_name:
          type: string
          description: Model name
          enum:
            - kling-v2-1-master
        image:
          type: string
          description: >-
            Reference image

            - Supports image Base64 encoding or image URL (must be accessible)

            - Note: Please ensure all image data parameters use Base64 encoding
            format. When using Base64, do not add any prefix (such as
            data:image/png;base64,) before the Base64 string — pass the Base64
            encoded string directly.

            - Correct Base64 parameter:

             `iVBORw0KGgoAAAANSUhEUgAAAAUA...`

            - Incorrect Base64 parameter (contains data: prefix):


            `data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA...`


            - Supported image formats: .jpg / .jpeg / .png

            - Image file size must not exceed 10MB, image dimensions must be at
            least 300px, aspect ratio between 1:2.5 ~ 2.5:1

            - image parameter is required
        multi_shot:
          type: boolean
          default: false
          description: >-
            Whether to generate a multi-shot video.

            When this parameter is true, the prompt parameter is invalid.

            When this parameter is false, the shot_type and multi_prompt
            parameters are invalid.
        shot_type:
          type: string
          enum:
            - customize
            - intelligence
          description: |-
            Shot type
            Required when multi_shot is true.
          x-valid-when:
            multi_shot:
              - true
        prompt:
          type: string
          description: >-
            Positive text prompt


            ```markdown

            Omni models can achieve various capabilities through prompts with
            subjects, images, videos, etc.:

            - Use <<<>>> format to specify a subject, image, or video, e.g.:
            <<<element_1>>>, <<<image_1>>>, <<<video_1>>>

            ```


            - Must not exceed 2500 characters

            - Must not be empty when multi_shot is false or shot_type is
            intelligence.

            - Use <<<voice_1>>> to specify a voice, with the index matching the
            order of voices referenced in voice_list

            - Up to 2 voices per video generation task; when specifying voices,
            sound must be 'on'

            - Keep syntax as simple as possible, e.g.: A man<<<voice_1>>>says:
            "Hello"

            - When voice_list is not empty and prompt references a voice ID,
            billing is based on 'with specified voice'
          maxLength: 2500
        multi_prompt:
          type: array
          items:
            type: object
            required:
              - index
              - prompt
              - duration
            properties:
              index:
                type: integer
                description: Shot index.
              prompt:
                type: string
                description: Shot prompt.
                maxLength: 512
              duration:
                type: string
                description: Shot duration in seconds.
          description: >-
            Multi-shot information including prompt, duration, etc.

            Define shot index and corresponding prompt and duration via index,
            prompt, duration parameters.

            - Max 6 shots, min 1 shot.

            - Max length per shot content: 512 characters.

            - Each shot duration must not exceed total task duration and must be
            >= 1.

            - Sum of all shot durations must equal total task duration.


            When multi_shot is true and shot_type is customize, this parameter
            must not be empty. Format:


            ```json

            "multi_prompt":[{ "index": int, "prompt": "string", "duration": "5"
            },{ "index": int, "prompt": "string","duration": "5" }]

            ```


            Required when multi_shot is true and shot_type is customize.
          minItems: 1
          maxItems: 6
          x-valid-when:
            multi_shot:
              - true
        negative_prompt:
          type: string
          description: >-
            Negative text prompt

            - Must not exceed 2500 characters

            - It is recommended to supplement negative prompt information
            through negative sentences in the positive prompt
          maxLength: 2500
        element_list:
          type: array
          items:
            type: object
            required:
              - element_id
            properties:
              element_id:
                type: integer
                format: int64
                description: Element ID from the element library.
          description: >-
            Element reference list, configured based on element IDs in the
            element library.

            - Up to 3 reference elements


            Elements are divided into video character elements and multi-image
            elements, with different applicable scopes.


            - Use key:value format:


            ```json

            "element_list":[{ "element_id": long },{ "element_id": long }]

            ```
          maxItems: 3
        voice_list:
          type: array
          items:
            type: object
            required:
              - voice_id
            properties:
              voice_id:
                type: string
                description: Voice ID.
                enum:
                  - '829836818102231083'
                  - '829837074797821984'
                  - '829837252279803904'
                  - '829837297074962436'
                x-options:
                  - label: Owen
                    value: '829836818102231083'
                  - label: Catherine
                    value: '829837074797821984'
                  - label: Laura
                    value: '829837252279803904'
                  - label: William
                    value: '829837297074962436'
          description: >-
            Voice list referenced during video generation.

            - Up to 2 voices per video generation task

            - When voice_list is not empty and prompt references a voice ID,
            billing is based on 'with specified voice'

            - element_list and voice_list are mutually exclusive; cannot coexist


            Use key:value format:


            ```json

            "voice_list":[{ "voice_id": "string" },{ "voice_id": "string" }]

            ```
          maxItems: 2
        sound:
          type: string
          enum:
            - 'on'
            - 'off'
          default: 'off'
          description: Whether to also generate audio when creating the video
        cfg_scale:
          type: number
          minimum: 0
          maximum: 1
          default: 0.5
          description: >-
            Creative freedom of video generation; higher values result in less
            model freedom and stronger correlation with the user's input prompt

            kling-v2.x models do not support this parameter
        mode:
          type: string
          enum:
            - std
            - pro
          default: std
          x-options:
            - label: 720P
              value: std
            - label: 1080P
              value: pro
          description: >-
            Video generation mode


            - std: Standard mode, cost-effective, output video resolution 720P.

            - pro: Expert mode (high quality), better video quality, output
            video resolution 1080P.

            - 4k: 4K mode, high quality (same as pro), better video quality,
            output video resolution 4K.
        static_mask:
          type: string
          description: >-
            Static brush mask area (mask image painted by the user via motion
            brush)

            `The "motion brush" feature includes both "dynamic brush
            dynamic_masks" and "static brush static_mask"`


            - Supports image Base64 encoding or image URL (must be accessible,
            same format requirements as the image field)

            - Supported image formats: .jpg / .jpeg / .png

            - Image aspect ratio must match the input image (i.e., the image
            field), otherwise the task will fail

            - The resolution of static_mask and dynamic_masks.mask must be
            identical, otherwise the task will fail
        dynamic_masks:
          type: array
          items:
            type: object
            required:
              - mask
              - trajectories
            properties:
              mask:
                type: string
                description: >-
                  Dynamic brush mask area (mask image painted by the user via
                  motion brush)

                  - Supports image Base64 encoding or image URL (must be
                  accessible, same format requirements as the image field)

                  - Supported image formats: .jpg / .jpeg / .png

                  - Image aspect ratio must match the input image (i.e., the
                  image field), otherwise the task will fail

                  - The resolution of static_mask and dynamic_masks.mask must be
                  identical, otherwise the task will fail
              trajectories:
                type: array
                items:
                  type: object
                  required:
                    - x
                    - 'y'
                  properties:
                    x:
                      type: integer
                      description: >-
                        Trajectory point X-coordinate (in pixel coordinate
                        system, origin at the bottom-left of the input image)
                    'y':
                      type: integer
                      description: >-
                        Trajectory point Y-coordinate (in pixel coordinate
                        system, origin at the bottom-left of the input image)
                description: >-
                  Motion trajectory coordinate sequence

                  - For a 5s video, trajectory length must not exceed 77, i.e.,
                  coordinate count range: [2, 77]

                  - Trajectory coordinate system: origin at the bottom-left
                  corner of the image


                  `Note 1: More coordinate points result in more accurate
                  trajectory depiction; 2 points form a straight line`


                  `Note 2: Trajectory direction follows the input order, with
                  the first coordinate as the starting point, sequentially
                  linking subsequent coordinates to form the motion trajectory`
          description: >-
            Dynamic brush configuration list

            - Can configure multiple groups (up to 6), each containing a "mask
            area" and "motion trajectories" sequence
          maxItems: 6
        duration:
          type: string
          description: Video duration in seconds.
          enum:
            - '5'
            - '10'
          default: '5'
        watermark_info:
          type: object
          description: Whether to also generate a watermarked result.
          properties:
            enabled:
              type: boolean
              description: true to generate watermarked result, false to not generate.
        callback_url:
          type: string
          description: >-
            Callback notification URL for this task. If configured, the server
            will proactively notify when the task status changes.
        external_task_id:
          type: string
          description: >-
            Custom task ID.

            - Does not override the system-generated task ID, but supports
            querying by this ID.

            - Must be unique per user.
    SubmitResponse:
      type: object
      properties:
        code:
          type: integer
          description: Error code; see error codes for details.
        message:
          type: string
          description: Error message.
        request_id:
          type: string
          description: >-
            Request ID, system-generated, used for request tracking and
            troubleshooting.
        data:
          type: object
          properties:
            task_id:
              type: string
              description: Task ID, system-generated.
            task_info:
              type: object
              description: Task creation parameter information.
              properties:
                external_task_id:
                  type: string
                  description: Client-provided custom task ID.
            task_status:
              type: string
              description: Task status.
              enum:
                - submitted
                - processing
                - succeed
                - failed
              x-enum-labels:
                - Submitted
                - Processing
                - Succeed
                - Failed
              example: submitted
            created_at:
              type: integer
              format: int64
              description: Task creation time, Unix timestamp in milliseconds.
            updated_at:
              type: integer
              format: int64
              description: Task update time, Unix timestamp in milliseconds.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````