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

# MiniMax

> Text-to-speech service implementation using MiniMax T2A API

## Overview

`MiniMaxTTSService` provides high-quality text-to-speech synthesis using MiniMax's T2A (Text-to-Audio) API with streaming capabilities, emotional voice control, and support for multiple languages. The service offers various models optimized for different use cases, from low-latency to high-definition audio quality.

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

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

  <Card title="MiniMax Documentation" icon="book" href="https://platform.minimax.io/docs/api-reference/speech-t2a-http">
    Official MiniMax T2A API documentation
  </Card>

  <Card title="MiniMax Platform" icon="microphone" href="https://www.minimax.io/platform/">
    Access voice models and API credentials
  </Card>
</CardGroup>

## Installation

To use MiniMax services, no additional dependencies are required beyond the base installation:

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

## Prerequisites

### MiniMax Account Setup

Before using MiniMax TTS services, you need:

1. **MiniMax Account**: Sign up at [MiniMax Platform](https://www.minimax.io/platform/)
2. **API Credentials**: Get your API key and Group ID from the platform
3. **Voice Selection**: Choose from available voice models and emotional settings

### Required Environment Variables

* `MINIMAX_API_KEY`: Your MiniMax API key for authentication
* `MINIMAX_GROUP_ID`: Your MiniMax group ID

## Configuration

### MiniMaxHttpTTSService

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

<ParamField path="group_id" type="str" required>
  MiniMax Group ID to identify project.
</ParamField>

<ParamField path="voice_id" type="str" default="Calm_Woman" deprecated>
  Voice identifier for synthesis.

  *Deprecated in v0.0.105. Use `settings=MiniMaxHttpTTSService.Settings(...)` instead.*
</ParamField>

<ParamField path="model" type="str" default="speech-02-turbo" deprecated>
  TTS model name. Options include `speech-2.6-hd`, `speech-2.6-turbo`,
  `speech-02-hd`, `speech-02-turbo`, `speech-01-hd`, `speech-01-turbo`.

  *Deprecated in v0.0.105. Use `settings=MiniMaxHttpTTSService.Settings(...)` instead.*
</ParamField>

<ParamField path="base_url" type="str" default="https://api.minimax.io/v1/t2a_v2">
  API base URL. Use `https://api.minimaxi.chat/v1/t2a_v2` for mainland China or
  `https://api-uw.minimax.io/v1/t2a_v2` for western United States.
</ParamField>

<ParamField path="aiohttp_session" type="aiohttp.ClientSession" required>
  An aiohttp session for HTTP requests.
</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>

<ParamField path="params" type="InputParams" default="None" deprecated>
  Runtime-configurable voice and generation settings. See
  [InputParams](#inputparams) below.

  *Deprecated in v0.0.105. Use `settings=MiniMaxHttpTTSService.Settings(...)` instead.*
</ParamField>

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

### Settings

Runtime-configurable settings passed via the `settings` constructor argument using `MiniMaxHttpTTSService.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.)* |
| `speed`              | `float`           | `NOT_GIVEN` | Speech speed.                          |
| `volume`             | `float`           | `NOT_GIVEN` | Volume level.                          |
| `pitch`              | `int`             | `NOT_GIVEN` | Pitch adjustment.                      |
| `emotion`            | `str`             | `NOT_GIVEN` | Emotion for synthesis.                 |
| `text_normalization` | `bool`            | `NOT_GIVEN` | Whether to apply text normalization.   |
| `latex_read`         | `bool`            | `NOT_GIVEN` | Whether to read LaTeX formulas.        |
| `language_boost`     | `str`             | `NOT_GIVEN` | Language boost setting.                |

## Usage

### Basic Setup

```python theme={null}
import aiohttp
from pipecat.services.minimax import MiniMaxHttpTTSService

async with aiohttp.ClientSession() as session:
    tts = MiniMaxHttpTTSService(
        api_key=os.getenv("MINIMAX_API_KEY"),
        group_id=os.getenv("MINIMAX_GROUP_ID"),
        aiohttp_session=session,
    )
```

### With Voice Customization

```python theme={null}
import aiohttp
from pipecat.services.minimax import MiniMaxHttpTTSService
from pipecat.transcriptions.language import Language

async with aiohttp.ClientSession() as session:
    tts = MiniMaxHttpTTSService(
        api_key=os.getenv("MINIMAX_API_KEY"),
        group_id=os.getenv("MINIMAX_GROUP_ID"),
        aiohttp_session=session,
        settings=MiniMaxHttpTTSService.Settings(
            voice="Calm_Woman",
            model="speech-02-hd",
            language=Language.ZH,
            speed=1.2,
            emotion="happy",
        ),
    )
```

<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

* **HTTP-based streaming**: MiniMax uses an HTTP streaming API, not WebSocket. Audio data is returned in hex-encoded PCM chunks.
* **Emotional voice control**: The `emotion` parameter lets you adjust the emotional tone of the voice without changing the voice model itself.
* **Model selection**: The `speech-2.6-*` models are the latest and support additional languages (Filipino, Tamil, Persian). Use `turbo` variants for lower latency or `hd` variants for higher quality.
* **The Python class is named `MiniMaxHttpTTSService`**, not `MiniMaxTTSService`.
