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

# Mistral

> Text-to-speech service using Mistral's Voxtral TTS API

## Overview

`MistralTTSService` provides text-to-speech synthesis using Mistral's Voxtral TTS API. It uses HTTP streaming with Server-Sent Events to generate PCM-encoded audio at 24kHz.

Key features include:

* Streaming TTS with real-time audio generation
* Automatic resampling to pipeline sample rate
* Built-in metrics support
* Multiple voice options

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

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

  <Card title="Mistral Documentation" icon="book" href="https://docs.mistral.ai/">
    Official Mistral API documentation
  </Card>
</CardGroup>

## Installation

To use Mistral TTS service, install the required dependencies:

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

## Prerequisites

Before using `MistralTTSService`, you need:

1. **Mistral Account**: Sign up at [Mistral AI](https://mistral.ai/)
2. **API Key**: Generate an API key from your account dashboard
3. **Model Access**: Ensure you have access to the Voxtral TTS API

### Required Environment Variables

* `MISTRAL_API_KEY`: Your Mistral API key for authentication

## Configuration

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

<ParamField path="sample_rate" type="int" default="None">
  Output audio sample rate in Hz. Audio is resampled from Mistral's native 24kHz
  when a different rate is requested. When `None`, uses the pipeline's
  configured sample rate.
</ParamField>

<ParamField path="settings" type="MistralTTSService.Settings" default="None">
  Runtime-configurable settings for the TTS service. See [Settings](#settings)
  below.
</ParamField>

### Settings

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

| Parameter  | Type              | Default                   | Description                              |
| ---------- | ----------------- | ------------------------- | ---------------------------------------- |
| `model`    | `str`             | `"voxtral-mini-tts-2603"` | Mistral TTS model to use. *(Inherited.)* |
| `voice`    | `str`             | `None`                    | Voice identifier. *(Inherited.)*         |
| `language` | `Language \| str` | `None`                    | Language for synthesis. *(Inherited.)*   |

## Available Voices

Mistral provides built-in voices grouped by language. The `voice` setting accepts
either the **slug** (e.g. `fr_marie_neutral`) or the **UUID**.

You can always retrieve the latest list of voices via the Mistral API:

```bash theme={null}
curl "https://api.mistral.ai/v1/audio/voices?limit=200&offset=0" \
  -H "Authorization: Bearer $MISTRAL_API_KEY"
```

You will have to extract the 'slug' or 'id' field from the response for each voice to use in the `voice` setting, for example:

```json theme={null}
{
  "name": "Marie - Neutral",
  "slug": "fr_marie_neutral",
  "languages": ["fr_fr"],
  "gender": "female",
  "age": 30,
  "tags": ["composed", "steady", "neutral"],
  "color": "#77778B",
  "description": null,
  "appearance": null,
  "retention_notice": 30,
  "id": "5a271406-039d-46fe-835b-fbbb00eaf08d",
  "created_at": "2026-03-12T09:46:53.411124Z",
  "user_id": null,
  "trimmed_seconds": null
}
```

Slug example: `fr_marie_neutral` and UUID example: `5a271406-039d-46fe-835b-fbbb00eaf08d` can both be used as the `voice` identifier in the service settings.

## Usage

### Basic Setup

```python theme={null}
import os
from pipecat.services.mistral import MistralTTSService

tts = MistralTTSService(
    api_key=os.getenv("MISTRAL_API_KEY"),
)
```

### With a Built-in Voice

```python theme={null}
tts = MistralTTSService(
    api_key=os.getenv("MISTRAL_API_KEY"),
    settings=MistralTTSService.Settings(
        model="voxtral-mini-tts-2603",
        voice="fr_marie_neutral",  # see Available Voices section for all slugs
        language="fr",
    ),
)
```

### With a Custom Voice

If you have created a custom voice in your Mistral account, use its UUID as the `voice` identifier:

```python theme={null}
import os
from pipecat.services.mistral import MistralTTSService

tts = MistralTTSService(
    api_key=os.getenv("MISTRAL_API_KEY"),
    settings=MistralTTSService.Settings(
        voice="your-custom-voice-uuid",  # UUID from your Mistral account dashboard
    ),
)
```

### With Custom Sample Rate

```python theme={null}
import os
from pipecat.services.mistral import MistralTTSService

tts = MistralTTSService(
    api_key=os.getenv("MISTRAL_API_KEY"),
    sample_rate=16000,  # Resample from 24kHz to 16kHz
)
```

## Notes

* **Audio format conversion**: The Mistral API returns base64-encoded float32 PCM chunks via Server-Sent Events. The service automatically converts these to int16 PCM for the Pipecat pipeline.
* **Native sample rate**: Mistral's TTS API outputs audio at 24kHz. When a different sample rate is specified, the service automatically resamples the audio.
* **Streaming**: The service uses HTTP streaming with Server-Sent Events for real-time audio generation, allowing for low-latency synthesis.
* **Voice identifiers**: Both slugs (e.g. `fr_marie_neutral`) and UUIDs are accepted. Built-in voice slugs are listed in the [Available Voices](#available-voices) section. Custom voices created in your Mistral account dashboard are referenced by their UUID.

## Event Handlers

This service does not currently expose connection event handlers, as it uses HTTP streaming rather than persistent WebSocket connections.
