Latest in AI
Sarvam Saaras v4: How to Get Word Timestamps for Hinglish Captions
Choose the script, handle untimed words, and turn REST or Batch output into captions without confusing the old segment API.
Set model="saaras:v4" and timestamp_granularity="word" to get word timing from Sarvam's speech-to-text API. The November 26 release adds a top-level words list on REST and Batch. Each entry contains the text and its start and end in seconds. Sarvam returns the timing; your editor or app still decides when to break a subtitle line and which word to highlight.
Choose the script before building the captions
Saaras has two useful modes for Hindi mixed with English. According to its mode guide, codemix keeps Indic words in their native script and English words in English. That suits a caption such as “आज product demo है.” Use translit if the audience should read “aaj product demo hai” in Latin script. Treat those lines as illustrations, not measured model output.
Use the text returned inside each timed word. If you separately transliterate or rewrite the transcript, the new words and punctuation might no longer line up with the original entries. transcribe and verbatim also support word timing, but translate doesn't. If the goal is English subtitles for a Hindi clip, use a separate translation and alignment step rather than asking the word-timing route for both.
Send a test clip through the right API
Start with a short audio clip that contains one language switch, one proper name and a pause. The REST reference documents the multipart fields: submit the file with model saaras:v4, your chosen mode, a language such as hi-IN when known, and timestamp_granularity=word. Keep the subscription key on your backend. Use REST for up to 30 seconds; use Batch for longer recordings and set the granularity in the job parameters. Batch timings are relative to the start of each input file.
If the SDK doesn't recognize the parameter, check the version. Sarvam lists support from Python sarvamai 0.1.50 and JavaScript sarvamai 1.1.23. If the request succeeds but words is absent, confirm the submitted granularity and inspect the response rather than trusting a generic SDK snippet.
Don't read the old field as individual words
The timestamp guide distinguishes words from timestamps.words. The latter holds old segment text, even though its name says “words.” To keep the segment granularity while changing the response shape, request timestamp_granularity=segment and read segments. During migration you can request both formats by also passing with_timestamps=true. Update old readers deliberately rather than switching their unit from a chunk to a word without telling them.
Check what the viewer will actually see
Keep untimed text in the caption even if you skip highlighting it. Sarvam can return a word with both times set to null. Treating that as zero makes the renderer flash the word at the start of the clip. Group adjacent words into readable lines, check them at phone size, and replay the language switch and the first and last cues at normal speed.
I'd start with one reviewed clip before turning on automatic exports. A transcript can be correct and still be unpleasant to read if it wraps awkwardly or lights up the wrong syllable.
I'm Paras. I work with teams building AI tools.
I help translate API details into practical guides for the developers who have to ship them.