Skip to main content
pipecat-slng adds speech to text (STT) and text to speech (TTS) services for Pipecat. It routes your pipeline through the SLNG gateway, so any streaming model on the platform works behind one API key. Swap the model string to switch provider; no other code changes. This page is the plugin reference. For a walkthrough that sets up your models in the dashboard and applies the change, see the Pipecat integration guide.
Tested with Pipecat v1.3.0. BYOK requires pipecat-slng 0.4.0 or later.

Prerequisites

Install

Quickstart

Each service reads your key via api_key. Create an STT and a TTS service and add them to your pipeline:
Both services stream over WebSocket, with low latency and mid-utterance interruption. Common runtime knobs are top-level keyword arguments (language, speed, enable_vad, enable_partials); for richer overrides, pass SlngSTTSettings(...) or SlngTTSSettings(...) to settings=.
A cascade pipeline (STT → LLM → TTS) using SLNG for speech and OpenAI for the language model. The full version, including the Daily transport, lives in examples/bot.py.
bot.py

Model identifiers

Models follow provider/model:variant, with a -lang suffix where the model exposes per-language variants. Prefix with slng/ for an SLNG-hosted instance; a bare identifier is the external passthrough route, required for BYOK.
The full list is the model catalog. Not every model accepts every option (for example speed on TTS); check the Unified TTS reference before tuning.

STT reference

SlngSTTService streams speech to text over WebSocket, connecting to wss://api.slng.ai/v1/bridges/unmute/stt/{model}. Transcripts below 0.5 confidence are dropped before reaching your pipeline. Language is imported from pipecat.transcriptions.language.

TTS reference

SlngTTSService streams text to speech over WebSocket, connecting to wss://api.slng.ai/v1/bridges/unmute/tts/{model}. This is the recommended path for interactive agents. Changing voice, speed, or language mid-session reconnects the WebSocket to re-run the init handshake. Pick a voice from the text to speech catalog.
Prefer the streaming SlngTTSService for conversational agents. For batch or non-interactive synthesis, SlngHttpTTSService issues one HTTP POST per utterance. Its body accepts only {text, voice}, so encoding, sample rate, language, and speed are not configurable over HTTP; compressed responses yield an ErrorFrame.

Region routing

Route to a sovereign hub by pointing base_url at a regional gateway host, for example eu.api.slng.ai or us.api.slng.ai. Data stays in-jurisdiction and every hub runs the full stack. See the regions map for the available hosts.

Bring your own key (BYOK)

Pass provider_key to bill an upstream provider directly on your own contract; all three services forward it as the X-Slng-Provider-Key header, and the SLNG cache still applies on top. See Bring your own key.
BYOK works on external routes only (no slng/ prefix). SLNG-hosted routes reject the header with an HTTP 400. Since 0.4.0, WebSocket connect-rejection errors include the server’s response body, so a misrouted request reports the reason.

Next steps