> ## 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 TTS

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

## Overview

Use this endpoint to call the Kling TTS 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/audio/kling/post-voice-tts.openapi.json POST /kling/v1/audio/tts
openapi: 3.1.0
info:
  title: TTS API
  version: 1.0.0
servers:
  - url: https://api.deerapi.com
security:
  - bearerAuth: []
paths:
  /kling/v1/audio/tts:
    post:
      summary: TTS
      operationId: tts
      parameters:
        - name: Content-Type
          in: header
          required: false
          description: Content type of the request body.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
                - voice_id
                - voice_language
              properties:
                text:
                  type: string
                  description: Text to synthesize into speech. Max 1000 characters.
                  default: Hello
                voice_id:
                  type: string
                  description: >-
                    Voice preset ID. Determines the speaker voice used for
                    synthesis. See the Kling documentation for available voice
                    IDs and their supported languages.
                  default: example
                voice_language:
                  type: string
                  description: >-
                    Language of the selected voice. Must match the language
                    supported by the chosen `voice_id`. Use an available service
                    language code such as `en`.
                  default: en
                voice_speed:
                  type: number
                  description: >-
                    Speech rate multiplier. Range 0.8–2.0 (one decimal place).
                    Values outside this range are clamped automatically.
              default:
                text: Hello
                voice_id: example
                voice_language: en
            examples:
              Example 1:
                summary: Example 1
                value:
                  text: Welcome to DeerAPI!
                  voice_id: en_male_narrator
                  voice_language: en
                  voice_speed: 1.2
            example:
              text: Welcome to DeerAPI!
              voice_id: en_male_narrator
              voice_language: en
              voice_speed: 1.2
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                properties: {}
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |
            curl https://api.deerapi.com/kling/v1/audio/tts \
              -H "Content-Type: application/json" \
              -H "Authorization: Bearer $DEERAPI_KEY" \
              -d '{
                "text": "Welcome to DeerAPI!",
                "voice_id": "en_male_narrator",
                "voice_language": "en",
                "voice_speed": 1.2
              }'
        - lang: Python
          label: requests
          source: |
            import os
            import requests

            url = "https://api.deerapi.com/kling/v1/audio/tts"
            headers = {
                "Authorization": "Bearer " + os.environ["DEERAPI_KEY"],
                "Content-Type": "application/json",
            }
            payload = {
              "text": "Welcome to DeerAPI!",
              "voice_id": "en_male_narrator",
              "voice_language": "en",
              "voice_speed": 1.2
            }

            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/audio/tts", {
              method: "POST",
              headers: {
                Authorization: `Bearer ${process.env.DEERAPI_KEY}`,
                "Content-Type": "application/json",
              },
              body: JSON.stringify({
                "text": "Welcome to DeerAPI!",
                "voice_id": "en_male_narrator",
                "voice_language": "en",
                "voice_speed": 1.2
              }),
            });


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

````