# PlayAI Text-to-Speech Dialog

> Generate natural-sounding multi-speaker dialogues, and audio. Perfect for expressive outputs, storytelling, games, animations, and interactive media.


## Overview

- **Endpoint**: `https://fal.run/fal-ai/playai/tts/dialog`
- **Model ID**: `fal-ai/playai/tts/dialog`
- **Category**: text-to-audio
- **Kind**: inference
**Tags**: audio



## Pricing

Your request will cost **$0.05 per minute per audio minute generated**. For **$1** you can generate **20 minutes of audio**.

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:


- **`input`** (`string`, _required_):
  The dialogue text with turn prefixes to distinguish speakers.
  - Examples: "Speaker 1: Hey, did you catch the game last night?\nSpeaker 2: Of course! What a match—it had me on the edge of my seat.\nSpeaker 1: Same here! That last-minute goal was unreal. Who's your MVP?\nSpeaker 2: Gotta be the goalie. Those saves were unbelievable.\nSpeaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?\nSpeaker 2: Oh, you bet. I’m already stocked up on snacks!\n"

- **`voices`** (`list<LDMVoiceInput>`, _optional_):
  A list of voice definitions for each speaker in the dialogue. Must be between 1 and 2 voices.
  - Default: `[{"voice":"Jennifer (English (US)/American)","turn_prefix":"Speaker 1: "},{"voice":"Furio (English (IT)/Italian)","turn_prefix":"Speaker 2: "}]`
  - Array of LDMVoiceInput

- **`response_format`** (`ResponseFormatEnum`, _optional_):
  The format of the response. Default value: `"url"`
  - Default: `"url"`
  - Options: `"url"`, `"bytes"`

- **`seed`** (`integer`, _optional_):
  An integer number greater than or equal to 0. If equal to null or not provided, a random seed will be used. 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.
  - Examples: null



**Required Parameters Example**:

```json
{
  "input": "Speaker 1: Hey, did you catch the game last night?\nSpeaker 2: Of course! What a match—it had me on the edge of my seat.\nSpeaker 1: Same here! That last-minute goal was unreal. Who's your MVP?\nSpeaker 2: Gotta be the goalie. Those saves were unbelievable.\nSpeaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?\nSpeaker 2: Oh, you bet. I’m already stocked up on snacks!\n"
}
```

**Full Example**:

```json
{
  "input": "Speaker 1: Hey, did you catch the game last night?\nSpeaker 2: Of course! What a match—it had me on the edge of my seat.\nSpeaker 1: Same here! That last-minute goal was unreal. Who's your MVP?\nSpeaker 2: Gotta be the goalie. Those saves were unbelievable.\nSpeaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?\nSpeaker 2: Oh, you bet. I’m already stocked up on snacks!\n",
  "voices": [
    {
      "voice": "Jennifer (English (US)/American)",
      "turn_prefix": "Speaker 1: "
    },
    {
      "voice": "Furio (English (IT)/Italian)",
      "turn_prefix": "Speaker 2: "
    }
  ],
  "response_format": "url",
  "seed": null
}
```


### Output Schema

The API returns the following output format:

- **`audio`** (`AudioFile`, _required_):
  The generated audio file.
  - Examples: {"file_size":584109,"duration":24.3,"file_name":"33dd5f07-f834-4080-aaac-4a253ce1660b.mp3","content_type":"audio/mpeg","url":"https://fal-api-audio-uploads.s3.amazonaws.com/33dd5f07-f834-4080-aaac-4a253ce1660b.mp3"}



**Example Response**:

```json
{
  "audio": {
    "file_size": 584109,
    "duration": 24.3,
    "file_name": "33dd5f07-f834-4080-aaac-4a253ce1660b.mp3",
    "content_type": "audio/mpeg",
    "url": "https://fal-api-audio-uploads.s3.amazonaws.com/33dd5f07-f834-4080-aaac-4a253ce1660b.mp3"
  }
}
```


## Usage Examples

### cURL

```bash
curl --request POST \
  --url https://fal.run/fal-ai/playai/tts/dialog \
  --header "Authorization: Key $FAL_KEY" \
  --header "Content-Type: application/json" \
  --data '{
     "input": "Speaker 1: Hey, did you catch the game last night?\nSpeaker 2: Of course! What a match—it had me on the edge of my seat.\nSpeaker 1: Same here! That last-minute goal was unreal. Who's your MVP?\nSpeaker 2: Gotta be the goalie. Those saves were unbelievable.\nSpeaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?\nSpeaker 2: Oh, you bet. I’m already stocked up on snacks!\n"
   }'
```

### 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/playai/tts/dialog",
    arguments={
        "input": "Speaker 1: Hey, did you catch the game last night?
    Speaker 2: Of course! What a match—it had me on the edge of my seat.
    Speaker 1: Same here! That last-minute goal was unreal. Who's your MVP?
    Speaker 2: Gotta be the goalie. Those saves were unbelievable.
    Speaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?
    Speaker 2: Oh, you bet. I’m already stocked up on snacks!
    "
    },
    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/playai/tts/dialog", {
  input: {
    input: "Speaker 1: Hey, did you catch the game last night?
  Speaker 2: Of course! What a match—it had me on the edge of my seat.
  Speaker 1: Same here! That last-minute goal was unreal. Who's your MVP?
  Speaker 2: Gotta be the goalie. Those saves were unbelievable.
  Speaker 1: Absolutely. Saved the day, literally! Are you planning to watch the next game?
  Speaker 2: Oh, you bet. I’m already stocked up on snacks!
  "
  },
  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/playai/tts/dialog)
- [API Documentation](https://fal.ai/models/fal-ai/playai/tts/dialog/api)
- [OpenAPI Schema](https://fal.ai/api/openapi/queue/openapi.json?endpoint_id=fal-ai/playai/tts/dialog)

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