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

# Audrey STT (p99lab)

> AudreySTTService streams real-time speech-to-text over a WebSocket to Audrey, p99lab's speech-to-text model for phone calls, meetings and accented speech.

> [!NOTE]
>
> **Community-maintained integration.** This service is built and
> maintained by
> [P99Lab](https://github.com/P99Lab)
> . Pipecat does not test or officially support it. Please report issues and
> request changes on the
> [source repository](https://github.com/P99Lab/pipecat-p99lab)
> . Learn more about
> [community integrations](https://docs.pipecat.ai/api-reference/server/services/community-integrations.md)
> .

## Overview

`AudreySTTService` streams the user's audio to [Audrey](https://p99lab.com),
p99lab's speech-to-text model for phone calls, meetings and accented speech,
over a WebSocket. It pushes `InterimTranscriptionFrame` while the user speaks
and a `TranscriptionFrame` for each finalised utterance. When the pipeline has
a turn analyzer, the service asks the server to finalise the open utterance as
soon as the user's turn ends, instead of waiting for the server's own silence
endpointing.

> [card] [Source Repository](https://github.com/P99Lab/pipecat-p99lab)
>
> Source code, examples, and issues for the p99lab integration

> [card] [Example](https://github.com/P99Lab/pipecat-p99lab/blob/main/examples/foundational/stt-audrey.py)
>
> A complete voice bot with Audrey speech-to-text

> [card] [p99lab Console](https://console.p99lab.com)
>
> Sign up and create an API key

> [card] [p99lab Website](https://p99lab.com)
>
> Learn about Audrey

## Installation

This is a community-maintained package distributed separately from `pipecat-ai`:

```bash theme={null}
uv pip install git+https://github.com/P99Lab/pipecat-p99lab.git
```

## Prerequisites

### p99lab Account Setup

Before using the Audrey STT service, you need:

1. **p99lab Account**: Sign up at [console.p99lab.com](https://console.p99lab.com)
2. **API Key**: Create an API key in the console

### Required Environment Variables

* `P99LAB_API_KEY`: Your p99lab API key for authentication
* `P99LAB_API_URL` (optional): API base URL. Defaults to the public Audrey API,
  `https://api.p99lab.com`.

## Configuration

**api\_key** `str` (default: None)

p99lab API key. If `None`, read from the `P99LAB_API_KEY` environment
variable.

**base\_url** `str` (default: None)

API base URL (`https://...`; the stream URL `wss://.../v1/stream` is derived
from it) or a full `wss://` stream URL. If `None`, read from
`P99LAB_API_URL`, else the public Audrey API.

**language** `Language | str` (default: en)

Recognition language: English by default, 30 languages supported (`"fr"`, `"de"`, `"ja"`, ...;
region codes such as `Language.PT_BR` are accepted). Turn detection and number formatting are English-only.

**prompt** `str` (default: None)

Context text, up to 500 characters: names, product terms, what the call is
about.

**endpoint\_ms** `int` (default: 600)

Silence in milliseconds (200 to 3000) after which the server finalises an
utterance by itself.

**flush\_on** `str` (default: turn)

When to ask the server to finalise the current utterance at once: `"turn"`
(at the end of the user's turn, when the pipeline has a turn analyzer),
`"vad"` (at every VAD stop) or `"never"`.

**sample\_rate** `int` (default: None)

Input sample rate. If `None`, uses the pipeline sample rate. Rates other than
8, 16, 24 and 48 kHz are resampled to 16 kHz.

**open\_timeout** `float` (default: 30.0)

Seconds to wait for the WebSocket handshake.

**settings** `AudreySTTService.Settings` (default: None)

Runtime-updatable settings override, merged on top of the explicit kwargs
above. See [Settings](#settings) below.

### Settings

Runtime-configurable settings passed via the `settings` constructor argument
using `AudreySTTService.Settings(...)`. The settings dataclass extends
Pipecat's `STTSettings`. Changing any of them finishes the current session and
opens a new one, so no transcript is lost.

| Parameter | Type | Default | Description |
| - | - | - | - |
| `language` | `str` | `"en"` | Language for speech recognition. |
| `prompt` | `str` | `None` | Context text, up to 500 characters. |
| `endpoint_ms` | `int` | `600` | Silence after which the server finalises an utterance. |
| `partial_ms` | `int` | `None` | How often a partial is sent, in ms of new speech (250 to 5000). |

### Errors

Dropped connections and transient server errors are retried with backoff.
Account refusals are pushed as a permanent `ErrorFrame` whose `exception` is
an `AudreyAPIError` with `status` and `code`: 401 (unknown or revoked key), 402
(the account cannot pay; `reason` and `console_url` say how to fix it) and 429
for the key's daily limit.

## Usage

```python theme={null}
from pipecat_p99lab import AudreySTTService

stt = AudreySTTService(
    language="en",
    prompt="Acme Dental, Dr. Okafor",
)

# ... add stt to your pipeline, between transport.input() and the user aggregator
```

## Compatibility

Tested with Pipecat v1.12.0. Check the [source
repository](https://github.com/P99Lab/pipecat-p99lab) for the latest tested
version and changelog.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.