> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pipecat.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LMNT

> Text-to-speech service implementation using LMNT's streaming API

## Overview

`LMNTTTSService` provides real-time text-to-speech synthesis through LMNT's WebSocket-based streaming API optimized for conversational AI. The service offers ultra-low latency with high-quality voice models and supports multiple languages with automatic interruption handling.

<CardGroup cols={2}>
  <Card title="LMNT TTS API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.lmnt.tts.html">
    Pipecat's API methods for LMNT TTS integration
  </Card>

  <Card title="Example Implementation" icon="play" href="https://github.com/pipecat-ai/pipecat/blob/main/examples/voice/voice-lmnt.py">
    Complete example with voice synthesis
  </Card>

  <Card title="LMNT Documentation" icon="book" href="https://docs.lmnt.com/api-reference/speech/streaming">
    Official LMNT streaming speech API documentation
  </Card>

  <Card title="Voice Library" icon="microphone" href="https://app.lmnt.com/">
    Browse and create custom voices
  </Card>
</CardGroup>

## Installation

To use LMNT services, install the required dependencies:

```bash theme={null}
uv add "pipecat-ai[lmnt]"
```

## Prerequisites

### LMNT Account Setup

Before using LMNT TTS services, you need:

1. **LMNT Account**: Sign up at [LMNT Console](https://app.lmnt.com/)
2. **API Key**: Generate an API key from your account dashboard
3. **Voice Selection**: Choose from available voice models or create custom voices

### Required Environment Variables

* `LMNT_API_KEY`: Your LMNT API key for authentication

## Configuration

### LmntTTSService

<ParamField path="api_key" type="str" required>
  LMNT API key for authentication.
</ParamField>

<ParamField path="voice_id" type="str" required deprecated>
  ID of the voice to use for synthesis. *Deprecated in v0.0.105. Use
  `settings=LmntTTSService.Settings(voice=...)` instead.*
</ParamField>

<ParamField path="model" type="str" default="blizzard" deprecated>
  LMNT TTS model to use. *Deprecated in v0.0.105. Use
  `settings=LmntTTSService.Settings(model=...)` instead.*
</ParamField>

<ParamField path="language" type="Language" default="Language.EN" deprecated>
  Language for synthesis. Supports multiple languages including German, English,
  Spanish, French, Hindi, and more. *Deprecated in v0.0.106. Use
  `settings=LmntTTSService.Settings(language=...)` instead.*
</ParamField>

<ParamField path="settings" type="LmntTTSService.Settings" default="None">
  Runtime-configurable settings. See [Settings](#settings) below.
</ParamField>

<ParamField path="sample_rate" type="int" default="None">
  Output audio sample rate in Hz. When `None`, uses the pipeline's configured
  sample rate.
</ParamField>

### Settings

Runtime-configurable settings passed via the `settings` constructor argument using `LmntTTSService.Settings(...)`. These can be updated mid-conversation with `TTSUpdateSettingsFrame`. See [Service Settings](/pipecat/fundamentals/service-settings) for details.

| Parameter  | Type              | Default | Description                            |
| ---------- | ----------------- | ------- | -------------------------------------- |
| `model`    | `str`             | `None`  | Model identifier. *(Inherited.)*       |
| `voice`    | `str`             | `None`  | Voice identifier. *(Inherited.)*       |
| `language` | `Language \| str` | `None`  | Language for synthesis. *(Inherited.)* |

## Usage

### Basic Setup

```python theme={null}
from pipecat.services.lmnt import LmntTTSService

tts = LmntTTSService(
    api_key=os.getenv("LMNT_API_KEY"),
    settings=LmntTTSService.Settings(
        voice="lily",
    ),
)
```

### With Language Configuration

```python theme={null}
from pipecat.services.lmnt import LmntTTSService
from pipecat.transcriptions.language import Language

tts = LmntTTSService(
    api_key=os.getenv("LMNT_API_KEY"),
    settings=LmntTTSService.Settings(
        voice="lily",
        model="aurora",
        language=Language.ES,
    ),
)
```

<Tip>
  The `InputParams` / `params=` pattern is deprecated as of v0.0.105. Use
  `Settings` / `settings=` instead. See the [Service Settings
  guide](/pipecat/fundamentals/service-settings) for migration details.
</Tip>

## Notes

* **WebSocket-based streaming**: LMNT uses a persistent WebSocket connection for low-latency audio synthesis with automatic reconnection.
* **Class name**: The Python class is `LmntTTSService` (note the lowercase 'mnt').

## Event Handlers

LMNT TTS supports the standard [service connection events](/api-reference/server/events/service-events):

| Event                 | Description                         |
| --------------------- | ----------------------------------- |
| `on_connected`        | Connected to LMNT WebSocket         |
| `on_disconnected`     | Disconnected from LMNT WebSocket    |
| `on_connection_error` | WebSocket connection error occurred |

```python theme={null}
@tts.event_handler("on_connected")
async def on_connected(service):
    print("Connected to LMNT")
```
