Skip to content

openai-edge-tts

Local OpenAI-compatible text-to-speech API built on Edge TTS, for self-hosted AI apps

Copyleft (OSI) · GPL-3.0 AI-native

Listed by , founder & editor

25

Health

Dormant

Overview

Stars

2,178

Last commit

17 months ago

Jul 2025

Repository age

2 years

since Oct 2024

Latest version

v2.0.0

Dec 2024

Contributors

–

Releases

0

last 12 months

Docker pulls

419k

travisvn/openai-edge-tts

Language

Python

This project is a small Python service that imitates the OpenAI text-to-speech endpoint, /v1/audio/speech. Apps built for the OpenAI API, such as Open WebUI, can point at it instead. It generates speech through edge-tts, which uses Microsoft Edge's online speech service at no cost.

It maps the OpenAI voices alloy, echo, fable, onyx, nova and shimmer to Edge equivalents, or you can name any edge-tts voice directly. Output formats are mp3, opus, aac, flac, wav and pcm. Speed ranges from 0.25x to 4.0x, and Server-Sent Events streaming is supported. Settings such as default voice, format and API key live in a .env file.

You run it with a single Docker command or Docker Compose. ffmpeg is needed only for formats other than mp3. It is GPL-3.0 licensed. It replaces the paid OpenAI TTS API for basic needs, but synthesis still relies on Microsoft's online service.

Who it's for

Open WebUI and Ollama users wanting spoken replies

The OpenAI-style endpoint plugs in with one URL and no paid key.

Skip if: You need fully offline speech synthesis.

Developers prototyping with the OpenAI TTS API

Existing request code works against a local endpoint at no cost.

Skip if: You need guaranteed uptime or a commercial service agreement.

The problem it solves

OpenAI's text-to-speech API charges per use, and many self-hosted AI tools expect that API shape. This service offers the same endpoint locally and backs it with Edge TTS voices.

Strengths

  • Same /v1/audio/speech endpoint shape as OpenAI
  • Six output formats and speed from 0.25x to 4.0x
  • SSE streaming for real-time audio
  • One-line Docker start with default settings
  • Docker image has over 400,000 pulls

Trade-offs

  • Depends on Microsoft's online Edge TTS service, so it is not offline
  • No commits or releases since mid-2025
  • ffmpeg is needed for formats other than mp3
  • GPL-3.0 requires derived work to stay open

Self-host openai-edge-tts

Self-hostable
Yes
Docker image
travisvn/openai-edge-tts
Docker Compose
The repository ships a Compose file

Quick start

docker run -d -p 5050:5050 travisvn/openai-edge-tts:latest

From the project's own install instructions. Check the docs for production settings.

Frequently asked questions

Is it free?

Yes. The code is GPL-3.0 and edge-tts uses Microsoft Edge's online service at no cost.

Can I self-host it?

Yes. Run the Docker image or build with Docker Compose. It listens on port 5050 by default.

Which audio formats are supported?

mp3, opus, aac, flac, wav and pcm. Formats beyond mp3 need ffmpeg.

Does it require an API key?

You can set one in the .env file with API_KEY and REQUIRE_API_KEY.

Similar tools in Text-to-speech and voice AI

voice-pro

Text-to-speech and voice AI

Web app for transcription, translation, dubbing and voice cloning on a Windows NVIDIA PC

13k 1.9k 4 months ago Dormant GPL-3.0

Dograh

Text-to-speech and voice AI

Self-hosted visual builder for inbound and outbound AI voice agents

6.3k 1.6k 8 days ago Thriving BSD-2-Clause

Replaces Vapi

voice-chat-ai

Text-to-speech and voice AI

Talk by voice to AI characters, using local or cloud models, from a web UI

471 110 8 days ago Active MIT

Piper

Text-to-speech and voice AI

Local neural text-to-speech engine for apps, assistants and screen readers

6.4k 645 today Active GPL-3.0

Kokoro FastAPI

Text-to-speech and voice AI

Dockerized OpenAI-compatible text-to-speech server built on the Kokoro-82M model

5.7k 957 3 days ago Thriving Apache-2.0

OpenUtau

Text-to-speech and voice AI

Singing voice editor for UTAU users on Windows, macOS and Linux

4.6k 612 8 days ago Active MIT