base_url and your existing code works with KugelAudio’s TTS.
Why Use the Proxy?
- Drop-in replacement: Use existing ElevenLabs integrations without code changes
- SDK compatibility: Works with the official ElevenLabs Python SDK
- WebSocket streaming: Full support for real-time text streaming
- Voice mapping: Automatically maps ElevenLabs voice IDs to KugelAudio voices
Quick Start
Using Docker
Using Docker Compose
Running Locally
Configuration
| Environment Variable | Default | Description |
|---|---|---|
TTS_SERVER_WS | ws://localhost:8000/ws/tts | WebSocket URL of your KugelAudio TTS server |
TTS_SERVER_HTTP | Derived from WS URL | HTTP URL for health checks |
SUPABASE_URL | Required | Your Supabase project URL |
SUPABASE_SERVICE_KEY | Required | Supabase service role key |
Usage with ElevenLabs SDK
Python SDK
Streaming TTS
Real-time WebSocket Streaming
For LLM integration with real-time text streaming:API Endpoints
Metadata Endpoints
| Endpoint | Method | Description |
|---|---|---|
/v1/voices | GET | List all voices |
/v1/voices/{voice_id} | GET | Get single voice |
/v1/models | GET | List available models |
/v1/user | GET | Get user info |
/v1/user/subscription | GET | Get subscription info |
/v1/history | GET | Get generation history |
Text-to-Speech Endpoints
| Endpoint | Method | Description |
|---|---|---|
/v1/text-to-speech/{voice_id} | POST | Generate speech (full audio) |
/v1/text-to-speech/{voice_id}/stream | POST | Generate speech (streaming) |
/v1/text-to-speech/{voice_id}/stream-input | WebSocket | Real-time text streaming |
Health & Debug Endpoints
| Endpoint | Method | Description |
|---|---|---|
/health | GET | Proxy health check |
/tts-health | GET | TTS server health check |
/config | GET | Show current configuration |
Parameter Mapping
The proxy translates ElevenLabs parameters to KugelAudio:| ElevenLabs | KugelAudio | Notes |
|---|---|---|
voice_id | voice_id | Direct mapping |
model_id | model | eleven_turbo_v2 → kugel-1-turbo |
stability | cfg_scale | Mapped to CFG scale range |
similarity_boost | - | Not directly mapped |
output_format | sample_rate | Parsed from format string |
Output Formats
Supported output formats:| Format | Description |
|---|---|
pcm_16000 | PCM 16-bit, 16kHz |
pcm_22050 | PCM 16-bit, 22.05kHz |
pcm_24000 | PCM 16-bit, 24kHz (recommended) |
pcm_44100 | PCM 16-bit, 44.1kHz |
mp3_44100_128 | MP3, 44.1kHz, 128kbps |
ulaw_8000 | μ-law, 8kHz (telephony) |
Migrating from ElevenLabs
Step 1: Deploy the Proxy
Step 2: Update Your Code
Change only thebase_url: