How to beginner · 3 min read

How to transcribe audio with AI for free

Quick answer
Use the OpenAI Whisper model via the openai Python SDK to transcribe audio files for free within the OpenAI API free tier limits. Upload your audio and call client.audio.transcriptions.create() to get accurate text transcription.

PREREQUISITES

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

Setup

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

  • Run pip install openai to install the SDK.
  • Set your API key in your shell: export OPENAI_API_KEY='your_api_key' (Linux/macOS) or setx OPENAI_API_KEY "your_api_key" (Windows).
bash
pip install openai

Step by step

This example shows how to transcribe an audio file (WAV, MP3, or M4A) using the OpenAI Whisper model with the latest openai SDK.

python
import os
from openai import OpenAI

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

# Path to your audio file
audio_file_path = "audio_sample.mp3"

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

print("Transcription:", transcription.text)
output
Transcription: Hello, this is a sample audio transcription using OpenAI Whisper.

Common variations

You can use different audio formats supported by Whisper such as WAV, MP3, or M4A. For asynchronous or streaming transcription, you may implement chunked uploads or use other APIs, but the basic synchronous call shown is simplest.

Alternative models like openai GPT models do not support direct audio transcription; use Whisper specifically.

Troubleshooting

  • If you get an authentication error, verify your OPENAI_API_KEY environment variable is set correctly.
  • If the audio file format is unsupported, convert it to MP3 or WAV.
  • For large files, ensure your network connection is stable and the file size is within API limits.

Key Takeaways

  • Use OpenAI Whisper model via client.audio.transcriptions.create() for free audio transcription.
  • Install the official openai Python SDK and set your API key in environment variables.
  • Supported audio formats include MP3, WAV, and M4A; convert unsupported formats before transcription.
  • The OpenAI free tier allows limited free usage, ideal for small to medium transcription tasks.
  • Troubleshoot by checking API key, file format, and network stability.
Verified 2026-04 · whisper-1, gpt-4o
Verify ↗