TTS2Go Documentation
TTS2Go is managed TTS infrastructure for websites. Instead of building an audio generation pipeline, storage layer, CDN, and abuse prevention system, you install an SDK and let TTS2Go handle everything. Audio is generated on-demand via ElevenLabs, verified by AI, and cached permanently on a global CDN.
How it works
- Install the SDK —
npm install @tts2go/react(or your framework's package). - Create a project — sign up and create a project in the dashboard to get your project ID.
- Generate an API key — create an API key scoped to your project.
- Add TTS2GoProvider — wrap your app with the provider, passing your API key and project ID.
- Add TTS to your UI — use
TTSButtonfor a drop-in solution, or theuseTTShook to build a fully custom play button. - CDN-first with browser fallback — when a user clicks play, the SDK tries to play cached audio from the CDN. If the audio hasn't been generated yet, the SDK falls back to the browser's built-in TTS for immediate playback while sending a generation request to TTS2Go in the background.
- Approve and cache — the request appears in your project dashboard. Approve it manually or let AI auto-approve it. TTS2Go generates studio-quality audio via ElevenLabs in your configured voice, then caches it on a global CDN. Every subsequent play of that same content is served instantly from the CDN.
Why TTS2Go?
TTS2Go is a high-quality lazy caching solution for AI text-to-speech. Instead of pre-generating audio for your entire site, audio is generated on-demand when real users actually request it. The first user hears browser TTS instantly while ElevenLabs audio is generated in the background. Every subsequent request is served from a global CDN — fast, high-quality, and cost-efficient. You never pay for content nobody listens to.
Quick links
- Quick Start Guide — get up and running in 5 minutes
- Pricing — free tier included
- Sign Up — create your account
SDK Packages
Vanilla JS
@tts2go/vanilla|npm →Framework-agnostic class with event callbacks. Works with script tags.
Core concepts
API Keys
Each API key is scoped to a project and can have its own rate limits, allowed domains, and voice restrictions. Keys use the tts_ prefix and are stored as SHA-256 hashes on the server.
CDN Caching
Generated audio is uploaded to a CDN (Cloudflare R2). The URL is deterministic based on the content, project ID, and voice ID, so identical requests always resolve to the same cached file.
Content Verification
TTS2Go uses AI to verify that generation requests contain content consistent with your website. Define content profiles describing your site, and the AI auto-approves matching requests while flagging suspicious ones. This lets you safely expose API keys in client-side code. For sites with dynamic or user-generated content where AI scoring is unreliable, switch to manual approval — review and bulk-approve pending requests from the dashboard.
Browser Fallback
When a user clicks play, the SDK first attempts to play audio from the CDN. If the audio exists (previously generated and cached), it plays immediately in high quality. If not, the SDK falls back to browser-native speech synthesis for immediate playback and sends a generation request to TTS2Go in the background. Once approved, TTS2Go generates studio-quality audio via ElevenLabs and caches it on the CDN. All future plays of that content are served instantly from the CDN — no browser fallback needed.