Real-time Speech-To-Text for developers
Integrates with
What is router.audio?
Every provider has their own SDKs, response formats and audio format limitations. This is even worse with streaming websockets, where events and messages are significantly different in their nature. router.audio provides a single endpoint that proxies to multiple STT providers, built on top of their WebSockets directly to ensure reliability and scalability.
Deploy with different providers to different languages without changing your code
Global Anycast infrastructure with near-zero routing latency
Support for multiple input encodings with automatic transcoding
import asyncio
import websockets
import json
import sounddevice as sd
from urllib.parse import urlencode
async def transcribe():
params = {
"provider": "deepgram",
"encoding": "pcm_s16le",
"sample_rate": "16000",
}
async with websockets.connect(
f"wss://api.router.audio/v1/listen?{urlencode(params)}",
additional_headers={"x-api-key": "<Your API key>"}
) as ws:
loop = asyncio.get_event_loop()
mic = sd.RawInputStream(samplerate=16000, channels=1, dtype="int16")
mic.start()
async def send_audio():
while True:
data, _ = await loop.run_in_executor(None, mic.read, 4000)
await ws.send(bytes(data))
async def recv_text():
async for msg in ws:
data = json.loads(msg)
if data.get("type") == "transcript":
print(data["transcript"])
await asyncio.gather(send_audio(), recv_text())
asyncio.run(transcribe())Get started in minutes
Get API keys from your API providers, open a WebSocket, and start streaming audio to any provider with a single endpoint. No SDKs, no per-provider integrations.
Tool
Language Checker
Search for any language and see which APIs and models support it.
Try the language checker →Join our small community
Have questions, feedback or hate mail? Come hang out on the Discord.
Join Discord