# Kling TTS

> Generate speech from text prompts and different voices using the Kling TTS model, which leverages advanced AI techniques to create high-quality text-to-speech.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/kling-video/v1/tts`
- **Model ID**: `fal-ai/kling-video/v1/tts`
- **Category**: text-to-speech
- **Kind**: inference
**Tags**: audio



## Pricing

- **Price**: $0.007 per generations

For more details, see [fal.ai pricing](https://fal.ai/pricing).

## API Information

This model can be used via our HTTP API or more conveniently via our client libraries.
See the input and output schema below, as well as the usage examples.


### Input Schema

The API accepts the following input parameters:


- **`text`** (`string`, _required_):
  The text to be converted to speech
  - Examples: "Hello world! Kling TTS is available on FAL!"

- **`voice_id`** (`VoiceIdEnum`, _optional_):
  The voice ID to use for speech synthesis Default value: `"genshin_vindi2"`
  - Default: `"genshin_vindi2"`
  - Options: `"genshin_vindi2"`, `"zhinen_xuesheng"`, `"AOT"`, `"ai_shatang"`, `"genshin_klee2"`, `"genshin_kirara"`, `"ai_kaiya"`, `"oversea_male1"`, `"ai_chenjiahao_712"`, `"girlfriend_4_speech02"`, `"chat1_female_new-3"`, `"chat_0407_5-1"`, `"cartoon-boy-07"`, `"uk_boy1"`, `"cartoon-girl-01"`, `"PeppaPig_platform"`, `"ai_huangzhong_712"`, `"ai_huangyaoshi_712"`, `"ai_laoguowang_712"`, `"chengshu_jiejie"`, `"you_pingjing"`, `"calm_story1"`, `"uk_man2"`, `"laopopo_speech02"`, `"heainainai_speech02"`, `"reader_en_m-v1"`, `"commercial_lady_en_f-v1"`, `"tiyuxi_xuedi"`, `"tiexin_nanyou"`, `"girlfriend_1_speech02"`, `"girlfriend_2_speech02"`, `"zhuxi_speech02"`, `"uk_oldman3"`, `"dongbeilaotie_speech02"`, `"chongqingxiaohuo_speech02"`, `"chuanmeizi_speech02"`, `"chaoshandashu_speech02"`, `"ai_taiwan_man2_speech02"`, `"xianzhanggui_speech02"`, `"tianjinjiejie_speech02"`, `"diyinnansang_DB_CN_M_04-v2"`, `"yizhipiannan-v1"`, `"guanxiaofang-v2"`, `"tianmeixuemei-v1"`, `"daopianyansang-v1"`, `"mengwa-v1"`

- **`voice_speed`** (`float`, _optional_):
  Rate of speech Default value: `1`
  - Default: `1`
  - Range: `0.8` to `2`



**Required Parameters Example**:

```json
{
  "text": "Hello world! Kling TTS is available on FAL!"
}
```

**Full Example**:

```json
{
  "text": "Hello world! Kling TTS is available on FAL!",
  "voice_id": "genshin_vindi2",
  "voice_speed": 1
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`File`, _required_):
  The generated audio
  - Examples: {"url":"https://v3.fal.media/files/monkey/O-ekVTtYqeDblD1oSf2uv_output.mp3"}



**Example Response**:

```json
{
  "audio": {
    "url": "https://v3.fal.media/files/monkey/O-ekVTtYqeDblD1oSf2uv_output.mp3"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/kling-video/v1/tts \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "text": "Hello world! Kling TTS is available on FAL!"
   }'
```

### Python

Ensure you have the Python client installed:

```bash
pip install fal-client
```

Then use the API client to make requests:

```python
import fal_client

def on_queue_update(update):
    if isinstance(update, fal_client.InProgress):
        for log in update.logs:
           print(log["message"])

result = fal_client.subscribe(
    "fal-ai/kling-video/v1/tts",
    arguments={
        "text": "Hello world! Kling TTS is available on FAL!"
    },
    with_logs=True,
    on_queue_update=on_queue_update,
)
print(result)
```

### JavaScript

Ensure you have the JavaScript client installed:

```bash
npm install --save @fal-ai/client
```

Then use the API client to make requests:

```javascript
import { fal } from "@fal-ai/client";

const result = await fal.subscribe("fal-ai/kling-video/v1/tts", {
  input: {
    text: "Hello world! Kling TTS is available on FAL!"
  },
  logs: true,
  onQueueUpdate: (update) => {
    if (update.status === "IN_PROGRESS") {
      update.logs.map((log) => log.message).forEach(console.log);
    }
  },
});
console.log(result.data);
console.log(result.requestId);
```


## Additional Resources

### Documentation

- [Model Playground](https://fal.ai/models/fal-ai/kling-video/v1/tts)
- [API Documentation](https://fal.ai/models/fal-ai/kling-video/v1/tts/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/kling-video/v1/tts)

### fal.ai Platform

- [Platform Documentation](https://docs.fal.ai)
- [Python Client](https://docs.fal.ai/clients/python)
- [JavaScript Client](https://docs.fal.ai/clients/javascript)
