ripe-arm-36009
08/27/2025, 3:29 AMtall-airline-16756
08/27/2025, 3:29 AMtall-airline-16756
08/27/2025, 3:30 AM/v1/audio/speech POST requests with similar JSON parameters), you can actually use the OpenAI TTS plugin in LiveKit by pointing the base_url to your Coqui TTS server.
Here’s a quick example of what that configuration might look like:
tts=openai.TTS(
model="your-coqui-model-name",
voice="your-voice-id",
api_key="not-needed", # if no auth is required
base_url="http://localhost:5002/v1", # or wherever Coqui is hosted
response_format="wav"
)
Another option is to build a custom LiveKit TTS plugin by subclassing the TTS abstract class and implementing the necessary methods to work directly with Coqui TTS’s API. This way, you get more control and can even enable features like streaming.
If you’d like, I’m happy to help you get started—whether that’s creating a simple wrapper API to make Coqui TTS OpenAI-compatible or scaffolding a custom LiveKit TTS plugin. Just let me know!
Sources: Text-to-speech (TTS) integrations | LiveKit Docs | examples/other/kokoro_tts.py