FonadaLabs
Login / Sign Up

Kapture 3.1

Speech to Text (ASR) for Indian languages. Send an audio file to POST /v1/speech-to-text with model=kapture_v3_1 and get the transcript back. Kapture 3.1 supports 11 languages plus automatic language detection, and a code-mix mode that keeps English words in Latin script.

Quick start

  1. 1

    Get an API key

    Create a key in the Console and replace YOUR_API_KEY in the examples below.

  2. 2

    Install the SDK

    pip install -U "fonadalabs>=4.0"
  3. 3

    Make your first request

    Transcribe an audio file. Replace audio.wav with your file; send language=auto to detect the language.

    from fonadalabs import ASRClient
    
    client = ASRClient(api_key="YOUR_API_KEY")
    result = client.transcribe_file("audio.wav", model="kapture_v3_1", language_id="hi", mode="native")
    print(result.text)

Overview

  • One request per file, any length: long audio is split and transcribed in parallel on our side.
  • language=auto detects which of the 11 languages is spoken and tells you how sure it is.
  • mode=codemix returns English words inside Hindi, Tamil or Telugu speech in Latin script.
  • hotwords helps Kapture get names, brands and terms right.
  • Same price as Kapture V3. Auto-detect and code-mix cost nothing extra.

Request

POST https://api.fonada.ai/v1/speech-to-text with multipart/form-data and an Authorization: Bearer <API key> header.

curl
curl -X POST "https://api.fonada.ai/v1/speech-to-text" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "model=kapture_v3_1" \ -F "file=@audio.wav" \ -F "language=hi" \ -F "mode=native"
FieldRequiredValuesDefault
fileYesAudio file: WAV, MP3, M4A, FLAC, OGG and so on. Any length.—
modelYeskapture_v3_1 is the only value. Missing or empty: 400 missing_model; any other value: 400 invalid_model.—
languageYesauto, a code (hi), a name (Hindi) or a tag (hi-IN). Not case-sensitive. Missing or empty: 400 missing_language. Called language_id on /v3/asr/transcribe. See Supported Languages.—
modeYesnative or codemix. Missing or empty: 400 missing_mode. See Code-mix mode.—
hotwordsNoA JSON list (["गर्वित शर्मा","यसमैडम"]) or comma-separated text, up to 500. Write them in the transcript's script. See Hot words.—
hotword_boostNo0 to 20. Only with hotwords. Keep it near 3; high values distort the transcript.3
fallback_languageNoA supported language. Only with language=auto: used when detection isn't confident.—

Optional header X-Job-Id (a UUID): the job is tracked under that id.

Automatic language detection

Send language=auto and Kapture works out which of the 11 languages is spoken. The response says which language it found and how sure it is:

  • language: the detected language code, e.g. hi.
  • language_source: detected with auto, requested when you sent a language, or fallback when detection wasn't confident and your fallback_language was used.
  • language_confidence: 0 to 1, e.g. 0.997. It is null when you sent a language yourself.
  • Long audio: each part is detected on its own, so every entry in transcript_chunks has its own language and language_confidence. The top-level language is the one spoken in most of the audio.
For mostly English audio, send language=en instead of auto: auto-detect is weakest on strongly accented Indian English.

Add fallback_language (for example hi) to say which language to use when detection isn't confident. It works only with language=auto; with any other language the request is refused with 400 fallback_language_requires_auto.

curl: auto-detect with code-mix and a fallback
curl -X POST "https://api.fonada.ai/v1/speech-to-text" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "model=kapture_v3_1" \ -F "file=@call.wav" \ -F "language=auto" \ -F "mode=codemix" \ -F "fallback_language=hi"

Code-mix mode

modeWhat you getExample
native (default)Every word in the language's own script, exactly like Kapture V3.घरेलू टूर पैकेज हैं … प्लान
codemixEnglish words inside Hindi, Tamil or Telugu speech come back in Latin script.घरेलू tour package हैं … plan
  • Code-mix works with hi, ta, te and auto.
  • With any other language, e.g. bn or en, the request is refused with 400 codemix_not_supported and nothing is charged.
  • The response echoes mode, so you can show which one ran.

Hot words

Send names, brands or terms that matter in your audio in hotwords, and Kapture favours them when they are spoken.

  • A JSON list (["गर्वित शर्मा","यसमैडम","आगाह"]) or comma-separated text. Up to 500.
  • Write each hot word in the script it should appear in. With mode=native the transcript is in the language's own script, so Latin hot words like Garvit Sharma never match; write them as गर्वित शर्मा. With mode=codemix, English names can stay in Latin script.
  • Hot words only help with words that are spoken. They never add words that aren't in the audio.
  • hotword_boost: 0 to 20, default 3. Keep it near 3; high values distort the transcript. Sending it without hotwords returns 400 hotword_boost_without_hotwords.
  • The response field hotwords_count says how many hot words were used.
