DEV Community

Cover image for Why I Built a 50% Cheaper Whisper API Alternative (With Speaker Diarization)
DevDouble2
DevDouble2

Posted on

Why I Built a 50% Cheaper Whisper API Alternative (With Speaker Diarization)

If you are building AI applications today, you've probably used OpenAI's Whisper API. It’s incredibly accurate and easy to use. But as my audio processing volume grew, I hit two massive pain points:

  1. It's expensive at scale ($0.006 per minute).
  2. No native speaker diarization (It just returns a giant wall of text, without knowing who is speaking).

To solve this for my own projects, I ended up building an infrastructure that addresses both issues. Today, I'm making it public: FreeAudioToText API.

What it does

It is a drop-in replacement for the official OpenAI SDK. It processes audio with Whisper-level accuracy but adds highly accurate Speaker Diarization (SPK_1, SPK_2) out of the box, especially for English and Chinese.

Oh, and it costs $0.003 per minute — exactly 50% cheaper than OpenAI.

Zero Code Changes Required

I know developers hate learning new SDKs. So I made sure the API is 100% compatible with the official openai-python package.

You just need to change the base_url and your api_key:

from openai import OpenAI

# 1. Just change the base_url and api_key!
client = OpenAI(
  api_key="fat-xxxxxxxxx",
  base_url="https://api.freeaudiototext.com/v1"
)

# 2. Use the exact same code you already wrote
transcript = client.audio.transcriptions.create(
  model="whisper-1",
  file=open("meeting.mp3", "rb"),
  response_format="diarized_json" # We support speakers!
)

print(transcript.segments[0].speaker) # Output: "SPK_1"
Enter fullscreen mode Exit fullscreen mode

Try it out

I also just published the official wrapper on PyPI if you want to make sure your dependencies are aligned: pip install audiototext-optimizer. (Check it out on PyPI)

If you're building transcription apps, meeting summarizers, or podcasts tools, give it a try. There are no monthly fees, it's strictly pay-as-you-go starting with a few bucks for a Hobby tier.

👉 Documentation & API Keys: freeaudiototext.com/speech-to-text-api

I'd love to hear your feedback in the comments! What features should I add next?

Top comments (0)