Speech To Text API
All the available APIs needed to generate transcript from audio.
post
https://api.convai.com/stt
/
This endpoint is called for transcribing an audio file.
Here are some sample codes to demonstrate the request format for the endpoint -->
Python
cURL
import requests
url = "https://api.convai.com/stt/"
payload={
"enableTimestamps": "<True or False>" # Dont need to set if False (default).
}
files=[
('file',('audio.wav',open('<path to audio file>','rb'),'audio/wav'))
]
headers = {
'CONVAI-API-KEY': '<your api key>'
}
response = requests.request("POST", url, headers=headers, data=payload, files=files)
print(response.text)
curl --location --request POST 'https://api.convai.com/stt/' \
--header 'CONVAI-API-KEY: <your api key>' \
--form 'file=@"<path to your audio file>"' \
--form 'enableTimestamps="<True or False>"'
Please note currently the API only supports wav and mp3 format for audio files. Sending audio files of other formats such as aac, flac, etc will result in an error.
Note: The audio should have a bit depth of at least 16 bits or higher.
post
https://api.convai.com/stt
/add-words
Adding specific words to be focused upon during the Speech-To-Text processing
Here are some sample codes to demonstrate the request format for the endpoint -->
Python
cURL
import requests
import json
url = "https://api.convai.com/stt/add-words"
payload = json.dumps({
"word": "<new word>"
})
headers = {
'CONVAI-API-KEY': '<your api key>',
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
curl --location --request POST 'https://api.convai.com/stt/add-words' \
--header 'CONVAI-API-KEY: <your api key>' \
--data-raw '{
"word": "<new word>"
}'
Last modified 3mo ago