openai-edge-tts  by travisvn

OpenAI-compatible API endpoint for local, free, high-quality TTS

created 9 months ago
1,027 stars

Top 37.1% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a free, OpenAI-compatible Text-to-Speech (TTS) API endpoint that leverages Microsoft Edge's TTS service. It's designed for developers and users looking for a high-quality, cost-effective alternative to services like OpenAI or ElevenLabs, offering flexibility in voice selection, audio formats, and playback speed.

How It Works

The service emulates the OpenAI TTS API's /v1/audio/speech endpoint, accepting similar request structures. It maps OpenAI's standard voices (alloy, echo, fable, onyx, nova, shimmer) to their Microsoft Edge TTS equivalents, but also allows direct specification of any available Edge TTS voice. The underlying Microsoft Edge TTS service provides the core speech generation, with the project handling API compatibility and format conversions.

Quick Start & Requirements

  • Primary install/run command: docker compose up --build (or docker run -d -p 5050:5050 --env-file .env travisvn/openai-edge-tts)
  • Prerequisites: Docker (recommended), Python (optional for local dev), ffmpeg (optional, for non-mp3 formats).
  • Setup: Requires creating a .env file for configuration.
  • Docs: OpenAI-Compatible Edge-TTS API

Highlighted Details

  • OpenAI API compatibility for /v1/audio/speech.
  • Supports multiple audio formats: mp3, opus, aac, flac, wav, pcm.
  • Adjustable playback speed from 0.25x to 4.0x.
  • Can use OpenAI voice mappings or direct Edge TTS voice names.
  • Includes endpoints for listing available models and voices.

Maintenance & Community

The project is maintained by travisvn. Contributions are welcome via pull requests.

Licensing & Compatibility

Licensed under GNU General Public License v3.0 (GPL-3.0). The acceptable use-case is intended for personal use. Enterprise or non-personal use requires contacting the maintainer.

Limitations & Caveats

The GPL-3.0 license may impose copyleft restrictions on derivative works or linked applications, potentially requiring them to also be open-sourced. The project is primarily intended for personal use.

Health Check
Last commit

1 month ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
2
Star History
280 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.