diff --git a/scripts/seed.ts b/scripts/seed.ts index 56ae952..8ce2442 100644 --- a/scripts/seed.ts +++ b/scripts/seed.ts @@ -25,43 +25,47 @@ async function main() { try { const now = new Date(); + // Remove legacy free plan + await db.collection("subscription_plans").deleteOne({ name: "free" }); + await db.collection("subscription_plans").deleteOne({ name: "enterprise" }); + const plans = [ - { - name: "free", - displayName: "Free", - description: "Get started with basic access", - monthlyPriceCents: 0, - dailyRequestLimit: 100, - dailyTokenLimit: 100000, - requestLimitPerMonth: 3000, - tokenLimitPerMonth: 3000000, - maxApiKeys: 2, - sortOrder: 0, - isPublic: true, - }, { name: "pro", displayName: "Pro", description: "For developers and small teams", - monthlyPriceCents: 2900, - dailyRequestLimit: 5000, - dailyTokenLimit: 2000000, - requestLimitPerMonth: 150000, - tokenLimitPerMonth: 60000000, - maxApiKeys: 10, + monthlyPriceCents: 1900, + dailyRequestLimit: null, + dailyTokenLimit: null, + requestLimitPerMonth: 50000, + tokenLimitPerMonth: 10000000, + maxApiKeys: 5, + sortOrder: 0, + isPublic: true, + }, + { + name: "max", + displayName: "Max", + description: "For teams shipping to production", + monthlyPriceCents: 4900, + dailyRequestLimit: null, + dailyTokenLimit: null, + requestLimitPerMonth: 200000, + tokenLimitPerMonth: 50000000, + maxApiKeys: 20, sortOrder: 1, isPublic: true, }, { - name: "enterprise", - displayName: "Enterprise", - description: "Unlimited access for large teams", + name: "unlimited", + displayName: "Unlimited", + description: "No limits, full control", monthlyPriceCents: 9900, dailyRequestLimit: null, dailyTokenLimit: null, requestLimitPerMonth: null, tokenLimitPerMonth: null, - maxApiKeys: 50, + maxApiKeys: 100, sortOrder: 2, isPublic: true, }, diff --git a/src/app/globals.css b/src/app/globals.css index 0ca8eda..6508eef 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -67,6 +67,32 @@ font-family: "Roboto", system-ui, sans-serif; } +/* Landing page animations */ +@keyframes mesh-1 { + 0%, 100% { transform: translate(0, 0) scale(1); } + 33% { transform: translate(80px, -50px) scale(1.1); } + 66% { transform: translate(-40px, 60px) scale(0.95); } +} +@keyframes mesh-2 { + 0%, 100% { transform: translate(0, 0) scale(1); } + 33% { transform: translate(-60px, 40px) scale(1.05); } + 66% { transform: translate(50px, -30px) scale(0.9); } +} +@keyframes mesh-3 { + 0%, 100% { transform: translate(0, 0) scale(1); } + 33% { transform: translate(40px, 30px) scale(0.95); } + 66% { transform: translate(-70px, -40px) scale(1.1); } +} +@keyframes fade-in { + from { opacity: 0; transform: translateY(4px); } + to { opacity: 1; transform: translateY(0); } +} + +.animate-mesh-1 { animation: mesh-1 20s ease-in-out infinite; } +.animate-mesh-2 { animation: mesh-2 25s ease-in-out infinite; } +.animate-mesh-3 { animation: mesh-3 22s ease-in-out infinite; } +.animate-fade-in { animation: fade-in 0.4s ease-out both; } + /* Safe area insets for PWA */ @supports (padding: env(safe-area-inset-top)) { .phone-ui { diff --git a/src/app/page.tsx b/src/app/page.tsx index f8a4adf..d8b1895 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -2,15 +2,15 @@ import Link from "next/link"; import { redirect } from "next/navigation"; import { ArrowRight, - Sparkles, Zap, Shield, BarChart3, Code2, Globe, - Menu, Check, Key, + Gauge, + Layers, } from "lucide-react"; import { getSession } from "@/lib/auth-helpers"; import { Button } from "@/components/ui/button"; @@ -22,357 +22,389 @@ import { PerplexityLogo, ElevenLabsLogo, } from "@/components/provider-logos"; +import { CountUp } from "@/components/landing/counter"; +import { AnimatedCodeBlock } from "@/components/landing/code-block"; const providers = [ - { name: "OpenAI", models: "GPT-4.1, GPT-4o, o3, o4-mini", Logo: OpenAILogo }, - { name: "Anthropic", models: "Claude Opus, Sonnet, Haiku", Logo: AnthropicLogo }, - { name: "xAI", models: "Grok 3, Grok 3 Mini", Logo: XAILogo }, - { name: "DeepSeek", models: "V3, R1", Logo: DeepSeekLogo }, - { name: "Perplexity", models: "Sonar Pro, Sonar", Logo: PerplexityLogo }, - { name: "ElevenLabs", models: "Text-to-Speech, Voice AI", Logo: ElevenLabsLogo }, + { name: "OpenAI", Logo: OpenAILogo }, + { name: "Anthropic", Logo: AnthropicLogo }, + { name: "xAI", Logo: XAILogo }, + { name: "DeepSeek", Logo: DeepSeekLogo }, + { name: "Perplexity", Logo: PerplexityLogo }, + { name: "ElevenLabs", Logo: ElevenLabsLogo }, ]; -const highlights = [ +const features = [ { icon: Globe, - title: "Multi-Provider", - desc: "OpenAI, Anthropic, Grok, DeepSeek, Perplexity — all through one endpoint.", + title: "Multi-Provider Access", + desc: "OpenAI, Anthropic, Grok, DeepSeek, Perplexity & ElevenLabs — all through one endpoint.", + span: "sm:col-span-2", + }, + { + icon: Zap, + title: "Smart Routing & Fallback", + desc: "Automatic failover between providers. Zero downtime, zero manual switching.", + span: "", }, { icon: BarChart3, - title: "Usage Analytics", - desc: "Track tokens, costs, and latency across every provider in real time.", + title: "Usage Analytics & Cost Tracking", + desc: "Track tokens, costs, and latency across every provider and model in real time.", + span: "", }, { icon: Key, title: "API Key Management", desc: "Scoped keys with labels, per-key cost caps, and environment controls.", + span: "", }, { icon: Shield, - title: "Rate Limiting", + title: "Rate Limiting & Quotas", desc: "Per-key and per-user rate limits to protect your budget and infrastructure.", + span: "", }, { icon: Code2, - title: "Drop-in Compatible", - desc: "Works with any OpenAI SDK. Change the base URL and you're done.", - }, - { - icon: Zap, - title: "Smart Routing", - desc: "Automatic provider fallbacks. No downtime, no manual switching.", + title: "OpenAI SDK Compatible", + desc: "Works with any OpenAI SDK or HTTP client. Change the base URL and you're done.", + span: "sm:col-span-2", }, ]; const plans = [ - { - name: "Free", - price: "$0", - period: "forever", - desc: "Get started with generous limits", - features: [ - "1,000 requests/day", - "All providers & models", - "1 API key", - "Basic analytics", - "Community support", - ], - cta: "Get Started Free", - href: "/register", - highlighted: false, - }, { name: "Pro", - price: "$9.99", + price: "$19", period: "/month", desc: "For developers and small teams", features: [ - "50,000 requests/day", - "All providers & models", - "10 API keys", + "50,000 requests/month", + "10M tokens/month", + "5 API keys", + "All standard models", + "Usage analytics", + "Email support", + ], + cta: "Get Started", + highlighted: false, + }, + { + name: "Max", + price: "$49", + period: "/month", + desc: "For teams shipping to production", + badge: "Most Popular", + features: [ + "200,000 requests/month", + "50M tokens/month", + "20 API keys", + "All models incl. premium", + "Priority routing & auto-fallback", "Advanced analytics", "Priority support", - "Custom rate limits", ], - cta: "Start Pro Trial", - href: "/register", + cta: "Get Started", highlighted: true, }, { name: "Unlimited", - price: "$49.99", + price: "$99", period: "/month", - desc: "For production workloads", + desc: "No limits, full control", features: [ "Unlimited requests", - "All providers & models", - "Unlimited API keys", - "Full analytics & exports", + "Unlimited tokens", + "100 API keys", + "All models, all providers", + "Priority routing & smart fallback", + "Real-time analytics dashboard", "Dedicated support", - "Custom rate limits", - "GDPR log controls", + "Custom model aliases", + "Webhook notifications", ], - cta: "Go Unlimited", - href: "/register", + cta: "Get Started", highlighted: false, }, ]; +const steps = [ + { num: "1", title: "Sign up & get your API key", desc: "Create an account and generate your first key in seconds." }, + { num: "2", title: "Use it like OpenAI's API", desc: "Point any OpenAI SDK at our endpoint. Same interface, more models." }, + { num: "3", title: "We route to the best provider", desc: "Automatic model resolution, failover, and load balancing." }, +]; + export default async function Home() { const session = await getSession(); if (session?.user) redirect("/chat"); return ( -
- {/* Background glow */} -
-
-
+
+ {/* Animated gradient mesh background */} +
+
+
+
-
- {/* Nav */} -
); diff --git a/src/app/pricing/page.tsx b/src/app/pricing/page.tsx index 66885c4..7a27315 100644 --- a/src/app/pricing/page.tsx +++ b/src/app/pricing/page.tsx @@ -1,181 +1,173 @@ "use client"; import Link from "next/link"; -import { useEffect, useState } from "react"; -import { ArrowRight, Check, Sparkles } from "lucide-react"; +import { ArrowRight, Check, Layers } from "lucide-react"; import { Button } from "@/components/ui/button"; -interface Plan { - id: string; - name: string; - displayName: string; - description?: string; - monthlyPriceCents: number; - requestLimitPerMonth?: number | null; - tokenLimitPerMonth?: number | null; - dailyRequestLimit?: number | null; - dailyTokenLimit?: number | null; - maxApiKeys: number; - features?: Record; -} - -function formatNumber(n: number): string { - if (n >= 1_000_000) return `${(n / 1_000_000).toFixed(n % 1_000_000 === 0 ? 0 : 1)}M`; - if (n >= 1_000) return `${(n / 1_000).toFixed(n % 1_000 === 0 ? 0 : 1)}K`; - return n.toLocaleString(); -} - -function formatPrice(cents: number): string { - if (cents === 0) return "Free"; - const dollars = cents / 100; - return `$${dollars % 1 === 0 ? dollars.toFixed(0) : dollars.toFixed(2)}`; -} +const plans = [ + { + name: "Pro", + price: "$19", + period: "/month", + desc: "For developers and small teams", + features: [ + "50,000 requests/month", + "10M tokens/month", + "5 API keys", + "All standard models (GPT-4.1, Claude Sonnet, DeepSeek, etc.)", + "Usage analytics", + "Email support", + ], + highlighted: false, + }, + { + name: "Max", + price: "$49", + period: "/month", + desc: "For teams shipping to production", + badge: "Most Popular", + features: [ + "200,000 requests/month", + "50M tokens/month", + "20 API keys", + "All models including premium (GPT-5, Claude Opus, o3)", + "Priority routing & auto-fallback", + "Advanced analytics", + "Priority support", + ], + highlighted: true, + }, + { + name: "Unlimited", + price: "$99", + period: "/month", + desc: "No limits, full control", + features: [ + "Unlimited requests", + "Unlimited tokens", + "100 API keys", + "All models, all providers", + "Priority routing & smart fallback", + "Real-time analytics dashboard", + "Dedicated support", + "Custom model aliases", + "Webhook notifications", + ], + highlighted: false, + }, +]; export default function PricingPage() { - const [plans, setPlans] = useState([]); - const [loading, setLoading] = useState(true); - - useEffect(() => { - fetch("/api/plans") - .then((r) => r.json()) - .then((d) => setPlans(d.data ?? [])) - .catch(() => {}) - .finally(() => setLoading(false)); - }, []); - return ( -
-
-
-
+
+
+
+
-
+
{/* Nav */} -
); diff --git a/src/components/landing/code-block.tsx b/src/components/landing/code-block.tsx new file mode 100644 index 0000000..5ea0de0 --- /dev/null +++ b/src/components/landing/code-block.tsx @@ -0,0 +1,82 @@ +"use client"; + +import { useEffect, useState } from "react"; + +const lines = [ + { text: "curl https://llm.xmr.network/v1/chat/completions \\", delay: 0 }, + { text: ' -H "Authorization: Bearer sk-your-key" \\', delay: 600 }, + { text: ' -H "Content-Type: application/json" \\', delay: 1000 }, + { text: " -d '{", delay: 1400 }, + { text: ' "model": "gpt-5",', delay: 1800 }, + { text: ' "messages": [{"role": "user", "content": "Hello!"}]', delay: 2200 }, + { text: " }'", delay: 2600 }, +]; + +export function AnimatedCodeBlock() { + const [visible, setVisible] = useState(0); + + useEffect(() => { + const timers = lines.map((l, i) => + setTimeout(() => setVisible(i + 1), l.delay + 500), + ); + return () => timers.forEach(clearTimeout); + }, []); + + return ( +
+
+
+
+
+ terminal +
+
+        
+          {lines.slice(0, visible).map((line, i) => (
+            
+ {i === 0 && $ } + {line.text.includes('"model"') ? ( + <> + {" "} + "model" + : + "gpt-5" + , + + ) : line.text.includes('"messages"') ? ( + <> + {" "} + "messages" + {': [{"role": "user", "content": "Hello!"}]'} + + ) : line.text.includes("Authorization") ? ( + <> + {" -H "} + "Authorization: Bearer sk-your-key" + \ + + ) : line.text.includes("Content-Type") ? ( + <> + {" -H "} + "Content-Type: application/json" + \ + + ) : line.text.startsWith("curl") ? ( + <> + curl + https://llm.xmr.network/v1/chat/completions + \ + + ) : ( + {line.text} + )} +
+ ))} + {visible < lines.length && ( + + )} +
+
+
+ ); +} diff --git a/src/components/landing/counter.tsx b/src/components/landing/counter.tsx new file mode 100644 index 0000000..76d873c --- /dev/null +++ b/src/components/landing/counter.tsx @@ -0,0 +1,36 @@ +"use client"; + +import { useEffect, useRef, useState } from "react"; + +export function CountUp({ end, suffix = "", prefix = "", duration = 2000 }: { end: number; suffix?: string; prefix?: string; duration?: number }) { + const [value, setValue] = useState(0); + const ref = useRef(null); + const started = useRef(false); + + useEffect(() => { + const observer = new IntersectionObserver( + ([entry]) => { + if (entry.isIntersecting && !started.current) { + started.current = true; + const start = performance.now(); + const step = (now: number) => { + const progress = Math.min((now - start) / duration, 1); + const eased = 1 - Math.pow(1 - progress, 3); + setValue(Math.floor(eased * end)); + if (progress < 1) requestAnimationFrame(step); + }; + requestAnimationFrame(step); + } + }, + { threshold: 0.3 }, + ); + if (ref.current) observer.observe(ref.current); + return () => observer.disconnect(); + }, [end, duration]); + + return ( + + {prefix}{value}{suffix} + + ); +}