Streaming Speech-to-Text API Documentation

Convert live audio streams into text with low latency using streaming speech-to-text APIs, transcription workflows, and SDKs.

WebSocket Connection

wss://api.voxentis.com/v1/stt/stream?model=nova-2&language=en-US

Query Parameters

NameTypeRequiredDescription
modelstringSTT model: "nova-2", "whisper-large", "google-latest" (default: nova-2)
languagestring✓Language code (e.g. "en-US", "es-ES")
interim_resultsbooleanReturn partial transcripts (default: true)
smart_formatbooleanAuto-punctuation and formatting (default: true)
vad_eventsbooleanEmit voice-activity-detection events (default: false)
encodingstring"linear16", "mulaw", "opus" (default: linear16)
sample_rateintegerAudio sample rate in Hz (default: 16000)

Python — Stream from Microphone

import asyncio
import websockets
import pyaudio

async def stream_audio():
    uri = "wss://api.voxentis.com/v1/stt/stream?language=en-US"
    headers = {"Authorization": "Bearer YOUR_API_KEY"}

    async with websockets.connect(uri, extra_headers=headers) as ws:
        async def receive():
            async for message in ws:
                data = json.loads(message)
                if data["type"] == "transcript.final":
                    print(f"Final: {data['text']}")
                elif data["type"] == "transcript.interim":
                    print(f"Interim: {data['text']}", end="\r")

        receiver = asyncio.create_task(receive())

        audio = pyaudio.PyAudio()
        stream = audio.open(rate=16000, channels=1,
                           format=pyaudio.paInt16, input=True,
                           frames_per_buffer=4000)

        try:
            while True:
                data = stream.read(4000, exception_on_overflow=False)
                await ws.send(data)
                await asyncio.sleep(0.01)
        finally:
            stream.stop_stream()
            await ws.send(json.dumps({"type": "close"}))

asyncio.run(stream_audio())

Interim Transcript Event

{
  "type": "transcript.interim",
  "text": "I would like to",
  "start_sec": 1.2,
  "confidence": 0.85,
  "words": [
    { "word": "I", "start": 1.2, "end": 1.3 },
    { "word": "would", "start": 1.3, "end": 1.5 },
    { "word": "like", "start": 1.5, "end": 1.7 },
    { "word": "to", "start": 1.7, "end": 1.8 }
  ]
}

Final Transcript Event

{
  "type": "transcript.final",
  "text": "I would like to check my order status.",
  "start_sec": 1.2,
  "end_sec": 3.4,
  "confidence": 0.97,
  "words": [...]
}

Send {"type": "close"} when you're done streaming to flush the final transcript and close the connection cleanly.