# Chatterboxhd

> Generate expressive, natural speech with Resemble AI's Chatterbox. Features unique emotion control, instant voice cloning from short audio, and built-in watermarking.


## Overview

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


## Pricing

Your request will cost **$0.04** 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`, _optional_):
  Text to synthesize into speech. Default value: `"My name is Maximus Decimus Meridius, commander of the Armies of the North, General of the Felix Legions and loyal servant to the true emperor, Marcus Aurelius. Father to a murdered son, husband to a murdered wife. And I will have my vengeance, in this life or the next."`
  - Default: `"My name is Maximus Decimus Meridius, commander of the Armies of the North, General of the Felix Legions and loyal servant to the true emperor, Marcus Aurelius. Father to a murdered son, husband to a murdered wife. And I will have my vengeance, in this life or the next."`

- **`voice`** (`VoiceEnum`, _optional_):
  The voice to use for the TTS request. If neither voice nor audio are provided, a random voice will be used.
  - Options: `"Aurora"`, `"Blade"`, `"Britney"`, `"Carl"`, `"Cliff"`, `"Richard"`, `"Rico"`, `"Siobhan"`, `"Vicky"`

- **`audio_url`** (`string`, _optional_):
  URL to the audio sample to use as a voice prompt for zero-shot TTS voice cloning. Providing a audio sample will override the voice setting. If neither voice nor audio_url are provided, a random voice will be used.
  - Examples: "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3", "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_old_movie.flac"

- **`exaggeration`** (`float`, _optional_):
  Controls emotion exaggeration. Range typically 0.25 to 2.0. Default value: `0.5`
  - Default: `0.5`
  - Range: `0.25` to `2`

- **`cfg`** (`float`, _optional_):
  Classifier-free guidance scale (CFG) controls the conditioning factor. Range typically 0.2 to 1.0. For expressive or dramatic speech, try lower cfg values (e.g. ~0.3) and increase exaggeration to around 0.7 or higher. If the reference speaker has a fast speaking style, lowering cfg to around 0.3 can improve pacing. Default value: `0.5`
  - Default: `0.5`
  - Range: `0` to `1`

- **`high_quality_audio`** (`boolean`, _optional_):
  If True, the generated audio will be upscaled to 48kHz. The generation of the audio will take longer, but the quality will be higher. If False, the generated audio will be 24kHz.
  - Default: `false`

- **`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.
  - Default: `0`

- **`temperature`** (`float`, _optional_):
  Controls the randomness of generation. Range typically 0.05 to 5. Default value: `0.8`
  - Default: `0.8`
  - Range: `0.05` to `5`



**Required Parameters Example**:

```json
{}
```

**Full Example**:

```json
{
  "text": "My name is Maximus Decimus Meridius, commander of the Armies of the North, General of the Felix Legions and loyal servant to the true emperor, Marcus Aurelius. Father to a murdered son, husband to a murdered wife. And I will have my vengeance, in this life or the next.",
  "audio_url": "https://storage.googleapis.com/chatterbox-demo-samples/prompts/male_rickmorty.mp3",
  "exaggeration": 0.5,
  "cfg": 0.5,
  "temperature": 0.8
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`Audio`, _required_):
  The generated audio file.
  - Examples: {"url":"https://storage.googleapis.com/chatterbox-demo-samples/samples/gladiator_rick.wav"}, {"url":"https://storage.googleapis.com/chatterbox-demo-samples/samples/gladiator_old_movie.wav"}



**Example Response**:

```json
{
  "audio": {
    "url": "https://storage.googleapis.com/chatterbox-demo-samples/samples/gladiator_rick.wav"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/resemble-ai/chatterboxhd/text-to-speech \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{}'
```

### 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(
    "resemble-ai/chatterboxhd/text-to-speech",
    arguments={},
    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("resemble-ai/chatterboxhd/text-to-speech", {
  input: {},
  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/resemble-ai/chatterboxhd/text-to-speech)
- [API Documentation](https://fal.ai/models/resemble-ai/chatterboxhd/text-to-speech/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=resemble-ai/chatterboxhd/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)
