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

# Kling Preview Mask

> Use DeerAPI to call the Kling Preview Mask endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the Kling Preview Mask workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

## Before you start

Use the DeerAPI base URL and pass your API Key in the `Authorization` header:

```text theme={null}
https://api.deerapi.com
```

```text theme={null}
Authorization: Bearer $DEERAPI_KEY
```

## Model selection

Choose a current model ID from the [live pricing page](https://api.deerapi.com/pricing). Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

## Implementation notes

* Use the OpenAPI playground for the exact request fields accepted by this endpoint.
* Keep API Keys on the server side when you build production applications.
* Log the request ID from failed calls so support can investigate the request.
* Retry `429`, `500`, and `503` responses with exponential backoff.


## OpenAPI

````yaml /api/openapi/video/kling/multimodal-edit/post-preview-mask.openapi.json POST /kling/v1/videos/multi-elements/preview-selection
openapi: 3.1.0
info:
  title: Preview Video Selection API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/videos/multi-elements/preview-selection:
    post:
      summary: Preview Video Selection API
      operationId: post_kling_v1_videos_multi_elements_preview_selection
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - session_id
              properties:
                session_id:
                  type: string
                  default: example
              default:
                session_id: example
            examples:
              Default:
                summary: Default
                value:
                  session_id: '784914037360041984'
            example:
              session_id: '784914037360041984'
      responses:
        '200':
          description: Use this field according to the endpoint schema.
          content:
            application/json:
              schema:
                type: object
                properties: {}
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: >
            curl
            https://api.deerapi.com/kling/v1/videos/multi-elements/preview-selection
            \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "session_id": "784914037360041984"
              }'
        - lang: Python
          label: requests
          source: >
            import os

            import requests


            url =
            "https://api.deerapi.com/kling/v1/videos/multi-elements/preview-selection"

            headers = {
                "Authorization": "Bearer " + os.environ["DEERAPI_KEY"],
                "Content-Type": "application/json",
            }

            payload = {
              "session_id": "784914037360041984"
            }


            response = requests.post(url, headers=headers, json=payload)

            print(response.json())
        - lang: JavaScript
          label: fetch
          source: >
            const response = await
            fetch("https://api.deerapi.com/kling/v1/videos/multi-elements/preview-selection",
            {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "session_id": "784914037360041984"
              }),
            });


            console.log(await response.json());
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use a DeerAPI API Key as a Bearer token.

````