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

# Groq

> Text-to-speech service implementation using Groq's TTS API

## Overview

`GroqTTSService` provides fast text-to-speech synthesis using Groq's TTS API with multiple voice options. The service operates at a fixed 48kHz sample rate and offers efficient audio streaming for real-time applications with ultra-low latency.

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

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

  <Card title="Groq Documentation" icon="book" href="https://console.groq.com/docs/api-reference#models">
    Official Groq API documentation and models
  </Card>

  <Card title="Voice Options" icon="microphone" href="https://console.groq.com/">
    Explore available voice models and features
  </Card>
</CardGroup>

## Installation

To use Groq services, install the required dependencies:

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

## Prerequisites

### Groq Account Setup

Before using Groq TTS services, you need:

1. **Groq Account**: Sign up at [Groq Console](https://console.groq.com/login)
2. **API Key**: Generate an API key from your account dashboard
3. **Voice Selection**: Choose from available voice models

### Required Environment Variables

* `GROQ_API_KEY`: Your Groq API key for authentication

## Configuration

### GroqTTSService

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

<ParamField path="model_name" type="str" default="canopylabs/orpheus-v1-english" deprecated>
  TTS model to use. *Deprecated in v0.0.105. Use
  `settings=GroqTTSService.Settings(model=...)` instead.*
</ParamField>

<ParamField path="voice_id" type="str" default="autumn" deprecated>
  Voice identifier to use. *Deprecated in v0.0.105. Use
  `settings=GroqTTSService.Settings(voice=...)` instead.*
</ParamField>

<ParamField path="output_format" type="str" default="wav">
  Audio output format.
</ParamField>

<ParamField path="sample_rate" type="int" default="48000">
  Audio sample rate. Must be 48000 Hz for Groq TTS.
</ParamField>

<ParamField path="params" type="InputParams" default="None" deprecated>
  *Deprecated in v0.0.105. Use `settings=GroqTTSService.Settings(...)` instead.*
</ParamField>

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

### Settings

Runtime-configurable settings passed via the `settings` constructor argument using `GroqTTSService.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 rate control.                   |

## Usage

### Basic Setup

```python theme={null}
from pipecat.services.groq import GroqTTSService

tts = GroqTTSService(
    api_key=os.getenv("GROQ_API_KEY"),
    settings=GroqTTSService.Settings(
        voice="autumn",
    ),
)
```

### With Custom Settings

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

tts = GroqTTSService(
    api_key=os.getenv("GROQ_API_KEY"),
    settings=GroqTTSService.Settings(
        model="canopylabs/orpheus-v1-english",
        voice="autumn",
        language=Language.EN,
        speed=1.2,
    ),
)
```

<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

* **Fixed sample rate**: Groq TTS only supports 48kHz sample rate. Setting a different value will produce a warning.
* **WAV output**: The service outputs WAV-formatted audio, which is decoded internally to extract raw PCM frames.
