Speech to text
Transcribe a recording, in its language or into English.
/v1/speech-to-text
| Field | Type | Description |
|---|---|---|
audio_base64required | string | The audio, base64-encoded. Up to 25 MB. |
mime_type | string | For example audio/wav (default), audio/mpeg, audio/ogg. |
language_code | string | The spoken language. Leave it out to detect it. |
model_id | string | stt-v1 (default), stt-lite or stt-fast. |
task | string | transcribe (default) or translate into English. |
timestamps | boolean | Also return segments: phrases with their start and end in seconds (stt-v1). |
redact | boolean | Replace 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.
/v1/speech-to-text/jobs
| Field | Type | Description |
|---|---|---|
audio_base64required | string | The recording, base64-encoded. |
mime_type | string | For example audio/wav (default) or audio/mpeg. |
language_code | string | The spoken language. Leave it out to detect it. |
num_speakers | number | How many people speak, if you know: it helps tell them apart. |
redact | boolean | Replace 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.
/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.