Skip to main content
All your speech traffic routes through one platform. The quickest way to see it work is to send a text-to-speech and a speech-to-text request directly. Once you have, you can point your existing stack at the gateway and keep the rest of your code.

Prerequisites

  • An SLNG account
  • A SLNG key (get one at app.slng.ai)
  • Basic knowledge of REST APIs or WebSockets

Authentication

Every request needs an SLNG key in the Authorization: Bearer SLNG_API_KEY header. Get one from the Dashboard, and replace SLNG_API_KEY in the examples below with your key. For WebSocket auth, key rotation, and bringing your own provider key, see Authentication & API Keys.

Your First Request

1

Text-to-Speech (HTTP)

A Text-to-Speech (TTS) request over HTTP turns text into an audio file:
curl https://api.slng.ai/v1/tts/slng/deepgram/aura:2-en \
  -H "Authorization: Bearer SLNG_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "aura-2-thalia-en",
    "text": "Hello from sunny Barcelona!"
  }' \
  --output hello.wav
Replace SLNG_API_KEY with your SLNG key and run the command. Once the request completes, you have a hello.wav file in the current directory.It sounds like this:
2

Speech-to-Text (HTTP)

Next, transcribe an audio file. The response is text you can process downstream.Download this sample file:Then run:
curl https://api.slng.ai/v1/stt/slng/deepgram/nova:3-en \
  -H "Authorization: Bearer SLNG_API_KEY" \
  -F "audio=@micro-machines.wav" \
  -F "language=en"
Response:
{
  "text": "is the micro machine man presenting the most midget miniature motorcade of micro machine...",
  "transcript": "is the micro machine man presenting the most midget miniature motorcade of micro machine...",
  "confidence": 0.9749991,
  "duration": 29.888374,
  "language": "en",
  "metadata": {
      "request_id": "f5778fa4-40f9-4d60-993b-2f43f0164221",
      "model": "nova-3",
      "duration": 29.888374,
      "channels": 1
  }
}
The same endpoint accepts a remote URL instead of an upload:
curl https://api.slng.ai/v1/stt/slng/deepgram/nova:3-multi \
  -H "Authorization: Bearer SLNG_API_KEY" \
  -H 'Content-Type: application/json' \
  --data '{"url":"https://docs.slng.ai/audio/micro-machines.wav", "language":"en"}'
The response is identical to the upload version.

Go Further

Point your stack at SLNG

Route your existing voice agent through the gateway and keep your code.

Use a framework plugin

Native integrations for LiveKit, Cognigy, and Jambonz.

Explore the execution layer

How SLNG routes and optimizes every turn between your app and the models.

Build a voice agent

Combine streaming STT, low-latency TTS, and tool-calling to greet, route, and escalate calls.

HTTP vs. WebSocket

Understand when to use each protocol and their trade-offs.

Browse models

Explore all available TTS and STT models and find the right one for your use case.