Skip to main content
POST
Speech to Text (REST)

Overview

The REST endpoint transcribes an audio file in a single synchronous HTTP request and returns the transcript immediately. It is best suited for short, pre-recorded audio clips.

Endpoint


Authentication

Pass your API key in the request header.

Request Parameters

All parameters are sent as multipart/form-data fields.
file
required
Audio file to transcribe. Supported formats: WAV, MP3, OGG, FLAC, AAC, M4A. Maximum duration: 60 seconds (ideal ≤ 30 s).
string
required
BCP-47 language code. See Supported Languages below.
enum
default:"verbatim"
verbatim — raw spoken-form output. transcribe — enables Inverse Text Normalization (ITN): numbers, currency, dates, and phone numbers are written in their conventional form. See ITN below.
boolean
default:"false"
When format=transcribe, set true to render digits in the native script of the target language (e.g. ₹५,००० instead of ₹5,000 for Hindi). Has no effect when format=verbatim.
boolean
default:"false"
Set to true to enable post-transcription find-and-replace. When enabled, all patterns listed in substitution_map are replaced in the final transcript text after recognition and ITN. Has no effect when false (default) — the substitution_map field is ignored entirely.
string
A JSON-encoded list of substitution rules applied to the transcript after recognition and ITN. Only evaluated when enable_substitution=true. Maximum 10 rules.Each rule is an object with two fields:
Rules are applied in a single pass — there is no risk of one replacement being re-matched by a later rule. Longer phrases take priority over shorter ones (e.g. "New Delhi" matches before "Delhi").
Substitution runs on the final client-visible transcript only. Billing records always carry the original raw transcript regardless of this setting.
string
Words to boost during recognition — brand names, product names, or other terms the model tends to miss. Up to 100 words, as a JSON array (["EMI","Prisma"]) or comma-separated (EMI,Prisma). Each entry must be a single word of letters only (no spaces, digits, punctuation, or symbols). Only takes effect together with a positive bias_score. See Word Boosting below.
number
Boost strength for bias_list. One of 0.0, 0.5, 1.0, 1.5, 2.0. 0.0 or omitted turns boosting off.

Response

200 — Success

Error Responses


Code Example


Python SDK

The official Python SDK handles multipart construction, authentication headers, and retries automatically.

Installation

Requires Python 3.10+.

Authentication

The client requires an api_key credential. You can pass it directly or load it from environment variables.

Transcribe Audio

Custom Request ID

Pass a request_id to correlate SDK calls with your own logs or support tickets.

Error Handling


Supported Languages

The Gnani Prisma v2.5 API supports 10 Indian languages.
Batch STT: Gujarati (gu-IN) and Punjabi (pa-IN) are supported here on REST but not on Batch STT. Use REST or Realtime for those languages; use Batch for the nine languages listed on the Batch introduction page.

Inverse Text Normalization (ITN)

ITN converts the spoken-form output of the ASR engine into the conventional written form a reader expects — numbers become digits, currency gets the ₹ symbol, dates are formatted, and phone numbers are compacted — all in one pass, immediately after transcription. How to enable: Set format=transcribe in the request body.

What ITN Normalizes

1 — Cardinal & Ordinal Numbers

Whole numbers and positional ranks are formatted using Indian comma grouping (groups of 2 after the first 3 digits).

2 — Currency & Money

All Indian currency expressions — including paise fractions and lakh/crore scales — are formatted with the ₹ symbol and Indian comma grouping.

3 — Dates

4 — Times

Indian time-of-day words (सुबह, दोपहर, शाम, रात) automatically map to 24-hour HH:MM output.

5 — Phone Numbers & PIN Codes

Digit streams are concatenated into compact numeric strings. 10-digit streams → mobile number; 6-digit streams → PIN. Repeat prefixes (double/डबल, triple/ट्रिपल) are expanded.

6 — Mixed & Code-Mixed Utterances

A single sentence may contain multiple entity types or blend Hindi and English. ITN handles all in one pass, normalizing each entity independently.

Native Script Digits — itn_native_numerals

By default, ITN outputs Western Arabic digits (0–9) regardless of language. Set itn_native_numerals=true to render digits in the native script of the target language.

What ITN Does Not Change

ITN intentionally preserves idiomatic and ambiguous phrases to avoid incorrect normalization.
  • दो तीन (meaning a few) stays as text, not 2 or 3
  • कर दो / ले दो (imperative verbs) are kept as words, not treated as cardinal 2
If a word or phrase is unchanged in the output, treat it as a failure only when the input was unambiguously a numeric entity.

Find-and-Replace (Substitution)

After transcription (and after ITN, if enabled), the API can apply a custom set of find-and-replace rules to the transcript. Use this to:
  • Normalise domain-specific terms (“rs” → “INR”, “ok” → “acknowledged”)
  • Replace competitor names, internal codes, or product shortforms
  • Standardise phrases that the model consistently transcribes differently from your expected output

How to enable

Set enable_substitution=true and pass your rules as a JSON string in substitution_map.

Rule format

  • Up to 10 rules per request.
  • Each rule can list any number of patterns that all map to the same replacement.
  • Matching is case-insensitive ("ok" matches "OK", "Ok", "ok").
  • Matching respects Unicode word boundaries — "ok" does not match inside "okay".
  • Longer phrases always match before shorter ones — "New Delhi" is tried before "Delhi".
  • Rules are applied in a single pass with no cascading — a replacement is never re-matched by another rule.

