Skip to main content

/audio/transcriptions

Overview​

FeatureSupportedNotes
Cost Tracking✅Works with all supported models
Logging✅Works across all integrations
End-user Tracking✅
Fallbacks✅Works between supported models
Loadbalancing✅Works between supported models
Guardrails✅Applies to output transcribed text (non-streaming only)
Supported Providersopenai, azure, vertex_ai, gemini, deepgram, groq, fireworks_ai, ovhcloud, mistral

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​

Deprecated for Proxy requests

Starting in LiteLLM Proxy v1.85.0, mock_testing_fallbacks is stripped from incoming Proxy requests and has no effect. It remains supported only for direct litellm.Router calls in tests.

To validate audio transcription fallbacks through the Proxy, trigger an actual provider error in a non-production environment and send a normal request with the fallback configuration.

🚅
LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails — built for production.
Learn more →