Which Speech-to-Text API to Use
Which Speech-to-Text API to Use
Sarvam gives you four ways to run speech recognition on its models: the REST, Realtime, Batch, and legacy WebSocket APIs. They differ in how you send audio, how fast you get results, the maximum audio they accept, and which features (diarization, timestamps, partial transcripts) are available. Use this page to pick one before you start integrating.
Every transport also supports translating to English via mode="translate" on Saaras v3 (see the Tip below). A separate legacy Speech-to-Text-Translate counterpart exists on saaras:v2.5 — the transport trade-offs below are identical, only the output language and underlying model change. See Speech-to-Text-Translate.
Quick decision
A short clip (≤30s) and you want the transcript back in one call.
Live microphone or call audio for a voice agent — need partial transcripts as the user speaks, and mid-call reconfiguration.
Long recordings (up to 2 hours), with diarization and timestamps.
Existing saaras:v3 WebSocket integrations — still generally available, but superseded by Realtime for new work.
Comparison
When to use each
REST — POST /speech-to-text
- The audio is already captured and short (≤30 seconds).
- You want one request, one response — no connection to manage.
- Examples: voice search, push-to-talk commands, transcribing a short voice note.
- REST API guide →
Realtime — GET /speech-to-text-realtime/ws
- Audio arrives continuously from a mic, browser, or telephony stream, for a voice agent or live captioning product.
- You need true interim transcripts as the user speaks (fast barge-in), millisecond-based VAD tuning, and the ability to change language, mode, or VAD settings mid-call without reconnecting.
- Note: raw PCM only, no diarization.
- Realtime Streaming guide →
Batch — POST /speech-to-text/job/v1
- Recordings are long (up to 2 hours) or you have many files (up to 20 per job).
- You need speaker diarization and chunk-level timestamps (e.g. subtitles, meeting minutes).
- Latency isn’t critical — you submit a job and download results when it finishes.
- Batch API guide →
WebSocket (Legacy) — GET /speech-to-text/ws
- You have an existing integration on the
saaras:v3WebSocket — it remains generally available. - For new voice-agent or live-transcription work, prefer Realtime Streaming above: it adds partial transcripts, simpler VAD tuning, and live reconfiguration.
- Note: only WAV / raw PCM is accepted, and results are final per utterance — there are no interim partials. See finalization semantics.
- Streaming API (Legacy) guide →
Need English output regardless of the spoken language? Use the same transport on the regular Speech-to-Text endpoints with mode="translate" on Saaras v3 (transcribe()/connect() for REST/streaming, or the final-transcript mode on Realtime). The dedicated Speech-to-Text-Translate endpoints are legacy (saaras:v2.5) and don’t support mode.