# Source: https://docs.pipecat.ai/server/services/tts/deepgram.md

# Source: https://docs.pipecat.ai/server/services/stt/deepgram.md

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

# Deepgram

> Speech-to-text service implementations using Deepgram's real-time transcription and Flux APIs

## Overview

Deepgram provides two STT service implementations:

* `DeepgramSTTService` for real-time speech recognition using Deepgram's standard WebSocket API with support for interim results, language detection, and voice activity detection (VAD)
* `DeepgramFluxSTTService` for advanced conversational AI with Flux capabilities including intelligent turn detection, eager end-of-turn events, and enhanced speech processing for improved response timing.

<Note>
  Since Deepgram Flux provides its own user turn start and end detection, you
  should use `ExternalUserTurnStrategies` to let Flux handle turn management.
  See [User Turn
  Strategies](/server/utilities/turn-management/user-turn-strategies) for
  configuration details.
</Note>

<CardGroup cols={2}>
  <Card title="Deepgram STT API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.deepgram.stt.html">
    Pipecat's API methods for standard Deepgram STT
  </Card>

  <Card title="Deepgram Flux API Reference" icon="code" href="https://reference-server.pipecat.ai/en/latest/api/pipecat.services.deepgram.flux.stt.html">
    Pipecat's API methods for Deepgram Flux STT
  </Card>

  <Card title="Standard STT Example" icon="play" href="https://github.com/pipecat-ai/pipecat/blob/main/examples/foundational/07c-interruptible-deepgram.py">
    Complete example with standard Deepgram STT
  </Card>

  <Card title="Flux STT Example" icon="play" href="https://github.com/pipecat-ai/pipecat/blob/main/examples/foundational/07c-interruptible-deepgram-flux.py">
    Complete example with Deepgram Flux STT
  </Card>

  <Card title="Deepgram Documentation" icon="book" href="https://developers.deepgram.com/docs/pre-recorded-audio">
    Official Deepgram documentation and features
  </Card>

  <Card title="Deepgram Console" icon="microphone" href="https://console.deepgram.com/signup">
    Access API keys and transcription models
  </Card>
</CardGroup>

## Installation

To use Deepgram services, install the required dependencies:

```bash  theme={null}
pip install "pipecat-ai[deepgram]"
```

## Prerequisites

### Deepgram Account Setup

Before using Deepgram STT services, you need:

1. **Deepgram Account**: Sign up at [Deepgram Console](https://console.deepgram.com/signup)
2. **API Key**: Generate an API key from your console dashboard
3. **Model Selection**: Choose from available transcription models and features

### Required Environment Variables

* `DEEPGRAM_API_KEY`: Your Deepgram API key for authentication