Which Speech-to-Text API to Use

View as Markdown

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

Comparison

RESTRealtimeBatchWebSocket (Legacy)
EndpointPOST /speech-to-textGET /speech-to-text-realtime/wsPOST /speech-to-text/job/v1 (job flow)GET /speech-to-text/ws
Modelsaaras:v3saaras:v3-realtimesaaras:v3saaras:v3
ProcessingSynchronousReal-time streamingAsynchronous (job)Real-time streaming
Max audio length30 secondsContinuous (chunked)2 hours per fileContinuous (chunked)
Files per request11 streamUp to 20 per job1 stream
Interim / partial resultsN/AYes — transcript.partial throughout the utteranceN/ANo — final per utterance only
ResultsFinal transcript in the responseFinal transcript per utterance (VAD or manual turn end)Final transcript, downloaded when the job completesFinal transcript per utterance (on VAD end-of-speech or flush())
LatencyOne round-trip after uploadLowest — partials arrive while audio is still streamingHighest — minutes, depending on queue and durationLow — but only a final per utterance
Mid-call reconfigurationN/AYes — config.update, no reconnectN/ANo — reconnect required
VAD tuningN/A3 millisecond-valued parametersN/A10+ frame-count parameters
Speaker diarizationNoNoYesNo
TimestampsYes (chunk-level, via with_timestamps)Optional segment-level (return_timestamps)Yes (chunk-level)No
Audio formatsAll supported formats (auto-detected; PCM at 16 kHz)Raw PCM only (linear16, linear32, mulaw, alaw)All supported formatsWAV and raw PCM only (wav, pcm_s16le, pcm_l16, pcm_raw)
Output modestranscribe, translate, verbatim, translit, codemixSame 5 modes (final transcript only; partials are always plain transcription)Same 5 modesSame 5 modes
Best forShort clips, voice commands, quick testsVoice agents, live captions with barge-in, call streamingMeetings, interviews, call-center recordings, bulk pipelinesExisting saaras:v3 WebSocket integrations

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:v3 WebSocket — 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.