API Documentation
Complete reference for the Chozha Voice STT and TTS APIs.
Getting Started
The Chozha Voice API provides production-ready Speech-to-Text (STT) and Text-to-Speech (TTS) endpoints supporting 22+ Indian languages plus English.
Base URL
https://voice.chozha.io
- Create an account (free tier included)
- Generate an API key from your Dashboard
- Include the key in the
X-API-Keyheader
Authentication
All API requests require an API key in the X-API-Key header.
X-API-Key: cv_your_api_key_here
API keys can be generated and managed from your Dashboard. Each account can have up to 5 active keys.
Speech-to-Text (STT)
/api/v1/stt/transcribe
Transcribe an audio file to text. Supports WAV, MP3, FLAC, OGG formats.
Request
Content-Type: multipart/form-data
| Parameter | Type | Required | Description |
|---|---|---|---|
file | file | Yes | Audio file (WAV, MP3, FLAC, OGG) |
language | string | No | Language code (default: ta). See supported languages |
Response
{
"text": "transcribed text here"
}
Examples
curl -X POST https://voice.chozha.io/api/v1/stt/transcribe \
-H "X-API-Key: cv_your_key" \
-F "file=@audio.wav" \
-F "language=ta"
import requests
resp = requests.post(
"https://voice.chozha.io/api/v1/stt/transcribe",
headers={"X-API-Key": "cv_your_key"},
files={"file": open("audio.wav", "rb")},
data={"language": "ta"},
)
print(resp.json()["text"])
const form = new FormData();
form.append("file", audioBlob, "audio.wav");
form.append("language", "ta");
const resp = await fetch("https://voice.chozha.io/api/v1/stt/transcribe", {
method: "POST",
headers: { "X-API-Key": "cv_your_key" },
body: form,
});
const { text } = await resp.json();
Text-to-Speech (TTS)
/api/v1/tts/synthesize
Convert text to speech. Returns a WAV audio file.
Request
Content-Type: application/json
| Field | Type | Required | Description |
|---|---|---|---|
text | string | Yes | Text to synthesize (max 5000 chars) |
language | string | No | Language code (default: ta). See supported languages |
Response
Returns audio/wav binary content (16-bit PCM, 16kHz).
Examples
curl -X POST https://voice.chozha.io/api/v1/tts/synthesize \
-H "X-API-Key: cv_your_key" \
-H "Content-Type: application/json" \
-d '{"text": "வணக்கம் உலகம்", "language": "ta"}' \
--output speech.wav
import requests
resp = requests.post(
"https://voice.chozha.io/api/v1/tts/synthesize",
headers={
"X-API-Key": "cv_your_key",
"Content-Type": "application/json",
},
json={"text": "வணக்கம் உலகம்", "language": "ta"},
)
with open("speech.wav", "wb") as f:
f.write(resp.content)
const resp = await fetch("https://voice.chozha.io/api/v1/tts/synthesize", {
method: "POST",
headers: {
"X-API-Key": "cv_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({ text: "வணக்கம் உலகம்", language: "ta" }),
});
const audioBlob = await resp.blob();
const audio = new Audio(URL.createObjectURL(audioBlob));
audio.play();
Supported Languages
STT Languages (23)
Indian languages use AI4Bharat IndicConformer. English uses faster-whisper.
| Language | Code | Engine |
|---|---|---|
| Tamil | ta | IndicConformer |
| Hindi | hi | IndicConformer |
| Telugu | te | IndicConformer |
| Malayalam | ml | IndicConformer |
| Kannada | kn | IndicConformer |
| Bengali | bn | IndicConformer |
| Gujarati | gu | IndicConformer |
| Marathi | mr | IndicConformer |
| Punjabi | pa | IndicConformer |
| English | en | faster-whisper |
| Assamese | as | IndicConformer |
| Bodo | brx | IndicConformer |
| Dogri | doi | IndicConformer |
| Konkani | gom | IndicConformer |
| Kashmiri | ks | IndicConformer |
| Maithili | mai | IndicConformer |
| Manipuri | mni | IndicConformer |
| Nepali | ne | IndicConformer |
| Odia | or | IndicConformer |
| Sanskrit | sa | IndicConformer |
| Santali | sat | IndicConformer |
| Sindhi | sd | IndicConformer |
| Urdu | ur | IndicConformer |
TTS Languages (10)
Error Codes
| Code | Meaning | Description |
|---|---|---|
400 | Bad Request | Invalid audio format, unsupported language, or malformed request |
401 | Unauthorized | Missing or invalid API key |
403 | Forbidden | Account suspended or insufficient permissions |
429 | Too Many Requests | Monthly usage limit or rate limit exceeded |
500 | Server Error | Internal processing error |
502 | Bad Gateway | STT/TTS service unavailable |
{
"detail": "Monthly STT limit reached (50). Upgrade your plan."
}
Rate Limits
Rate limits depend on your plan tier. Usage resets monthly on the 1st.
| Plan | STT/month | TTS/month | Req/min |
|---|---|---|---|
| Free | 50 | 50 | 5 |
| Starter | 1,000 | 1,000 | 20 |
| Pro | 10,000 | 10,000 | 60 |
| Enterprise | Unlimited | Unlimited | 200 |
When a limit is exceeded, the API returns 429 Too Many Requests. Upgrade your plan from the Dashboard for higher limits.