External API
Transcribe audio
Transcribe a short recording with Proto's speech recognition, and get the text back straight away.
Transcribes a recording into text – for example, a voicemail or a customer’s voice note. Proto replies with the text straight away. For long recordings, transcribe in the background instead. Each request uses 1 voice credit, however long the recording – you can see your credits in Settings, under Workspace, then Voice API. Not sure how to send a request? See Make your first request.
Request
Send a POST request to:
https://v3-api.proto.cx/api/platform/v1/voice/YOUR_TEAMSPACE_ID/asr
Send the recording as a form, with these fields. In the address, replace anything starting with YOUR_ with your own:
| Field | Required | What it is |
|---|---|---|
file | Yes | The recording – MP3 or WAV, up to 15 MB. Give the file’s type: audio/mpeg for MP3, or audio/wav for WAV. |
lang | Yes | The language spoken, as a code such as en, fr, sw or rw |
Important: the file must be sent as
audio/mpeg,audio/wavoraudio/wave. If it’s sent asapplication/octet-stream, Proto rejects it.
Proto understands 98 languages, including af, am, ar, de, en, es, fr, ha, hi, kj, pt, rw, so, sw, yo, zh-Hans and zh-Hant. If it doesn’t support a code, the error lists the ones it does.
Response
Proto replies 200 OK with the text:
{
"transcription": {
"transcription": "Hello, I'd like to check the status of my order.",
"audio_length": 4.82,
"read_time": 0.03,
"transcribe_time": 1.21
},
"file_size": 77184,
"lang": "en"
}
| Field | What it is |
|---|---|
transcription. | The text |
transcription. | How long the recording is, in seconds |
transcription.read_time, transcription. | How long Proto took to read the file and to transcribe it, in seconds |
file_size | The file’s size in bytes |
The request appears in Voice API, on the Detailed usage tab.
Errors
If a request fails after Proto takes the credit, the credit is given back.
| You get | What it means |
|---|---|
400 | The language isn’t supported, the file is over 15 MB or isn’t sent as audio/mpeg, audio/wav or audio/wave – or speech recognition isn’t available. The message says which. |
403 | Your workspace has no voice credits left. Top up in Voice API, on the Billing tab. |
504 | The recording took more than 60 seconds to transcribe. Use Transcribe audio in the background. |
For errors any request can return, see If something goes wrong.