Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
SarvamAISTT
Streaming speech-to-text with Sarvam AI’s Saaras models, using your Sarvam key. Strong on Indian languages and code-mixed speech, with optional translation to English. Authenticates with SARVAMAI_API_KEY from your environment, or an explicitapi_key.
Fields
Language of the speech as a BCP-47 code, e.g. “en-IN” or “hi-IN”. Defaults to ‘en-IN’.
Sample rate of incoming audio in Hz. Leave unset to detect it automatically. Defaults to None (not set).
Sample rate sent to Sarvam, 8000 or 16000 Hz. Leave unset to keep 8 kHz phone audio at 8 kHz and send everything else at 16 kHz. Defaults to None (not set).
Output style: “transcribe”, “translate” (to English), “verbatim”, “translit” (romanized) or “codemix”. saaras:v3 and newer only. Defaults to None (not set).
Use more sensitive speech detection, which picks up quieter or shorter utterances. Defaults to None (not set).
Allow the transcript to be finalized immediately when the turn ends instead of waiting for Sarvam to detect a pause. Defaults to None (not set).
Translate speech into English text instead of transcribing it in the spoken language. Defaults to False.