# Chatterbox

> Whether you're working on memes, videos, games, or AI agents, Chatterbox brings your content to life. Use the first tts from resemble ai.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/chatterbox/text-to-speech`
- **Model ID**: `fal-ai/chatterbox/text-to-speech`
- **Category**: text-to-speech
- **Kind**: inference
**Tags**: text-to-speech



## Pricing

Your request will cost **$0.025** per 1000 characters.

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. You can additionally add the following emotive tags: <laugh>, <chuckle>, <sigh>, <cough>, <sniffle>, <groan>, <yawn>, <gasp>
  - Examples: "I just found a hidden treasure in the backyard! Check it out!"

- **`audio_url`** (`string`, _optional_):
  Optional URL to an audio file to use as a reference for the generated speech. If provided, the model will try to match the style and tone of the reference audio. Default value: `"https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3"`
  - Default: `"https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3"`

- **`exaggeration`** (`float`, _optional_):
  Exaggeration factor for the generated speech (0.0 = no exaggeration, 1.0 = maximum exaggeration). Default value: `0.25`
  - Default: `0.25`
  - Range: `0` to `1`

- **`temperature`** (`float`, _optional_):
  Temperature for generation (higher = more creative). Default value: `0.7`
  - Default: `0.7`
  - Range: `0.05` to `2`

- **`cfg`** (`float`, _optional_):
   Default value: `0.5`
  - Default: `0.5`
  - Range: `0.1` to `1`

- **`seed`** (`integer`, _optional_):
  Useful to control the reproducibility of the generated audio. Assuming all other properties didn't change, a fixed seed should always generate the exact same audio file. Set to 0 for random seed..



**Required Parameters Example**:

```json
{
  "text": "I just found a hidden treasure in the backyard! Check it out!"
}
```

**Full Example**:

```json
{
  "text": "I just found a hidden treasure in the backyard! Check it out!",
  "audio_url": "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3",
  "exaggeration": 0.25,
  "temperature": 0.7,
  "cfg": 0.5
}
```


### Output Schema

The API returns the following output format:




## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/chatterbox/text-to-speech \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "text": "I just found a hidden treasure in the backyard! Check it out!"
   }'
```

### 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/chatterbox/text-to-speech",
    arguments={
        "text": "I just found a hidden treasure in the backyard! Check it out!"
    },
    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/chatterbox/text-to-speech", {
  input: {
    text: "I just found a hidden treasure in the backyard! Check it out!"
  },
  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/chatterbox/text-to-speech)
- [API Documentation](https://fal.ai/models/fal-ai/chatterbox/text-to-speech/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/chatterbox/text-to-speech)

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