import React, { useState, useEffect } from 'react'; import { Check, Loader2, Zap, Cpu, KeyRound, Send, HardDrive, Bot } from 'lucide-react'; import { useAuth } from '../contexts/AuthContext'; import { apiJson } from '../lib/api'; import { track } from '../lib/analytics'; import SegmentedControl from './ui/SegmentedControl'; const PLAN_ORDER = ['starter', 'creator', 'pro']; const PLAN_BLURB = { starter: 'For getting started', creator: 'For regular creators', pro: 'For power users & teams', }; const HIGHLIGHT = 'creator'; const FREE_MINUTES = 20; const fmt = (amount, currency) => new Intl.NumberFormat('en-US', { style: 'currency', currency: (currency || 'usd').toUpperCase(), maximumFractionDigits: 0 }).format((amount || 0) / 100); // Free tier + 3 paid tiers with monthly/annual toggle. Checkout requires sign-in. export default function PricingSection({ onRequireLogin }) { const { isSignedIn } = useAuth(); const [plans, setPlans] = useState([]); const [interval, setInterval] = useState('month'); const [loading, setLoading] = useState(true); const [busyPrice, setBusyPrice] = useState(null); useEffect(() => { apiJson('/api/billing/plans') .then((d) => setPlans(d.plans || [])) .catch(() => setPlans([])) .finally(() => setLoading(false)); }, []); const checkout = async (entry) => { if (!isSignedIn) { onRequireLogin?.(entry.price_id); return; } setBusyPrice(entry.price_id); // `source` segments this surface from the two modals (see TopUpModal), which // now emit the same three events. const props = { plan: entry.plan, interval: entry.interval, source: 'pricing' }; track('CheckoutStarted', { props }); // Stash the price so we can attach real revenue to the Subscribed goal when // the user returns from Stripe (see AccountPage's checkout=success handler). try { localStorage.setItem('os_pending_checkout', JSON.stringify({ plan: entry.plan, interval: entry.interval, amount: entry.amount, currency: entry.currency, })); } catch (_) { /* ignore storage errors */ } try { const { url } = await apiJson('/api/billing/checkout', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ price_id: entry.price_id }), }); track('CheckoutRedirected', { props }); window.location.href = url; } catch (e) { track('CheckoutFailed', { props: { ...props, reason: String(e?.detail || e?.message || 'unknown').slice(0, 120) } }); setBusyPrice(null); alert(e?.detail || 'Could not start checkout. Please try again.'); } }; if (loading) { return
Try it on your own videos
free minutes reset monthly.
{PLAN_BLURB[plan]}
billed {interval === 'month' ? 'monthly' : 'yearly'}. cancel anytime.
Your monthly minutes cover video processing. Titles & descriptions are free; AI thumbnail image generation uses ~3 min of your quota per batch.
AI Shorts (AI-actor UGC videos) and voice dubbing use premium generation from fal.ai and ElevenLabs. Connect your own keys for those — you're billed by those providers directly (typically ~$0.65-2 per video). Your plan still covers the script & orchestration.
Managed credits for these are coming later — no keys needed.
start free right here, upgrade for more minutes and no watermark, or run it yourself on your own hardware.