A FastAPI-based service for local, high-speed neural text-to-speech synthesis. Supports Piper and Kokoro backends.
tts_preview.mov # Install system requirements
sudo apt install ffmpeg
# Install python dependencies
python3 src/setup.py
source src/tts-venv/bin/activateStart the service:
Python Example:
import requests # Generate speech with an API key response = requests .post (
"http://localhost:47100/api/tts" ,
headers = {"X-API-Key" : "secret-key" },
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/ttsSynthesize speech from a JSON body GET /api/ttsSynthesize speech from query params POST /api/tts_batchSynthesize and concatenate multiple text and SFX parts GET /api/voicesList available voices POST /api/reloadReload voices from disk (admin) GET /api/healthzHealth check GET /api/metricsSynthesis metrics
Method Path Description GET /api/aliasesList voice aliases (admin) POST /api/aliasesCreate or update a voice alias (admin) DELETE /api/aliases/{name}Delete a voice alias (admin)
Method Path Description GET /api/soundsList sound effects and aliases POST /api/sfx_aliasesCreate or update an SFX alias (admin) DELETE /api/sfx_aliases/{name}Delete an SFX alias (admin)
Method Path Description POST /api/pushQueue a TTS request GET /api/pullPull and remove the next queued item GET /api/peekView the next queued item without removing it (mod) DELETE /api/queue/{qid}Remove a queued item by id (mod)
Method Path Description POST /api/panel/loginLog in with a role key POST /api/panel/logoutClear the session GET /api/panel/statusGet current session roles GET /api/auth/loginStart OAuth login with a provider GET /api/auth/callbackOAuth provider redirect callback GET /api/auth/meGet the OAuth identity in the session GET /api/auth/mappingsList OAuth-to-role mappings (admin) POST /api/auth/mappingMap an OAuth account to a role (admin) DELETE /api/auth/mapping/{provider}/{remote}Delete an OAuth mapping (admin)
Method Path Description GET /api/overlayServe the overlay page, optionally for an embed POST /api/overlay/tokenMint an overlay access token (admin) GET /api/overlay/tokensList overlay tokens (admin) DELETE /api/overlay/token/{jti}Revoke an overlay token (admin) POST /api/overlay/embedCreate an overlay embed (admin) GET /api/overlay/embedsList overlay embeds (admin) DELETE /api/overlay/embed/{embed_id}Delete an overlay embed (admin)
Method Path Description POST /api/mod/maskMask URLs, emojis, and slurs in text GET /api/mod/listList moderation terms (mod) POST /api/mod/addAdd a moderation term (mod) POST /api/mod/removeRemove a moderation term (mod) POST /api/mod/reloadReload moderation terms (mod) GET /api/mod/modeGet the current censor mode (mod) POST /api/mod/modeSet the censor mode (mod) GET /api/mod/testTest moderation on a string (mod)