Open-source local OpenAI-compatible TTS API using edge-tts, exposing /v1/audio/speech with SSE streaming, multiple voices and formats. Docker or Python run options with env-based config.
Collecting history — the radar snapshots this repo daily. The trend line appears after 3 days of data (1 so far).
What it is
A local, OpenAI-compatible text-to-speech API built on edge-tts, emulating the OpenAI TTS endpoint (/v1/audio/speech) to generate speech from text using edge-tts voices and playback speeds.
How it works
It provides an OpenAI-compatible endpoint for tts requests, supports SSE streaming via stream_format: "sse", maps OpenAI voices to edge-tts equivalents, and allows multiple audio formats (mp3, opus, aac, flac, wav, pcm). It can either use mapped voices or specify an edge-tts voice directly. The service runs via Docker or Python, with environment variables controlling defaults like voice, format, and speed.
Getting started
Quick start via Docker:
docker run -d -p 5050:5050 travisvn/openai-edge-tts:latest
Prerequisites include Docker (recommended), and optional Python for local development and ffmpeg for audio format conversion. Installation steps include cloning the repo, creating a .env with values (API_KEY, PORT, DEFAULT_VOICE, DEFAULT_RESPONSE_FORMAT, DEFAULT_SPEED, DEFAULT_LANGUAGE, REQUIRE_API_KEY, REMOVE_FILTER, EXPAND_API, DETAILED_ERROR_LOGGING), and running with docker compose up --build. For Python run:
git clone https://github.com/travisvn/openai-edge-tts.git
cd openai-edge-tts
Then follow the Python run steps to set up a virtual environment, install dependencies, and run the server with Python app/server.py.
Access the API at http://localhost:5050.
Recent releases
Latest release: v2.0.0 - Markdown Filtering, Expanded API Support, & Simplified Setup (2024-12-28).
Traction
Stars: 2019. Forks: 304. Open issues: 11. Language: Python. License: GPL-3.0. Created: 2024-10-09. Last push: 2025-07-01.
Caveats
License: GPL-3.0. Age: created 2024-10-09. Open issues: 11. Installation notes specify Docker prerequisites and optional ffmpeg for audio format conversion.






