System Design
LiteLLM is the API gateway for model requests. A Next.js platform manages users, balances, API keys, and orchestration. API calls cover real-time interactions. Webhooks report usage asynchronously. Caching covers frequent gateway data. A daily settlement job repairs missed webhooks, and a parallel pipeline reconciles large log volumes. Supabase PostgreSQL stores data and runs a custom background queue on Vercel.