60850d975e52a548e96647dd1d74244da49e5079
piper-openai-proxy
OpenAI-compatible TTS API proxy for Piper via the Wyoming protocol.
Any tool that speaks the OpenAI /v1/audio/speech API can use your local Piper instance without modification.
Usage
python3 server.py
Environment variables:
PIPER_HOST— Piper Wyoming host (default:192.168.86.11)PIPER_PORT— Piper Wyoming port (default:10200)LISTEN_PORT— Proxy listen port (default:8951)
API
# Generate speech
curl -X POST http://localhost:8951/v1/audio/speech \
-H "Content-Type: application/json" \
-d '{"input": "Hello world"}' \
-o speech.wav
# Health check
curl http://localhost:8951/health
Requirements
- Python 3.8+
- No dependencies (stdlib only)
- A running Piper Wyoming server
How it works
The proxy translates OpenAI TTS API requests into Wyoming protocol messages over a raw TCP socket. Piper generates the audio, and the proxy wraps the raw PCM in a WAV container and returns it.
License
MIT
Description
Languages
Python
100%