Skip to navigation

Speech-to-Text APIs

View as Markdown

Sarvam’s speech-to-text APIs run on Saaras, which returns your audio as a transcript, an English translation, verbatim text, romanized text, or code-mixed text.

Use the Sarvam speech-to-text skill to generate correct STT code from your AI coding assistant:

npx skills add sarvamai/skills --skill speech-to-text

See Agent Skills for the full list.

Choosing the right mode

GoalEndpointmode
Transcribe in the spoken language/speech-to-texttranscribe
Translate speech to English/speech-to-texttranslate
Word-for-word (with fillers)/speech-to-textverbatim
Romanized (Latin-script) output/speech-to-texttranslit
Code-mixed output/speech-to-textcodemix

The mode parameter is supported by saaras:v4 (default, recommended) and saaras:v3 (legacy) on the /speech-to-text endpoint.

API Types

Already integrated against the legacy WebSocket? Set model to saaras:v4. The endpoint is documented under Streaming API (Legacy).

Not sure which one fits your audio length and latency needs? See Which Speech-to-Text API to Use for a side-by-side comparison of REST, WebSocket, and Batch.

Supported Audio Formats & MIME Types

The REST and Batch APIs support over 10 major audio formats and MIME type variants. Supported formats and MIME types are listed below:

Format GroupSupported MIME Types
MP3 Variantsmpeg, mp3, mpeg3, x-mpeg-3, x-mp3
WAV Variantswav, x-wav, wave
AAC Variantsaac, x-aac
AIFF Variantsaiff, x-aiff
OGG / Opus Formatsogg, opus
FLAC Variants (Lossless)flac, x-flac
MP4 / M4A Audiomp4, x-m4a
AMR (Narrowband)amr
WMA (Windows Media Audio)x-ms-wma
WEBM (Audio & Video)webm, webm
PCM Formatspcm_s16le, pcm_l16, pcm_raw

For most audio formats, our API automatically detects the codec. However, when using PCM formats (pcm_s16le, pcm_l16, pcm_raw), you must explicitly specify the input_audio_codec parameter. PCM files are only supported at 16kHz sample rate.

WebSocket/Streaming APIs: The legacy WebSocket streaming API only supports WAV and raw PCM formats (wav, pcm_s16le, pcm_l16, pcm_raw). Realtime Streaming accepts raw PCM only (linear16, linear32, mulaw, alaw). Other formats are not supported for streaming.


Technical Capabilities

Language Support
  • 22 Indic languages + Global and Indian English (Saaras v4)
  • Automatic language detection
  • Code-mixing support
  • Multi-speaker handling
Advanced Processing
  • Speaker diarization (Batch API)
  • Timestamp generation
  • Entity preservation
  • Telephony optimization

Limits

LimitValue
Real-time REST: max audio duration30 seconds per request
Batch API: max file duration2 hours per file
Batch API: max files per job20
Batch API: diarizationUp to 20 speakers (num_speakers)
Legacy WebSocket: formatsWAV and raw PCM only (wav, pcm_s16le, pcm_l16, pcm_raw)
Realtime Streaming: formatsRaw PCM only (linear16, linear32, mulaw, alaw)
Legacy WebSocket: sample rate16000 Hz (default) or 8000 Hz
Concurrency / rate limitsPer plan. See Rate Limits

Before uploading audio, run through the Preparing Your Audio checklist, sample rate, channels, format, and duration limits, to avoid the most common 400 errors.

Next Steps

1

Choose Your API

Select the appropriate API type based on your use case.

2

Get API Key

Sign up and get your API key from the dashboard.

3

Go Live

Deploy your integration and monitor usage in the dashboard.

Need help choosing the right API? Contact us on discord for guidance.