Skip to content
Docs

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:

FieldRequiredWhat it is
fileYesThe recording – MP3 or WAV, up to 15 MB. Give the file’s type: audio/mpeg for MP3, or audio/wav for WAV.
langYesThe language spoken, as a code such as en, fr, sw or rw

Important: the file must be sent as audio/mpeg, audio/wav or audio/wave. If it’s sent as application/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"
}
FieldWhat it is
transcription.transcriptionThe text
transcription.audio_lengthHow long the recording is, in seconds
transcription.read_time, transcription.transcribe_timeHow long Proto took to read the file and to transcribe it, in seconds
file_sizeThe 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 getWhat it means
400The 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.
403Your workspace has no voice credits left. Top up in Voice API, on the Billing tab.
504The 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.

Stuck? Ask Advisor in the Proto dashboard, or contact us.

© Proto