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
- Python 3.11+ and
pipecat-ai>=1.3.0 - A Pipecat project
- An SLNG API key. See Create your API key.
Install
Quickstart
Each service reads your key viaapi_key. Create an STT and a TTS service and add
them to your pipeline:
language,
speed, enable_vad, enable_partials); for richer overrides, pass
SlngSTTSettings(...) or SlngTTSSettings(...) to settings=.
Full voice agent example
Full voice agent example
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 followprovider/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.
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.
Region routing
Route to a sovereign hub by pointingbase_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)
Passprovider_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
- Pipecat integration guide for the migration walkthrough.
- The model catalog and Unified API guide.
- Using LiveKit instead? See the LiveKit plugin.