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

# SLNG Speech-to-Text

> SlngSTTService streams real-time STT over a persistent WebSocket to SLNG, a unified voice AI gateway routing multiple providers.

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

## Overview

`SlngSTTService` provides real-time speech-to-text transcription over a
persistent WebSocket connection to [SLNG](https://slng.ai), a unified voice AI
gateway that routes to multiple STT providers (Deepgram, ElevenLabs, Rime,
Sarvam, and more) through a single API key. Swap the `model` string to switch
providers; no other code changes needed. The service emits
`TranscriptionFrame` and `InterimTranscriptionFrame` results.

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

> [card] [PyPI Package](https://pypi.org/project/pipecat-slng/)
>
> The `pipecat-slng` package on PyPI

> [card] [SLNG Website](https://slng.ai)
>
> Learn about the SLNG unified voice AI gateway

> [card] [SLNG Docs](https://docs.slng.ai/)
>
> Documentation for the SLNG platform

## Installation

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

```bash theme={null}
uv add pipecat-slng
```

## Prerequisites

### SLNG Account Setup

Before using the SLNG STT service, you need:

1. **SLNG Account**: Sign up at [SLNG](https://slng.ai/)
2. **API Key**: Get an API key from [slng.ai](https://slng.ai)

### Required Environment Variables

* `SLNG_API_KEY`: Your SLNG API key for authentication

## Configuration

**api\_key** `str` *required*

Authentication key for the SLNG API.

**model** `str` (default: slng/deepgram/nova:3-en)

The transcription model to use. Use a `slng/...` prefix for SLNG-hosted
routes, or an external route (e.g. `deepgram/nova:3`) proxied through SLNG.

**base\_url** `str` (default: api.slng.ai)

The API host (without scheme).

**encoding** `str` (default: linear16)

Audio encoding format. One of `"linear16"`, `"mp3"`, or `"opus"`.

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

Audio sample rate in Hz. If `None`, uses the pipeline sample rate.

**region\_override** `str` (default: None)

Pin requests to a specific datacenter (e.g. `ap-southeast-2`, `eu-north-1`,
`us-east-1`). Sent as the `X-Region-Override` header.

**world\_part\_override** `str` (default: None)

Constrain routing to a broad geographic zone (`ap`, `eu`, or `na`). Sent as
the `X-World-Part-Override` header. If `region_override` is also set, it wins.

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

Your own upstream provider API key (BYOK). Sent as the `X-Slng-Provider-Key`
header so the provider bills your account directly. Only supported on external
catalog routes (no `slng/` prefix); SLNG-hosted `slng/...` routes reject it
with a 400. See the [BYOK docs](https://docs.slng.ai/execution-layer/byok).

**language** `Language` (default: Language.EN)

Recognition language. Defaults to `Language.EN` when not given.

**enable\_vad** `bool` (default: True)

Enable server-side VAD. Defaults to `True` when not given.

**enable\_partials** `bool` (default: True)

Stream partial (interim) transcripts. Defaults to `True` when not given.

**settings** `SlngSTTService.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 `SlngSTTService.Settings(...)`. The settings dataclass extends Pipecat's
`STTSettings`.

| Parameter | Type | Default | Description |
| - | - | - | - |
| `model` | `str` | `"slng/deepgram/nova:3-en"` | The transcription model to use. |
| `language` | `Language` | `Language.EN` | Language for speech recognition. |
| `enable_vad` | `bool` | `True` | Whether to enable server-side VAD. |
| `enable_partials` | `bool` | `True` | Whether to receive partial (interim) transcripts. |

> [!NOTE]
>
> When the provider surfaces a confidence score, transcripts below 0.5 are
> dropped. Changing `language` mid-session reconnects the WebSocket to re-run
> the init handshake. See the [source
> repository](https://github.com/slng-ai/pipecat-slng) for the authoritative,
> up-to-date list.

## Usage

```python theme={null}
import os

from pipecat_slng import SlngSTTService

stt = SlngSTTService(
    api_key=os.getenv("SLNG_API_KEY"),
    model="slng/deepgram/nova:3-en",
)

# ... add stt to your pipeline
```

## Compatibility

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


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