Production-ready multi-tenant TTS SaaS. Convert scripts into AI-generated audio via 5 providers, credit-based billing, async synthesis with webhooks, and a guest demo — all from a polished Next.js frontend. Built solo in ~1 month.
Async Python backend (FastAPI + SQLAlchemy async), Next.js frontend, Celery for background jobs, credit-based billing with two payment processors (card + crypto), passwordless OTP login, and a full admin panel. Same API endpoints work from the browser via cookie and from automation via Bearer token.
Guests can try synthesis without registration. Registered users get 5,000 credits and access to all providers. Users with personal API keys bypass billing entirely.
transaction_id → poll or get notified on completion. Webhook delivery with retry: exponential backoff, 3 attempts, failure recovery.
.mp3 files — one per scene. Designed for long-form narration and audiobook production.TextSplitter for texts exceeding provider limits.| Role | Access |
|---|---|
| guest | No registration. Unicorn only, max 500 chars, 5 requests/day per IP. |
| user | Registered. Credit-based. Access to all providers. |
| paid | Same as user, paid subscription status. |
| admin | Full access, zero cost, admin panel. |
text_length × provider.cost_multiplier. Admins and own-key users pay 0. SELECT FOR UPDATE on the balance row prevents race conditions. Credits auto-refunded on failed generation. Credits expire after 365 days of inactivity.ozv-XXXX API token. Auth supports both session cookie (browser) and Authorization: Bearer header (automation) — identical endpoints, identical logic. Rate limiting: 5 guest req/day per IP · 20 authenticated req/min.is_deleted flag before physical removal.preferences column. UI restores full state on page load.Passwordless login via OTP. All third-party keys encrypted. Login history tracked per session.
ozv- prefix eliminates token ambiguity. Same endpoints handle both auth methods.is_blocked flag for instant suspension without deletion.FastAPI + SQLAlchemy async + asyncpg — no sync shortcuts. Traefik handles SSL automatically. Alembic runs migrations on every deploy. Celery Beat for scheduled cleanup and credit expiration.