Loading preview…
Loading preview…
Convert text to speech using OpenAI's API. Includes multiple voices, speed control, and real-time playback for voiceovers and accessibility.
Loading preview…
Requirements, wiring steps, and what this pattern adds to your project.
Pick how you want to pull this pattern in — then wire env vars and routes the same way.
Install from the preview toolbar
Copy the install command above and run it in your project — Pro patterns include a short-lived token.
Add environment variables to .env.local
OPENAI_API_KEY, UPSTASH_REDIS_REST_URL, UPSTASH_REDIS_REST_TOKEN
Customize the agent and tool files
Adapt prompts, tools, and stop conditions for your product — Copy for AI in the toolbar helps seed that work.
Run your dev server and open the pattern route
Install dependencies if needed, then start the app and verify responses.
AI SDK APIs
generateSpeechProviders
app/page.tsxapp/layout.tsxREADME.mdnpm packages
10
Registry components
lib/actions.tsServer action using AI SDK experimental_generateSpeech with OpenAI tts-1-hd model. Handles text-to-speech conversion, voice selection, and returns base64-encoded audio with rate limiting.
Loading preview…

Open on desktop for the interactive preview.
Convert text to speech using OpenAI's API. Includes multiple voices, speed control, and real-time playback for voiceovers and accessibility.