Skip to content
Get API key API key

Audio (speech-to-text)

AI Foundation Services provides Whisper-based audio models for transcription and translation, compatible with the OpenAI Audio API.

What you’ll learn:

  • How to transcribe audio to text in the original language
  • How to translate audio from any language to English
  • Available audio models and parameters

The audio models are whisper-large-v3 and whisper-large-v3-turbo. To see which of them your key can use, list the models and look for whisper in the ID:

from openai import OpenAI
client = OpenAI()
models = client.models.list()
for model in models.data:
if "whisper" in model.id:
print(model.id)

The transcription API converts audio into text in the same language as the input. It auto-detects the language from the first 30 seconds if language is not specified.

from openai import OpenAI
client = OpenAI()
with open("/path/to/audio_file.mp3", "rb") as audio_file:
transcription = client.audio.transcriptions.create(
model="whisper-large-v3",
file=audio_file,
# language="en" # Optional: specify language
)
print(f"Transcription: {transcription.text}")

Example output:

Transcription: The stale smell of old beer lingers. It takes heat to bring out the odor.
A cold dip restores health and zest. A salt pickle tastes fine with ham.

The translation API translates audio from any language into English.

from openai import OpenAI
client = OpenAI()
with open("/path/to/audio_file.mp3", "rb") as audio_file:
translation = client.audio.translations.create(
model="whisper-large-v3",
file=audio_file,
temperature=1.0,
)
print(f"Translation: {translation.text}")
ParameterTypeDescription
modelstringAudio model ID (e.g., whisper-large-v3)
filefileThe audio file to process
languagestringOptional. ISO language code. Auto-detected if omitted.
temperaturefloat0.0 for deterministic, higher for more varied output
  1. Auto Language Detection — Identifies input language from the first 30 seconds
  2. Customizable Output — Adjust behavior with language and temperature parameters
  3. Efficient Processing — Low latency for both transcription and translation

The endpoint takes model, file, language, and temperature. Language detection uses the first 30 seconds of the audio.