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.8.0.
world_part requires pipecat-slng 0.6.0 or
later. Upgrading from an earlier release? See Move from base_url.Prerequisites
- Python 3.11+ and
pipecat-ai>=1.8.0 - A Pipecat project
- An SLNG API key. See Create your API key.
Install
Quickstart
Each service reads your key viaapi_key and needs a world_part, the region
that handles its requests. Create an STT and a TTS service and add them to your
pipeline:
language,
speed, 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://{region}.api.slng.ai/v1/bridges/unmute/stt/{model}. Partial transcripts
below 0.5 confidence are dropped before reaching your pipeline. Final
transcripts are always kept. Language is imported from
pipecat.transcriptions.language.
TTS reference
SlngTTSService streams text to speech over WebSocket, connecting to
wss://{region}.api.slng.ai/v1/bridges/unmute/tts/{model}. 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
world_part picks the region that handles a service’s requests. The service
connects to {region}.api.slng.ai, and requests are not routed between
regions. Each service takes its own world_part, so STT and TTS can run in
different regions. Pass the region code as a string or as a WorldPart value.
This example runs Soniox STT and Fish TTS in Germany:
Move from base_url
Releases before 0.6.0 picked the region with base_url. Remove base_url and
pass world_part instead. base_url still works if its host matches
world_part, but it logs a DeprecationWarning:
region_overrideandworld_part_override. Useworld_part.enable_vadonSlngSTTService. The service no longer sends it, and it never changed transcription. Delete the argument.SlngHttpTTSService. Use the streamingSlngTTSService.
language="en" by default. Pass language=Language.EN if
you relied on that default on a multilingual model.
Bring your own key (BYOK)
Passprovider_key to bill an upstream provider directly on your own contract;
both 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.