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

# Rime Speech-to-Text

> Streaming STT with RimeSTTService: each VAD speech segment goes to Rime as its own request, with interim transcripts and one final.

## Overview

`RimeSTTService` transcribes speech with Rime's streaming recognition. Rime transcribes one utterance per stream, so the service streams each VAD speech segment as its own request and pushes interim transcripts followed by one final.

> [card] [Rime STT API Reference](https://reference-server.pipecat.ai/en/latest/api/pipecat.services.rime.stt.html)
>
> Pipecat's API methods for Rime STT integration

> [card] [Example Implementation](https://github.com/pipecat-ai/pipecat/blob/main/examples/transcription/transcription-rime.py)
>
> Complete example with Rime STT

> [card] [Rime Documentation](https://docs.rime.ai/)
>
> Official Rime API documentation

## Installation

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

## Prerequisites

### Rime Account Setup

Before using `RimeSTTService`, you need:

1. **Rime Account**: Sign up at [Rime AI](https://docs.rime.ai/)
2. **API Key**: Generate an API key from your account dashboard

### Required Environment Variables

* `RIME_API_KEY`: Your Rime API key for authentication

### Voice Activity Detection

`RimeSTTService` starts a request on `VADUserStartedSpeakingFrame` and ends it on `VADUserStoppedSpeakingFrame`. Use the user aggregator's VAD analyzer or a `VADProcessor` so these frames reach the service.

## Configuration

### RimeSTTService

```python theme={null}
from pipecat.services.rime.stt import RimeSTTService
```

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

Rime API key. When `None`, the `RIME_API_KEY` environment variable is used.

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

Audio sample rate in Hz. When `None`, the pipeline's input sample rate is
used. Rime takes 8000, 16000, 24000, and 48000 Hz; any other rate is resampled
to 16000 Hz before sending.

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

Runtime-configurable settings. See [Settings](#settings) below.

**ttfs\_p99\_latency** `float | None` (default: RIME\_TTFS\_P99)

P99 latency from speech end to final transcript, in seconds. Override it for
your deployment. See the [STT
benchmark](https://github.com/pipecat-ai/stt-benchmark).

### Settings

Runtime-configurable settings passed via the `settings` constructor argument using `RimeSTTService.Settings(...)`. These can be updated mid-conversation with `STTUpdateSettingsFrame`, and apply to speech segments that start afterwards. See [Service Settings](https://docs.pipecat.ai/pipecat/fundamentals/service-settings.md) for details.

| Parameter | Type | Default | Description |
| - | - | - | - |
| `model` | `None` | `None` | Must be `None`: Rime selects the recognizer. *(Inherited from base STT settings.)* |
| `language` | `Language \| str` | `"en"` | Spoken language as a BCP-47 tag, passed to Rime unchanged. See Rime's documentation for supported languages. Must be a nonempty string. *(Inherited from base STT settings.)* |
| `mode` | `Literal["written", "verbatim"]` | `"written"` | `"written"` formats the transcript as written text. `"verbatim"` transcribes the words as spoken. |
| `context_terms` | `Sequence[str]` | `()` | Recognition hints, such as product names, kept in order. Each term must be nonempty and free of `<\|...\|>` control markers, and the terms joined with `", "` must fit in 1,024 UTF-8 bytes. |
| `output_contract` | `Literal["revised_hypotheses", "append_fragments"]` | `"revised_hypotheses"` | How Rime sends interim results: as replacement hypotheses or as append-only fragments. Both produce cumulative interim transcripts and one final. |

The constructor raises `ValueError` for an invalid value or a non-empty `extra`. An invalid settings update pushes an `ErrorFrame` and leaves the settings unchanged.

## Usage

### Basic Setup

```python theme={null}
import os

from pipecat.services.rime.stt import RimeSTTService

stt = RimeSTTService(api_key=os.getenv("RIME_API_KEY"))
```

### With Context Terms

```python theme={null}
stt = RimeSTTService(
    api_key=os.getenv("RIME_API_KEY"),
    settings=RimeSTTService.Settings(
        language="en",
        mode="verbatim",
        context_terms=["Pipecat", "Rime"],
    ),
)
```

## Notes

* **Segment length**: A speech segment that runs about 90 to 110 seconds without a pause fails with no transcript.
* **Transcript order**: Finals are pushed in speech order. When the user resumes speaking before an earlier segment's final arrives, only the latest segment's final finalizes the turn.
* **Errors**: A failed request pushes a non-fatal `ErrorFrame` naming the Rime error type and request ID.


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