Synthesize speech from text using swappable backends — browser-native (zero cost) or OpenAI TTS API.
Default: BrowserTTSManager — uses the browser's built-in Web Speech API, requires no API key, runs entirely client-side.
BrowserTTSManager
Optional: OpenAITTSManager — uses OpenAI's TTS API for higher-quality voices (alloy, echo, fable, onyx, nova, shimmer). Requires openai package and API key.
OpenAITTSManager
openai
| Endpoint | Method | Description |
|----------|--------|-------------|
| /api/tts/voices | GET | List available voices |
/api/tts/voices
| /api/tts/synthesize | POST | Synthesize speech from text |
/api/tts/synthesize