Using Transcription and Translation

Obiguard provides both Transcription and Translation options for speech-to-text (STT) models, following the OpenAI API format. You can submit audio files in formats such as flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav, or webm as part of your API request.

Example:

from pathlib import Path
from obiguard import Obiguard

# Initialize the Obiguard client
client = Obiguard(
  virtual_key="vk-obg***"   # Your Obiguard virtual key here
)
audio_file= open("/path/to/file.mp3", "rb")

# Transcription
transcription = client.audio.transcriptions.create(
  model="whisper-1",
  file=audio_file
)
print(transcription.text)

# Translation
translation = client.audio.translations.create(
  model="whisper-1",
  file=audio_file
)
print(translation.text)

After completion, your request will appear in the logs UI, displaying the transcribed or translated text, as well as the associated cost and latency.

Supported Providers and Models

Currently, the following providers are supported for speech-to-text. More providers will be added soon.

ProviderModelFunctions
OpenAIwhisper-1Transcription, Translation