> ## 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 Virtual Try On

> Use DeerAPI to call the Kling Virtual Try On endpoint with request details, response details, examples, and an OpenAPI playground.

## Overview

Use this endpoint to call the Kling Virtual Try On 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/image/kling/post-virtual-try-on.openapi.json POST /kling/v1/images/kolors-virtual-try-on
openapi: 3.1.0
info:
  title: Virtual Try-On API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/images/kolors-virtual-try-on:
    post:
      summary: Virtual Try-On
      operationId: virtual_try_on
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - human_image
                - cloth_image
              properties:
                callback_url:
                  type: string
                  description: Webhook URL for task status notifications.
                model_name:
                  type: string
                  description: Virtual try-on model version.
                  enum:
                    - kolors-virtual-try-on-v1
                    - kolors-virtual-try-on-v1-5
                  default: kolors-virtual-try-on-v1
                human_image:
                  type: string
                  description: >-
                    Person image to dress. Accepts an image URL or raw Base64
                    string (no `data:` prefix). Formats: JPG, JPEG, PNG. Max 10
                    MB, minimum 300×300 px.
                  default: example
                cloth_image:
                  type: string
                  description: >-
                    Clothing image for the try-on. Accepts an image URL or raw
                    Base64 string (no `data:` prefix). Formats: JPG, JPEG, PNG.
                    Max 10 MB, minimum 300×300 px. Supports tops, bottoms, and
                    one-piece dresses. The v1-5 model also accepts a combined
                    top+bottom image stitched together.
                  default: example
              default:
                human_image: example
                cloth_image: example
            examples:
              Default:
                summary: Default
                value:
                  model_name: kolors-virtual-try-on-v1-5
                  human_image: >-
                    https://assets.christiandior.com/is/image/diorprod/LOOK_F_25_1_LOOK_095_E04?$lookDefault_GH-GHC$&crop=568,0,1864,2000&bfc=on&qlt=85
                  cloth_image: >-
                    https://assets.christiandior.com/is/image/diorprod/511R59A1166X3389_E01?$default_GHC$&crop=501,147,998,1572&bfc=on&qlt=85
            example:
              model_name: kolors-virtual-try-on-v1-5
              human_image: >-
                https://assets.christiandior.com/is/image/diorprod/LOOK_F_25_1_LOOK_095_E04?$lookDefault_GH-GHC$&crop=568,0,1864,2000&bfc=on&qlt=85
              cloth_image: >-
                https://assets.christiandior.com/is/image/diorprod/511R59A1166X3389_E01?$default_GHC$&crop=501,147,998,1572&bfc=on&qlt=85
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - message
                  - request_id
                  - data
                properties:
                  code:
                    type: integer
                    description: Error code; specifically define the error code
                  message:
                    type: string
                    description: error message
                  request_id:
                    type: string
                    description: >-
                      Request ID, system-generated, for tracking requests,
                      troubleshooting issues
                  data:
                    type: object
                    required:
                      - task_id
                      - task_status
                      - task_status_msg
                      - created_at
                      - updated_at
                      - task_result
                    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
                      created_at:
                        type: integer
                        description: Task creation time, Unix timestamp, in ms.
                      updated_at:
                        type: integer
                        description: Task update time, Unix timestamp, in ms.
                      task_result:
                        type: object
                        required:
                          - images
                        properties:
                          images:
                            type: array
                            items:
                              type: object
                              properties:
                                url:
                                  type: string
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl https://api.deerapi.com/kling/v1/images/kolors-virtual-try-on \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "model_name": "kolors-virtual-try-on-v1-5",
                "human_image": "https://assets.christiandior.com/is/image/diorprod/LOOK_F_25_1_LOOK_095_E04?$lookDefault_GH-GHC$&crop=568,0,1864,2000&bfc=on&qlt=85",
                "cloth_image": "https://assets.christiandior.com/is/image/diorprod/511R59A1166X3389_E01?$default_GHC$&crop=501,147,998,1572&bfc=on&qlt=85"
              }'
        - lang: Python
          label: requests
          source: >
            import os

            import requests


            url =
            "https://api.deerapi.com/kling/v1/images/kolors-virtual-try-on"

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

            payload = {
              "model_name": "kolors-virtual-try-on-v1-5",
              "human_image": "https://assets.christiandior.com/is/image/diorprod/LOOK_F_25_1_LOOK_095_E04?$lookDefault_GH-GHC$&crop=568,0,1864,2000&bfc=on&qlt=85",
              "cloth_image": "https://assets.christiandior.com/is/image/diorprod/511R59A1166X3389_E01?$default_GHC$&crop=501,147,998,1572&bfc=on&qlt=85"
            }


            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/images/kolors-virtual-try-on",
            {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "model_name": "kolors-virtual-try-on-v1-5",
                "human_image": "https://assets.christiandior.com/is/image/diorprod/LOOK_F_25_1_LOOK_095_E04?$lookDefault_GH-GHC$&crop=568,0,1864,2000&bfc=on&qlt=85",
                "cloth_image": "https://assets.christiandior.com/is/image/diorprod/511R59A1166X3389_E01?$default_GHC$&crop=501,147,998,1572&bfc=on&qlt=85"
              }),
            });


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

````