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

# Create a Kling multi-image video task

> Create Kling videos from multiple images via CometAPI POST /kling/v1/videos/multi-image2video, with motion control and output settings for generation.

Use this endpoint when one source image is not enough and you want Kling to build motion from multiple image references.

## Before you call it

* Prepare 1 to 4 images in `image_list`
* Use images that meet Kling pixel requirements; tiny thumbnails are rejected by the generation task
* Omit `model_name` unless you specifically need to select a route-compatible model
* Keep the first test simple: a short prompt, `duration: 5`, no extra callback settings
* Do not send image-to-video mask fields such as `static_mask` or `dynamic_masks` on this route

## Task flow

<Steps>
  <Step title="Submit the multi-image request">
    Send the image list, prompt, and duration, then save the returned Kling `task_id`.
  </Step>

  <Step title="Poll the task">
    Continue with [Get a Kling task](./individual-queries) until the task reaches a terminal state.
  </Step>

  <Step title="Persist the result">
    Store the finished video if you need retention beyond the provider delivery URL.
  </Step>
</Steps>

<Tip>
  For the complete parameter reference, see the [official Kling documentation](https://kling.ai/document-api/apiReference/model/multiImageToVideo).
</Tip>


## OpenAPI

````yaml api/openapi/video/kling/post-multi-image-to-video.openapi.json POST /kling/v1/videos/multi-image2video
openapi: 3.1.0
info:
  title: Multi-Image to Video API
  version: 1.0.0
  description: Create a Kling video task from multiple source images.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/multi-image2video:
    post:
      summary: Create a Kling multi-image-to-video task
      description: >-
        Submit 2 to 4 images plus a motion prompt and receive a task id for
        later polling.
      operationId: multi_image_to_video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - image_list
              properties:
                model_name:
                  type: string
                  description: >-
                    Kling model variant for multi-image video. Omit to use
                    `kling-v1-6`.
                  default: kling-v1-6
                  enum:
                    - kling-v1-6
                image_list:
                  type: array
                  description: >-
                    Input image references. Provide 1 to 4 items that meet Kling
                    pixel requirements; very small thumbnails are rejected.
                  minItems: 1
                  maxItems: 4
                  items:
                    type: object
                    required:
                      - image
                    properties:
                      image:
                        type: string
                        description: Image URL or base64 image string.
                prompt:
                  type: string
                  description: Text prompt describing the desired motion and scene.
                negative_prompt:
                  type: string
                  description: Elements to avoid in the generated video.
                mode:
                  type: string
                  description: >-
                    Generation mode. Use `std` or `pro`; omitted requests use
                    `std`.
                  enum:
                    - std
                    - pro
                  default: std
                duration:
                  type: string
                  description: >-
                    Output video length in seconds. Use `5` or `10`; omitted
                    requests use `5`.
                  default: '5'
                aspect_ratio:
                  type: string
                  description: >-
                    Requested frame aspect ratio when the model needs an
                    explicit frame shape.
                  enum:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                callback_url:
                  type: string
                  description: Webhook URL to receive task status updates.
                external_task_id:
                  type: string
                  description: >-
                    Custom task id for your own tracking. Must be unique per
                    account.
              default:
                image_list:
                  - image: https://your-image-host/first-frame.jpg
                  - image: https://your-image-host/second-frame.jpg
                prompt: A smooth transition between the two reference moments
                mode: std
                duration: '5'
                aspect_ratio: '1:1'
            examples:
              Default:
                summary: Multi-image video request
                value:
                  image_list:
                    - image: https://your-image-host/first-frame.jpg
                    - image: https://your-image-host/second-frame.jpg
                  prompt: A smooth transition between the two reference moments
                  mode: std
                  duration: '5'
                  aspect_ratio: '1:1'
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - data
                properties:
                  code:
                    type: integer
                    description: Error code; specifically define the error code
                  message:
                    type: string
                    description: error message
                  data:
                    type: object
                    required:
                      - task_id
                      - task_status
                      - created_at
                      - updated_at
                    properties:
                      task_id:
                        type: string
                        description: Task ID, system generated
                      task_status:
                        type: string
                        description: >-
                          Task status, enumerated values: submitted, processing,
                          succeed, failed.
                      task_status_msg:
                        type: string
                      task_info:
                        type: object
                        additionalProperties: true
                      created_at:
                        type: integer
                        description: Task creation time, Unix timestamp, in ms.
                      updated_at:
                        type: integer
                        description: Task update time, Unix timestamp, in ms.
                example:
                  code: 0
                  message: SUCCEED
                  data:
                    task_id: '861309198188019719'
                    task_status: submitted
                    task_info: {}
                    created_at: 1773380633979
                    updated_at: 1773380633979
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            curl https://api.cometapi.com/kling/v1/videos/multi-image2video \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                  "image_list": [
                    {
                      "image": "https://your-image-host/first-frame.jpg"
                    },
                    {
                      "image": "https://your-image-host/second-frame.jpg"
                    }
                  ],
                  "prompt": "A smooth transition between the two reference moments",
                  "mode": "std",
                  "duration": "5",
                  "aspect_ratio": "1:1"
                }'
        - lang: Python
          label: Default
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/kling/v1/videos/multi-image2video",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                  "image_list": [
                    {
                      "image": "https://your-image-host/first-frame.jpg"
                    },
                    {
                      "image": "https://your-image-host/second-frame.jpg"
                    }
                  ],
                  "prompt": "A smooth transition between the two reference moments",
                  "mode": "std",
                  "duration": "5",
                  "aspect_ratio": "1:1"
                },
            )

            result = response.json()
            print(result.get("code"), result.get("data", {}).get("task_id"))
        - lang: JavaScript
          label: Default
          source: >
            const response = await
            fetch("https://api.cometapi.com/kling/v1/videos/multi-image2video",
            {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "image_list": [
                  {
                    "image": "https://your-image-host/first-frame.jpg"
                  },
                  {
                    "image": "https://your-image-host/second-frame.jpg"
                  }
                ],
                "prompt": "A smooth transition between the two reference moments",
                "mode": "std",
                "duration": "5",
                "aspect_ratio": "1:1"
              }),
            });


            const result = await response.json();

            console.log(result.code, result.data?.task_id);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````