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
  1. Create an account (free tier included)
  2. Generate an API key from your Dashboard
  3. Include the key in the X-API-Key header

Authentication

All API requests require an API key in the X-API-Key header.

Request 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)

POST /api/v1/stt/transcribe

Transcribe an audio file to text. Supports WAV, MP3, FLAC, OGG formats.

Request

Content-Type: multipart/form-data

ParameterTypeRequiredDescription
filefileYesAudio file (WAV, MP3, FLAC, OGG)
languagestringNoLanguage code (default: ta). See supported languages

Response

JSON Response
{
  "text": "transcribed text here"
}

Examples

curl
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"
Python
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"])
JavaScript (fetch)
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)

POST /api/v1/tts/synthesize

Convert text to speech. Returns a WAV audio file.

Request

Content-Type: application/json

FieldTypeRequiredDescription
textstringYesText to synthesize (max 5000 chars)
languagestringNoLanguage code (default: ta). See supported languages

Response

Returns audio/wav binary content (16-bit PCM, 16kHz).

Examples

curl
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
Python
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)
JavaScript (fetch)
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.

LanguageCodeEngine
TamiltaIndicConformer
HindihiIndicConformer
TeluguteIndicConformer
MalayalammlIndicConformer
KannadaknIndicConformer
BengalibnIndicConformer
GujaratiguIndicConformer
MarathimrIndicConformer
PunjabipaIndicConformer
Englishenfaster-whisper
AssameseasIndicConformer
BodobrxIndicConformer
DogridoiIndicConformer
KonkanigomIndicConformer
KashmiriksIndicConformer
MaithilimaiIndicConformer
ManipurimniIndicConformer
NepalineIndicConformer
OdiaorIndicConformer
SanskritsaIndicConformer
SantalisatIndicConformer
SindhisdIndicConformer
UrduurIndicConformer

TTS Languages (10)

Tamil (ta) Hindi (hi) Telugu (te) Malayalam (ml) Kannada (kn) Bengali (bn) Gujarati (gu) Marathi (mr) Punjabi (pa) English (en)

Error Codes

CodeMeaningDescription
400Bad RequestInvalid audio format, unsupported language, or malformed request
401UnauthorizedMissing or invalid API key
403ForbiddenAccount suspended or insufficient permissions
429Too Many RequestsMonthly usage limit or rate limit exceeded
500Server ErrorInternal processing error
502Bad GatewaySTT/TTS service unavailable
Error Response Format
{
  "detail": "Monthly STT limit reached (50). Upgrade your plan."
}

Rate Limits

Rate limits depend on your plan tier. Usage resets monthly on the 1st.

PlanSTT/monthTTS/monthReq/min
Free50505
Starter1,0001,00020
Pro10,00010,00060
EnterpriseUnlimitedUnlimited200

When a limit is exceeded, the API returns 429 Too Many Requests. Upgrade your plan from the Dashboard for higher limits.