Skip to content
API reference

Speech to text

Transcribe a recording, in its language or into English.


POST

/v1/speech-to-text

FieldTypeDescription
audio_base64requiredstringThe audio, base64-encoded. Up to 25 MB.
mime_typestringFor example audio/wav (default), audio/mpeg, audio/ogg.
language_codestringThe spoken language. Leave it out to detect it.
model_idstringstt-v1 (default), stt-lite or stt-fast.
taskstringtranscribe (default) or translate into English.
timestampsbooleanAlso return segments: phrases with their start and end in seconds (stt-v1).
redactbooleanReplace personal details with labels: phone numbers, emails, card numbers, Aadhaar, PAN, UPI ids and OTPs become [phone], [email] and so on.

Response

{
  "request_id": "6f1c…",
  "model_id": "stt-v1",
  "text": "Where is my order?",
  "language_code": "en-IN",
  "audio_seconds": 2.4,
  "segments": [{"text": "Where is my order?", "start": 0.0, "end": 2.3}]
}

Charged per second of audio (audio_seconds, also in the x-audio-seconds header). segments comes only with timestamps.

Example

curl -X POST https://lipivo.com/v1/speech-to-text \
  -H "x-api-key: $LIPIVO_API_KEY" \
  -H "content-type: application/json" \
  -d "{\"audio_base64\": \"$(base64 -w0 call.wav)\", \"mime_type\": \"audio/wav\"}"

Who said what: speakers

For a recorded call, meeting or interview with several people, up to two hours long. It runs as a job, because it takes from seconds to a few minutes: make it, then ask for the result.

POST

/v1/speech-to-text/jobs

FieldTypeDescription
audio_base64requiredstringThe recording, base64-encoded.
mime_typestringFor example audio/wav (default) or audio/mpeg.
language_codestringThe spoken language. Leave it out to detect it.
num_speakersnumberHow many people speak, if you know: it helps tell them apart.
redactbooleanReplace personal details with labels, as above.

The answer is {"job_id": "stj_…", "status": "processing"} (status 202). The job is charged then, per second of audio, like speech to text.

GET

/v1/speech-to-text/jobs/{job_id}

{
  "job_id": "stj_…",
  "status": "completed",
  "text": "Hello, this is Asha. Hi Asha, how can I help?",
  "speakers": 2,
  "segments": [
    {"speaker": "speaker_1", "text": "Hello, this is Asha.", "start": 0.0, "end": 1.5},
    {"speaker": "speaker_2", "text": "Hi Asha, how can I help?", "start": 1.6, "end": 3.0}
  ]
}

Until it is done, status is processing: ask again every few seconds. A job that cannot be transcribed answers failed with an error. Results are kept for 7 days, for the API key's workspace only.