One endpoint pattern for every STT and TTS model. Swap providers by changing the URL.
One endpoint pattern for every STT and TTS model on the platform. Switch providers by changing the URL path. Your code, auth, and request format don’t change.
This saves a WAV file. You can set encoding and sample rate through the config object.Switch to Deepgram Aura 2, just change it in the URL, pass it as a parameter and adapt the voice.
The same model paths work over WebSocket for real-time streaming. Connect to wss:// instead of posting to https://.
The browser WebSocket API does not support custom headers. Pass the API key as a query parameter or use a server-side WebSocket client. The example below uses the Node.js ws library.
import WebSocket from "ws";const ws = new WebSocket( "wss://api.slng.ai/v1/bridges/unmute/tts/slng/deepgram/aura:2-en", { headers: { Authorization: "Bearer YOUR_API_KEY" } });ws.on("open", () => { ws.send(JSON.stringify({ model: "slng/deepgram/aura:2-en", voice: "asteria-en", text: "Streaming audio in real time." }));});ws.on("message", (data) => { // Binary frames contain audio chunks if (Buffer.isBuffer(data)) { process.stdout.write(data); }});