Multi-Provider Text-to-Speech Service
One speech API for the whole org, sitting on top of five providers with full and streaming synthesis.
- Client
- Internal platform capability
- Role
- Design & implementation
- Year
- 2026
- Stack
- Node.js, TypeScript, OpenAI
Context
A few teams wanted text-to-speech, and every provider has its own SDK, quirks, and trade-offs in voice quality, latency, and cost. Wiring providers in directly would have spread that mess across every project.
So I built a shared service that gives teams speech through one consistent interface.
Approach
The service wraps five providers (OpenAI, Google Cloud, AWS Polly, ElevenLabs, and Deepgram) behind a single API, so switching provider is a config change rather than a rewrite.
It handles both full synthesis, where you generate the whole clip, and low-latency streaming, where playback starts while the audio is still being generated. That covers both batch and real-time use.
Key decisions
Normalise every provider down to one interface so callers never depend on a specific vendor's SDK.
Treat streaming as a first-class mode, not an add-on, so latency-sensitive features feel responsive.
Outcome
A reusable capability any team can pick up without learning five different APIs, and swap providers freely as their quality, latency, or cost needs change.
Built with