Speech to Text
API Specification
speech-to-text-translation models (stt)
curl https://audio.onerouter.pro/v1/audio/translations \
-H "Content-Type: multipart/form-data" \
-H "Authorization: <API_KEY>" \
--form 'file=@/path/to/file/speech.m4a' \
--form 'model="whisper-1"'from openai import OpenAI
import base64
import os
client = OpenAI(
api_key="<API_KEY>", # Replace with your Key "sk-***"
base_url="https://audio.onerouter.pro/v1"
)
audio_file = open("/path/to/file/speech.m4a", "rb")
transcript = client.audio.translations.create(
model="whisper-1",
file=audio_file
)
print(transcript){
"text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?"
}speech-to-text-transcription models (stt)
Last updated