curl: hot words, native mode
# Native mode: hot words in the same script as the output curl -X POST "https://api.fonada.ai/v1/speech-to-text" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "model=kapture_v3_1" \ -F "file=@call.wav" \ -F "language=hi" \ -F "mode=native" \ -F 'hotwords=["गर्वित शर्मा","यसमैडम","आगाह"]' \ -F "hotword_boost=3"
curl: hot words, code-mix mode
# Code-mix mode: English names can be in Latin script curl -X POST "https://api.fonada.ai/v1/speech-to-text" \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "model=kapture_v3_1" \ -F "file=@call.wav" \ -F "language=hi" \ -F "mode=codemix" \ -F 'hotwords=["Garvit Sharma","YesMadam","आगाह"]' \ -F "hotword_boost=3"

Response

JSON. Every Kapture V3 field is still there with the same name and meaning; new fields are marked.

FieldMeaning
textThe full transcript.
languageThe language used. With auto, the language that was detected (the one spoken in most of the audio).
language_sourceNewdetected (with auto), requested (when you sent a language) or fallback (auto was not confident, so fallback_language was used).
language_confidenceNew0 to 1 with auto, otherwise null.
modeNewnative or codemix: the mode that ran.
modelNewAlways kapture_v3_1.
hotwords_countNewNumber of hot words used. 0 when you sent none.
fallback_languageNewThe fallback_language you sent, otherwise null.
request_idNewUnique id of this request. Send it to support when reporting a problem.
job_idJob id (your X-Job-Id if you sent one).
audio_duration_sAudio length in seconds.
num_chunks, chunk_durations_s, chunk_textsHow long audio was split, and the text of each part.
transcript_chunksPer chunk: idx, text, duration_s, start_s, end_s, and now also language (plus language_confidence with auto).
processing_time_msServer processing time.
credits_usedCredits charged for this request.
Example: language=auto, mode=codemix
{ "request_id": "0b6f3c2e-5d1a-4f7b-9a3e-2c8d1e4f6a70", "job_id": "fa2c318b-bdde-4656-8d1b-9fb83b46653a", "model": "kapture_v3_1", "text": "Sir, नहीं, ऐसा कुछ होता तो मैं बताता, ऐसा कुछ नहीं है Sir.", "language": "hi", "language_source": "detected", "language_confidence": 1.0, "mode": "codemix", "hotwords_count": 0, "fallback_language": null, "audio_duration_s": 3.12, "num_chunks": 1, "chunk_durations_s": [3.12], "chunk_texts": ["Sir, नहीं, ऐसा कुछ होता तो मैं बताता, ऐसा कुछ नहीं है Sir."], "transcript_chunks": [ { "idx": 0, "text": "Sir, नहीं, ऐसा कुछ होता तो मैं बताता, ऐसा कुछ नहीं है Sir.", "duration_s": 3.12, "start_s": 0.0, "end_s": 3.12, "language": "hi", "language_confidence": 1.0 } ], "processing_time_ms": 62.0, "credits_used": 0.43 }

Response headers: X-Job-Id, X-Num-Chunks, X-Processing-Time-Ms, X-Credits-Used, X-Audio-Duration-Seconds, X-Model and X-Request-Id. Browser JavaScript cannot read these headers cross-origin, so read model, request_id, job_id and credits_used from the JSON body instead.

Errors

HTTP status plus {"detail": {"error": "...", "message": "..."}}. Nothing is charged for any 400 error. Required fields are checked in this order: API key (401), then model, then language, then mode. Authentication, insufficient credits, rate limit and concurrency errors are the same as Kapture V3.

StatuserrorWhen
400missing_modelmodel missing or empty (required). The response includes supported_models.
400invalid_modelmodel is not kapture_v3_1. The response includes supported_models.
400missing_languagelanguage missing or empty (required). Replaces missing_language_id.
400missing_modemode missing or empty (required). The response includes supported_modes: ["native", "codemix"].
400invalid_modemode is not native or codemix. The response includes supported_modes.
400codemix_not_supportedmode=codemix with a language other than hi, ta, te or auto. The response includes supported_languages.
400unsupported_languageUnknown language.
400invalid_hotwordshotwords is not a JSON list of strings or comma-separated text.
400too_many_hotwordsMore than 500 hot words.
400invalid_hotword_boosthotword_boost is not a number from 0 to 20.
400hotword_boost_without_hotwordshotword_boost sent without any hotwords.
400fallback_language_requires_autofallback_language sent with a language other than auto.
400invalid_fallback_languagefallback_language is not a supported language.
400empty_audio / invalid_audioThe file is empty or cannot be read.
401—Missing or invalid API key.
422—No file field. FastAPI shape: detail is a list of { loc, msg }.
429rate_limit_exceeded / concurrent_limit_exceededToo many requests. Same limits as Kapture V3, shared between both endpoints.
502upstream_unavailable and similarTranscription failed on our side. Credits are refunded automatically.
Example error body
{ "detail": { "error": "codemix_not_supported", "message": "mode=codemix supports hi, ta, te; got language 'bn'.", "supported_languages": ["hi", "ta", "te"] } }

