Portkey's AI gateway supports STT models like Whisper by OpenAI.
Transcription & Translation Usage
Portkey supports both Transcription and Translation methods for STT models and follows the OpenAI signature where you can send the file (in flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm formats) as part of the API request.
from pathlib import Pathfrom portkey_ai import Portkey# Initialize the Portkey clientportkey =Portkey( api_key="PORTKEY_API_KEY", # Replace with your Portkey API key virtual_key="VIRTUAL_KEY"# Add your provider's virtual key)audio_file=open("/path/to/file.mp3", "rb")# Transcriptiontranscription = portkey.audio.transcriptions.create( model="whisper-1", file=audio_file)print(transcription.text)# Translationtranslation = portkey.audio.translations.create( model="whisper-1", file=audio_file)print(translation.text)
On completion, the request will get logged in the logs UI where you can see trasncribed or translated text, along with the cost and latency incurred.
Supported Providers and Models
The following providers are supported for speech-to-text with more providers getting added soon. Please raise a request or a PR to add model or provider to the AI gateway.