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: 30 seconds.
string
Model to use. Send prisma-v3.0 for Prisma v3.0. Leave it out to use Prisma v2.5, the default model (the response reports it as prisma-v2.5).
string
required
A language code from Supported Languages. Prisma v2.5 accepts one language. Prisma v3.0 also accepts indic-auto, or a comma-separated list of 1–4 languages, for example hi-IN,en-IN. The model listens for the languages you send first, and the transcript follows the language actually spoken. They are hints, not a lock. See Language detection. Required, except with format=transliterate on prisma-v3.0, where it is optional and defaults to indic-auto.
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. codemix (prisma-v3.0 only) keeps English words in Latin script and mostly spells numbers as words. transliterate (prisma-v3.0 only) writes the whole transcript in Latin letters, for example तो ठीक है becomes to theek hai; see Romanised output. With prisma-v3.0, the default when format is omitted depends on the request; see Output styles.
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. No effect on prisma-v3.0 for this endpoint.
string
prisma-v3.0: words or short phrases to favour, as a JSON array (["खाता","HDFC Bank"]) or comma-separated, up to 200. See Context.
string
prisma-v3.0: what the recording is about. Any non-empty text, up to 1,600 characters (no minimum).
string
prisma-v3.0: the transcript of the clip just before this one. Any non-empty text (no minimum); the last 600 characters are kept. Applies to the first part of the audio only.
string
prisma-v3.0: a JSON array or comma-separated names, 1–4.
You can send any combination of keyterms, topic, previous_text and speaker_names, from none to all four. A value outside its limit returns 400 INVALID_CONTEXT. See Context.
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
Prisma v2.5. 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. On prisma-v3.0, bias_list is the older name of keyterms and is used only when keyterms is not sent.
number
Prisma v2.5 only; ignored by prisma-v3.0. 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

†Audio shorter than 0.1 s returns {"success": true, "request_id": "…", "transcript": ""} with no model or timings. An empty transcript is not an error. Prisma v2.5 returns model as prisma-v2.5 and the output.literal field:
A transcript that was cut short carries truncated:

Error responses

Speech-to-Text (REST) errors use this envelope:
The HTTP status is the reliable signal; branch on error.type. These responses use a different shape: validation errors such as a missing language_code or audio_file (422 with {"detail": [...]}), the 504 on Prisma v3.0, authentication and rate-limit errors, Batch errors, Text-to-Speech and Voice Cloning errors and streaming error messages.

Prisma v3.0

The 504 body is not the envelope:
The 504 bounds the transcription step only, so a request can take longer end to end and still succeed.

Prisma v2.5

Prisma v2.5 returns the same error.type values as Prisma v3.0 where they apply (see the Prisma v3.0 table for the audio errors EMPTY_AUDIO, UNSUPPORTED_AUDIO_FORMAT, AUDIO_CONVERSION_ERROR and MAX_AUDIO_DURATION_EXCEEDED, and for INTERNAL_SERVER_ERROR). These are the ones specific to v2.5: Invalid bias_list input, or a numeric bias_score that is not an allowed value, is skipped and the request succeeds.

Authentication and rate limits

Authentication and rate-limit errors do not use the success / error envelope. They look like this:
The same shapes are returned by REST, Batch, Text-to-Speech, Voice Cloning and the Realtime handshake (as an HTTP response before the WebSocket opens). See Error Reference for streaming, Batch and retry guidance.

Code example

The examples below are grouped by language and model version. Each block is a complete request you can copy. The model form field selects the version: send prisma-v3.0 for Prisma v3.0; leave it out for Prisma v2.5.

cURL — Prisma v3.0

cURL — Auto-detect the language
cURL — One language and output style
cURL — Romanised output (Latin letters)
cURL — Keyterms and topic
cURL — Several options in one request
You can add previous_text and speaker_names to the same request. Any combination of the four context fields is accepted.

Python — Prisma v3.0

Python — Auto-detect the language
Python — One language and output style
Python — Romanised output (Latin letters)
Python — Keyterms and topic
Python — Several options in one request

cURL — Prisma v2.5

cURL — Transcribe with native numerals
cURL — Find-and-replace
cURL — Word boosting

Python — Prisma v2.5

Python — Transcribe with native numerals
Python — Find-and-replace
Python — Word boosting
Python SDK

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

Both models support the same 10 languages.
indic-auto (Prisma v3.0 only). Send language_code=indic-auto to let the model identify the language itself. It is not a language: the reply carries the language it heard in detected_language_code. See Language detection.

