A FastAPI-based service for local, high-speed neural text-to-speech synthesis. Supports Piper and Kokoro backends.
demo.mp4
# Install system requirements
sudo apt install ffmpeg
# Install python dependencies
python3 setup.py
source tts-venv/bin/activateStart the service:
python src/app.pyPython Example:
import requests
# Generate speech
response = requests.post(
"http://localhost:47100/api/tts",
json={
"text": "Hello! {airhorn} Welcome.",
"voice": "en_US-ryan-high"
}
)
# Save the audio output
with open("speech.mp3", "wb") as f:
f.write(response.content)All routes are served under the /api prefix.
| Method | Path | Description |
|---|---|---|
| POST | /api/tts |
Synthesize speech from text, or from parts to concatenate text and SFX |
| GET | /api/sounds |
List sound effects and aliases |
| GET | /sounds/{file} |
Serve a sound file, mounted outside the /api prefix |
| Method | Path | Description |
|---|---|---|
| GET | /api/health |
Backends, loaded voices, ffmpeg and cache stats |
| Method | Path | Description |
|---|---|---|
| GET | /api/catalog |
Voices, aliases, profiles and sounds in one payload |
| POST | /api/catalog/reload |
Rescan voices and sounds and reread the blocklist |
| PUT | /api/catalog/{kind}/{name} |
Create or update a voice_alias, profile or sfx_alias |
| DELETE | /api/catalog/{kind}/{name} |
Delete a voice_alias, profile or sfx_alias |
| Method | Path | Description |
|---|---|---|
| GET | /api/mod |
Moderation terms, mode and censoring |
| POST | /api/mod |
Set mode or censoring, add or remove terms, reload |