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
str
default:"UNSET"
Sarvam speech model, e.g. “saaras:v3” or “saaras:v2.5”. Defaults to ‘saaras:v3’.
str
default:"UNSET"
Language of the speech as a BCP-47 code, e.g. “en-IN” or “hi-IN”. Defaults to ‘en-IN’.
int | None
default:"UNSET"
Sample rate of incoming audio in Hz. Leave unset to detect it automatically. Defaults to None (not set).
int | None
default:"UNSET"
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).
Literal['transcribe', 'translate', 'verbatim', 'translit', 'codemix'] | None
default:"UNSET"
Output style: “transcribe”, “translate” (to English), “verbatim”, “translit” (romanized) or “codemix”. saaras:v3 and newer only. Defaults to None (not set).
bool | None
default:"UNSET"
Use more sensitive speech detection, which picks up quieter or shorter utterances. Defaults to None (not set).
bool | None
default:"UNSET"
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).
bool
default:"UNSET"
Translate speech into English text instead of transcribing it in the spoken language. Defaults to False.
str | None
default:"UNSET"
Context hint that guides the translation, e.g. domain terms. Only used when translation is on. Defaults to None (not set).