> ## Documentation Index
> Fetch the complete documentation index at: https://daily-docs-source-analytics-user-turn-strategies.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# SLNG

> Speech-to-text service using the SLNG unified voice AI gateway over WebSocket

export const CommunityMaintained = ({maintainer, maintainerUrl, repo}) => <Note>
    <strong>Community-maintained integration.</strong> This service is built and
    maintained by{" "}
    <a href={maintainerUrl} target="_blank" rel="noreferrer">
      {maintainer}
    </a>
    . Pipecat does not test or officially support it. Please report issues and
    request changes on the{" "}
    <a href={repo} target="_blank" rel="noreferrer">
      source repository
    </a>
    . Learn more about{" "}
    <a href="/api-reference/server/services/community-integrations">
      community integrations
    </a>
    .
  </Note>;

<CommunityMaintained maintainer="slng-ai" maintainerUrl="https://github.com/slng-ai" repo="https://github.com/slng-ai/pipecat-slng" />

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

<CardGroup cols={2}>
  <Card title="Source Repository" icon="github" href="https://github.com/slng-ai/pipecat-slng">
    Source code, examples, and issues for the SLNG integration
  </Card>

  <Card title="PyPI Package" icon="cube" href="https://pypi.org/project/pipecat-slng/">
    The `pipecat-slng` package on PyPI
  </Card>

  <Card title="SLNG Website" icon="book" href="https://slng.ai">
    Learn about the SLNG unified voice AI gateway
  </Card>

  <Card title="SLNG Docs" icon="book" href="https://docs.slng.ai/">
    Documentation for the SLNG platform
  </Card>
</CardGroup>

## Installation

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

```bash theme={null}
uv add pipecat-slng
# or
pip install 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

<ParamField path="api_key" type="str" required>
  Authentication key for the SLNG API.
</ParamField>

<ParamField path="model" type="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.
</ParamField>

<ParamField path="base_url" type="str" default="api.slng.ai">
  The API host (without scheme).
</ParamField>

<ParamField path="encoding" type="str" default="linear16">
  Audio encoding format. One of `"linear16"`, `"mp3"`, or `"opus"`.
</ParamField>

<ParamField path="sample_rate" type="int" default="None">
  Audio sample rate in Hz. If `None`, uses the pipeline sample rate.
</ParamField>

<ParamField path="region_override" type="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.
</ParamField>

<ParamField path="world_part_override" type="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.
</ParamField>

<ParamField path="provider_key" type="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).
</ParamField>

<ParamField path="language" type="Language" default="Language.EN">
  Recognition language. Defaults to `Language.EN` when not given.
</ParamField>

<ParamField path="enable_vad" type="bool" default="True">
  Enable server-side VAD. Defaults to `True` when not given.
</ParamField>

<ParamField path="enable_partials" type="bool" default="True">
  Stream partial (interim) transcripts. Defaults to `True` when not given.
</ParamField>

<ParamField path="settings" type="SlngSTTService.Settings" default="None">
  Runtime-updatable settings override, merged on top of the explicit kwargs
  above. See [Settings](#settings) below.
</ParamField>

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

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