Example

Substitution runs on the final client-visible transcript only. Billing and analytics records always carry the original raw transcript regardless of this setting.

Word Boosting (bias_list)

Word boosting nudges the recognizer toward specific words so they are more likely to be transcribed correctly — useful for brand names, product names, and domain terms that are otherwise misheard. It influences recognition itself; it is not a find-and-replace (see Find-and-Replace for that).

How to use

Send both fields together: Start at 1.0 and raise only if a word is still missed — stronger boosting can make the model favour a listed word where it wasn’t spoken.

Word rules

  • Each entry is one word. Phrases such as "loan number" are not allowed.
  • Letters only — English letters or letters in the supported Indian scripts. No digits (HDFC2), punctuation (HDFC-EMI), or symbols (@brand).
  • Casing does not matter.
  • Maximum 100 words; any beyond that are dropped.
  • Use format=verbatim. Boost words are spoken-form tokens, so digit strings and normalized numbers won’t work.
  • Use a JSON array if you’d rather not worry about commas; both formats are accepted.
Invalid input does not return an error. If any entry breaks the rules (or bias_score is not an allowed value), the whole list is ignored and the audio is transcribed without boosting, still returning 200. If boosting seems to have no effect, check your list first.

When it applies

Boosting applies when language_code (and every code in multi_lang_codes, if used) is a specific language such as hi-IN or en-IN, and you use the default model (omit model, or vachana-audio-intelligence-v2). It is not available on Batch STT. With multi_lang_codes, the same list and score apply to every language. The response format is unchanged; boosted words are not echoed back.

Example

Authorizations

X-API-Key-ID
string
header
required

API key for authentication. Sign up in Vachana to get the API Key.

Body

multipart/form-data
audio_file
file
required

Audio file to transcribe. Supported formats - WAV, MP3, OGG, FLAC, AAC, M4A. Maximum duration - 60 seconds (Ideal duration is 30 seconds).

language_code
enum<string>
required

Language code for transcription. Use one of the supported language codes.

Supported values: bn-IN, en-IN, gu-IN, hi-IN, kn-IN, ml-IN, mr-IN, pa-IN, ta-IN, te-IN

Available options:
bn-IN,
en-IN,
gu-IN,
hi-IN,
kn-IN,
ml-IN,
mr-IN,
pa-IN,
ta-IN,
te-IN
Example:

"hi-IN"

format
enum<string>
default:verbatim

Output format for the transcript.

  • verbatim (default) — Returns the raw spoken-form transcript as recognised by the ASR engine. No post-processing is applied.
  • transcribe — Enables Inverse Text Normalization (ITN). Spoken numeric expressions, currency, dates, times, and phone numbers are automatically converted to their written form (e.g. "five thousand rupees" → "₹5,000").
Available options:
verbatim,
transcribe
Example:

"transcribe"

itn_native_numerals
boolean
default:false

When format=transcribe, set to true to render digits in the native script of the target language instead of Western Arabic digits (0–9).

For example, with hi-IN: "पाँच हज़ार रुपये" → "₹५,०००" instead of "₹5,000".

Has no effect when format=verbatim.

Example:

true

enable_substitution
boolean
default:false

Set to true to enable post-transcription find-and-replace. All patterns listed in substitution_map are applied to the transcript after recognition and ITN.

When false (default), the substitution_map field is ignored entirely — no performance cost.

Example:

true

substitution_map
string

JSON-encoded list of substitution rules applied to the transcript after recognition and ITN. Only evaluated when enable_substitution=true. Maximum 10 rules.

Each rule must have:

  • patterns (array of strings) — one or more strings to find. Matching is case-insensitive and respects Unicode word boundaries.
  • replacement (string) — the string to substitute for every matched pattern in this rule.

Rules are applied in a single pass — no cascading. Longer phrases take priority over shorter ones.

Example value:

Example:

"[{\"patterns\":[\"okay\",\"ok\"],\"replacement\":\"acknowledged\"},{\"patterns\":[\"rupees\",\"rs\"],\"replacement\":\"INR\"}]"

bias_list
string

Words to boost during recognition (word boosting). Up to 100 words, sent as a JSON array or a comma-separated string. Each entry must be a single word made of letters only — no spaces, digits, punctuation, or symbols. Must be paired with a positive bias_score.

Use with format=verbatim for best results. Applies to the supported languages with the default model (vachana-audio-intelligence-v2).

An invalid list never fails the request — it is transcribed normally with boosting skipped.

Example:

"[\"Timbre\",\"Prisma\",\"EMI\"]"

bias_score
enum<number>

Boost strength for bias_list. Allowed values: 0.0, 0.5, 1.0, 1.5, 2.0. 0.0 (or omitting it) disables boosting; any other value is ignored and boosting is skipped.

Available options:
0,
0.5,
1,
1.5,
2
Example:

1

Response

Successful transcription

success
boolean

Indicates if the transcription was successful

timestamp
string

Request timestamp in format YYYYMMDD_HHMMSS.mmm

transcript
string

The transcribed text from the audio