Status: [UNTESTED] Endpoints found: http://localhost:5000/api/v1/chat/completions Source: https://github.com/YashwanthReddyPuli/MeterPrompt # MeterPrompt — AI Gateway & SaaS Metered Billing Platform **MeterPrompt** is an OpenRouter-style AI reverse-proxy gateway and SaaS metered billing platform. It offers unified model routing, real-time token tracking, cryptographic API key authentication, and an enterprise billing engine with automated mid-cycle proration adjustments. --- ## 🌟 Key Architectural Highlights - **OpenAI-Compatible AI Proxy Gateway (`/api/v1/chat/completions`):** - High-throughput routing for top-tier LLMs (`gpt-4o`, `claude-3-5-sonnet`, `deepseek-r1`, `gpt-4o-mini`). - Supports both **Live AI Provider Mode** (OpenAI API key passthrough) and **Mock Provider Engine** for offline development & load testing. - **Granular Metered Usage & Token Quota Engine:** - Real-time token consumption calculation (prompt + completion tokens). - Monthly quota enforcement per subscription tier with zero-margin overage billing automatically deducted from user credit balance. - **Enterprise Multi-Tier Subscription & Proration Engine:** - **3 Core Tiers:** Starter ($19.99/mo), Pro ($49.99/mo), Max ($199.99/mo). - **Tenure Flexibility:** Supports Monthly & Annual billing cycles (20% discount on yearly plans). - **Cycle-Aware Mid-Cycle Proration:** Automatic calculation of unused plan value credit when upgrading or downgrading between tiers mid-month. - **Cryptographic Key Security & RBAC:** - Secure API keys (`mp_live_...`) with one-way SHA-256 database hashing. - JWT session authentication and Role-Based Access Control (Developer vs. Billing Admin). - **Modern Developer Console & Billing UI:** - **Collapsible Left-Edge Hover Drawer Navigation.** - **OpenRouter-Style Generation Logs** with latency metrics and token count breakdowns. - **Animated Receipt Modal** with interactive confetti card feedback. - **Client-Side PDF Invoice Generation** for instant download and printing. --- ## 🛠️ Tech Stack Matrix | Layer | Technology | | :--- | :--- | | **Frontend UI** | Rea