Set up your own text to speech app
/voice
folder.
app/api/(apps)/voice/*
Key API routes:
app/api/(apps)/voice/models/route.ts
: Fetches available ElevenLabs models.app/api/(apps)/voice/voices/route.ts
: Fetches available ElevenLabs voices.app/api/(apps)/voice/text-to-speech/route.ts
: Generates speech from text using ElevenLabs, stores data in Supabase and reduces credits for the user.app/api/(apps)/voice/route/route.ts
: Uploads to Cloudflare R2./app/(apps)/voice/*
Contains all front-end logic, including paywall checks and dynamic pages.
/components/voice/*
Contains all front-end components unique to the text-to-speech app.
toolConfig.ts
) per generation.