Skip to main content

/audio/transcriptions

Overviewโ€‹

FeatureSupportedNotes
Cost Trackingโœ…
Loggingโœ…works across all integrations
End-user Trackingโœ…
Fallbacksโœ…between supported models
Loadbalancingโœ…between supported models
Support llm providersopenai, azure, vertex_ai, gemini, deepgram, groq, fireworks_ai

Quick Startโ€‹

LiteLLM Python SDKโ€‹

Python SDK Example
from litellm import transcription
import os

# set api keys
os.environ["OPENAI_API_KEY"] = ""
audio_file = open("/path/to/audio.mp3", "rb")

response = transcription(model="whisper", file=audio_file)

print(f"response: {response}")

LiteLLM Proxyโ€‹

Add model to configโ€‹

OpenAI Configuration
model_list:
- model_name: whisper
litellm_params:
model: whisper-1
api_key: os.environ/OPENAI_API_KEY
model_info:
mode: audio_transcription

general_settings:
master_key: sk-1234

Start proxyโ€‹

Start Proxy Server
litellm --config /path/to/config.yaml 

# RUNNING on http://0.0.0.0:8000

Testโ€‹

Test with cURL
curl --location 'http://0.0.0.0:8000/v1/audio/transcriptions' \
--header 'Authorization: Bearer sk-1234' \
--form 'file=@"/Users/krrishdholakia/Downloads/gettysburg.wav"' \
--form 'model="whisper"'

Supported Providersโ€‹


Fallbacksโ€‹

You can configure fallbacks for audio transcription to automatically retry with different models if the primary model fails.

Test with cURL and Fallbacks
curl --location 'http://0.0.0.0:4000/v1/audio/transcriptions' \
--header 'Authorization: Bearer sk-1234' \
--form 'file=@"gettysburg.wav"' \
--form 'model="groq/whisper-large-v3"' \
--form 'fallbacks[]="openai/whisper-1"'

Testing Fallbacksโ€‹

You can test your fallback configuration using mock_testing_fallbacks=true to simulate failures:

Test Fallbacks with Mock Testing
curl --location 'http://0.0.0.0:4000/v1/audio/transcriptions' \
--header 'Authorization: Bearer sk-1234' \
--form 'file=@"gettysburg.wav"' \
--form 'model="groq/whisper-large-v3"' \
--form 'fallbacks[]="openai/whisper-1"' \
--form 'mock_testing_fallbacks=true'