Inverse text normalization (ITN)

This section describes Prisma v2.5. On Prisma v3.0 the model formats numbers itself when format=transcribe; see Output styles. 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)

Find-and-replace applies on both models and runs after transcription. 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)

This section describes Prisma v2.5. For Prisma v3.0 use keyterms; see Context. 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 is a specific language such as hi-IN or en-IN, and you use Prisma v2.5, the default model (omit model). Batch STT has its own bias_list and bias_score settings; see Word boosting on Batch. The response format is unchanged; boosted words are not echoed back.

Example


Behaviour notes (Prisma v3.0)

  • One transcript. On v3.0 transcript is always a string, never a dictionary.
  • An empty transcript is not an error. Log it; do not treat it as a failure.
  • truncated: true means the model hit its token limit and the transcript is incomplete. Retry with shorter audio or split the recording. The field is only present when this happens.
  • Context can lower accuracy — test with and without it.
  • end_to_end_latency includes your upload; processing_time does not.
  • Results for identical audio can differ by a borderline word; cache results if you need stable output.
  • Very short utterances (under about a second) are the least reliable. Silence is detected first, and a clip with no speech returns an empty transcript.

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 - 30 seconds.

language_code
string
required

Language code for transcription. Required for both models. Use one of the supported language codes. Prisma v2.5 accepts one language.

Prisma v3.0 accepts indic-auto (let the model identify the language), or a comma-separated list of 1-4 languages, for example hi-IN,en-IN. The model listens for the languages you send first, and the transcript follows the language actually spoken. They are hints, not a lock.

With format=transliterate on prisma-v3.0 this field is optional and defaults to indic-auto.

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

Example:

"hi-IN"

model
enum<string>

Model to use. Send prisma-v3.0 for Prisma v3.0. Leave it out to use Prisma v2.5, the default model (the response reports it as prisma-v2.5).

Available options:
prisma-v3.0
Example:

"prisma-v3.0"

format
enum<string>
default:verbatim

Output format for the transcript.

  • verbatim (default on Prisma v2.5) — 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").
  • codemix (prisma-v3.0 only) — English words stay in Latin script; numbers mostly stay as spoken words.
  • transliterate (prisma-v3.0 only) — the whole transcript is written in Latin letters (for example तो ठीक है becomes to theek hai); numbers are spelled out as words. language_code becomes optional. detected_language_code is not returned.

With prisma-v3.0, the default when format is omitted depends on the request. See Output styles.

Available options:
verbatim,
transcribe,
codemix,
transliterate
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. No effect on prisma-v3.0 for this endpoint.

Example:

true

keyterms
string

prisma-v3.0: words or short phrases to favour, as a JSON array or comma-separated, up to 200. Can be combined with topic, previous_text and speaker_names.

Example:

"[\"खाता\",\"HDFC Bank\"]"

topic
string

prisma-v3.0: what the recording is about. Any non-empty text, up to 1,600 characters (no minimum).

Maximum string length: 1600
previous_text
string

prisma-v3.0: transcript of the clip just before this one. Any non-empty text (no minimum); the last 600 characters are kept.

speaker_names
string

prisma-v3.0: JSON array or comma-separated names, 1–4.

Example:

"[\"Priya\",\"Rahul\"]"

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

Prisma v2.5: words to boost during recognition (word boosting). On prisma-v3.0, bias_list is the older name of keyterms; it is used only when keyterms is not sent. 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 (Prisma v2.5).

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

Example:

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

bias_score
enum<number>

Prisma v2.5 only; ignored by prisma-v3.0. 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 number is ignored and boosting is skipped. A value that is not a number is rejected with 422.

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

1

Response

Successful transcription

success
boolean

Indicates if the transcription was successful

request_id
string

Your X-API-Request-ID, or a generated id.

output
object

Prisma v2.5 only.

transcript
string

The transcribed text from the audio. With format=transliterate the whole transcript is in Latin letters. That format works only with prisma-v3.0, not Prisma v2.5.

model
string
Example:

"prisma-v3.0"

detected_language_code
string

Prisma v3.0 only. Locale judged from the script of the transcript, for every request. Absent when there is nothing to judge, such as an empty transcript, and not returned with format=transliterate.

Example:

"hi-IN"

truncated
boolean

Present, and true, only when the model hit its token limit and the transcript was cut short. Left out when the transcript is complete, so false is never returned.

processing_time
number

Seconds spent on the request after the upload was parsed.

end_to_end_latency
number

Seconds since the request arrived. Includes upload time.