How to beginner · 3 min read

Whisper API file size limits

Quick answer
The Whisper API accepts audio files up to 25MB in size for transcription. Supported formats include mp3, mp4, mpeg, mpga, m4a, wav, and webm. Files larger than 25MB must be split or compressed before uploading.

PREREQUISITES

  • Python 3.8+
  • OpenAI API key (free tier works)
  • pip install openai>=1.0

Setup

Install the openai Python package and set your OpenAI API key as an environment variable.

bash
pip install openai>=1.0

Step by step

Use the Whisper API to transcribe an audio file under 25MB. The example below demonstrates uploading an mp3 file and printing the transcription text.

python
import os
from openai import OpenAI

client = OpenAI(api_key=os.environ["OPENAI_API_KEY"])

with open("audio.mp3", "rb") as audio_file:
    transcript = client.audio.transcriptions.create(
        model="whisper-1",
        file=audio_file
    )

print(transcript.text)
output
Transcribed text from the audio file.

Common variations

You can transcribe other supported audio formats like wav or m4a by changing the file path. For asynchronous or streaming transcription, use appropriate async libraries or local Whisper models. Large files over 25MB require splitting or compression before upload.

Troubleshooting

  • If you receive a 413 Payload Too Large error, ensure your audio file is under 25MB.
  • For unsupported formats, convert your audio to a supported type like mp3 or wav.
  • Check your API key and environment variable if authentication fails.

Key Takeaways

  • The Whisper API accepts audio files up to 25MB for transcription.
  • Supported audio formats include mp3, mp4, mpeg, mpga, m4a, wav, and webm.
  • Files larger than 25MB must be split or compressed before uploading.
  • Use the OpenAI Python SDK with client.audio.transcriptions.create for easy integration.
  • Check for 413 errors and format issues to troubleshoot upload problems.
Verified 2026-04 · whisper-1
Verify ↗