
Speech-to-Text and TTS for Indian Languages: API Guide
Whisper and OpenAI TTS handle English well but struggle with Indian accents and languages. Here's how to use Sarvam AI's Indic speech models through the same API, with real costs.
Author
AICredits Team
Published
4 Aug 2026
Reading time
6 min read
Why general-purpose speech models fall short for Indian languages
Whisper transcribes English (and other major world languages) well, but accuracy drops noticeably on Indian-accented English and falls further on native Indic languages. If your product needs Hindi, Tamil, Telugu, or Bengali voice input — or natural-sounding Indic-language speech output — a model built for those languages performs meaningfully better than a general-purpose one stretched to cover them.
Sarvam AI is an India-first voice provider built specifically for Indian languages. Through AICredits, you call it with the same OpenAI-compatible audio endpoints you'd use for Whisper or OpenAI's TTS — same API shape, same INR wallet, no separate account.
Text-to-speech in Hindi
curl https://api.aicredits.in/v1/audio/speech \
-H "Authorization: Bearer sk-your-key" \
-H "Content-Type: application/json" \
-d '{
"model": "sarvam/bulbul-v2",
"input": "नमस्ते, आप कैसे हैं?",
"voice": "anushka"
}' \
--output speech.wavSarvam's TTS voices are called speakers and use Indian names — anushka, rahul, priya, karun, and more (44 speakers across 12 languages in total). If you already have code using OpenAI's voice field (alloy, nova, shimmer), AICredits maps each one to a Sarvam speaker automatically, so a codebase built for OpenAI TTS can point at sarvam/bulbul-v2 with no other changes.
Speech-to-text for Indian languages
import base64
from openai import OpenAI
client = OpenAI(base_url="https://api.aicredits.in/v1", api_key="sk-your-key")
with open("customer_call.wav", "rb") as f:
audio_b64 = base64.b64encode(f.read()).decode()
response = client.audio.transcriptions.create(
model="sarvam/saarika-v2",
file=("customer_call.wav", open("customer_call.wav", "rb"), "audio/wav"),
language="hi-IN", # or ta-IN, te-IN, bn-IN, mr-IN, gu-IN, kn-IN, ml-IN, pa-IN
)
print(response.text)sarvam/saarika-v2 is tuned for Indian accents and code-mixed speech (Hindi-English switching mid-sentence, common in real customer calls) — a pattern that trips up general-purpose transcription models trained mostly on monolingual data.
Supported languages
| Code | Language | Code | Language |
|------|---------|------|---------|
| hi-IN | Hindi | ta-IN | Tamil |
| en-IN | English (India) | te-IN | Telugu |
| bn-IN | Bengali | mr-IN | Marathi |
| gu-IN | Gujarati | pa-IN | Punjabi |
| kn-IN | Kannada | ml-IN | Malayalam |
When to use Sarvam vs. Whisper/OpenAI TTS
| Use case | Better choice |
|----------|----------------|
| English-only voice UI | openai/whisper-1, openai/tts-1 |
| Hindi, Tamil, Bengali, or other Indic-language voice UI | sarvam/saarika-v2, sarvam/bulbul-v2 |
| Code-mixed customer calls (Hindi-English) | sarvam/saarika-v2 |
| Multilingual product with English as primary | Either — test both against your actual audio samples |
Both routes run through the same AICredits key and INR wallet, so switching between them for A/B testing is a one-line model change, not a new integration.
Frequently Asked Questions
Do I need a separate Sarvam account?
No. AICredits routes sarvam/ model IDs directly to Sarvam's API — you only need your AICredits key.
Can I use Sarvam models for a WhatsApp voice-note bot?
Yes. Download the voice note via Meta's media API, then transcribe it with sarvam/saarika-v2 for Indian-language accuracy before passing the text to an LLM for a reply. See Build a WhatsApp AI Bot for Your Business for the full flow.
What does Sarvam cost compared to Whisper?
Sarvam pricing is INR-native and billed per request or per second of audio depending on the model; Whisper is billed per minute in USD-converted rupees (~₹0.55/minute). Check aicredits.in/models for the current per-model rate, since both are usage-based and can vary by request size.
Can I mix Sarvam TTS with an OpenAI or Claude model for the text generation step?
Yes — generate the reply text with any chat model, then pass that text to sarvam/bulbul-v2 for speech output. All three calls (LLM, TTS, STT) draw from the same wallet.
Get started
- Read the audio API docs for the full parameter reference and voice mapping table.
- Create a free account and test Sarvam's Hindi TTS with your own text.
- Related: Build a WhatsApp AI Bot for Your Business.
Related Articles
Continue in Docs
Need implementation commands and endpoint details? Go to quickstart or API reference.