Code examples

JavaScript (fetch, server-side)
async function transcribe(file, { language = "auto", mode = "native", hotwords = [] } = {}) { const form = new FormData() form.append("file", file) form.append("model", "kapture_v3_1") form.append("language", language) // "auto", "hi", "ta", ... form.append("mode", mode) // "native" or "codemix" if (hotwords.length) form.append("hotwords", JSON.stringify(hotwords)) // optional const res = await fetch("https://api.fonada.ai/v1/speech-to-text", { method: "POST", headers: { Authorization: `Bearer ${process.env.FONADA_API_KEY}` }, body: form, }) const body = await res.json() if (!res.ok) throw new Error(body.detail?.message || res.statusText) return body // body.text, body.language, body.language_confidence, body.mode } // Only offer code-mix where it is supported const CODEMIX_LANGS = ["auto", "hi", "ta", "te"] const codemixAllowed = (lang) => CODEMIX_LANGS.includes(lang)
Python (requests)
import requests with open("audio.wav", "rb") as f: res = requests.post( "https://api.fonada.ai/v1/speech-to-text", headers={"Authorization": "Bearer YOUR_API_KEY"}, files={"file": f}, data={"model": "kapture_v3_1", "language": "auto", "mode": "native"}, timeout=600, ) res.raise_for_status() body = res.json() print(body["language"], body["language_confidence"]) print(body["text"])

Python SDK

Always pass model="kapture_v3_1", language_id and mode: all three are required on every call.

install
pip install -U "fonadalabs>=4.0"

Upgrading from SDK 3.x

  • Run pip install -U "fonadalabs>=4.0".
  • Add model= to every call; it is required now.
  • klone_v2_flash → klone_v3_flash
  • v2 (Pro) → klone_v2_pro
  • ASR v3 → kapture_v3_1
  • last_stream_info.credits_charged → last_stream_info.credits_used
Python
from fonadalabs import ASRClient client = ASRClient(api_key="YOUR_API_KEY") try: result = client.transcribe_file( "audio.wav", model="kapture_v3_1", # required language_id="hi", # required mode="native", # required: native or codemix ) print(f"Language : {result.language_id}") print(f"Text : {result.text}") print(f"Duration : {result.audio_duration_s}s") print(f"Credits : {result.credits_used}") finally: client.close()
Python: auto-detect and code-mix
from fonadalabs import ASRClient client = ASRClient(api_key="YOUR_API_KEY") result = client.transcribe_file( "audio.wav", model="kapture_v3_1", # required language_id="auto", # required; auto detects the language mode="codemix", # required; codemix: English words in Latin script (hi, ta, te or auto) ) print(result.text) print(result.language_id, result.language_source, result.language_confidence, result.mode)

Supported Languages

11 languages, the same as Kapture V3, plus auto. Any other language returns 400 unsupported_language before credits are charged.

CodeLanguageCode-mix
autoDetect automaticallyYes
hiHindiYes
taTamilYes
teTeluguYes
bnBengaliNo
enEnglishNo
guGujaratiNo
knKannadaNo
mlMalayalamNo
mrMarathiNo
orOdiaNo
paPunjabiNo

Pricing

Priced per hour, billed per second of audio. Unchanged from Kapture V3.

ModelPriceCreditsBilling
Kapture 3.1₹6 per hour~500 creditsBilled per second

Auto-detect and code-mix cost nothing extra. See the full pricing page.

Previous version

POST /v3/asr/transcribe (Kapture V3) and its alias POST /v2/asr/transcribe still work unchanged, but new integrations should use POST /v1/speech-to-text.

  • Change the URL, add model=kapture_v3_1, rename language_id to language, and always send mode.
  • Stop reading bucket and storage_prefix: they are removed (they were always null).
  • Handle the new errors missing_model, missing_language, missing_mode, invalid_mode, codemix_not_supported, and the hot word and fallback errors listed under Errors.
Before (Kapture V3)
form.append("file", file) form.append("language_id", "hi") fetch(BASE + "/v3/asr/transcribe", ...)
After (Kapture 3.1)
form.append("file", file) form.append("model", "kapture_v3_1") form.append("language", "auto") form.append("mode", "native") fetch(BASE + "/v1/speech-to-text", ...)

FAQ

Yes. model=kapture_v3_1 is required on every request and SDK call. Without it the API returns 400 missing_model.