Categories
self-hosted usage-metering usage-based-billing entitlements monetization billing-infrastructure ai-productsStars
Forks
Watchers
Developer links
OpenMeter
AI and API products live or die by usage, and OpenMeter is the open-source stack that measures it, rations it, and bills for it. Your application emits CloudEvents for every billable action; OpenMeter validates and deduplicates them, then aggregates usage in real time so dashboards and enforcement checks never wait for a nightly batch. Meters slice that usage by customer, time window, or any dimension you attach, which turns raw events into answers like tokens per workspace this month. Entitlements decide who gets what: metered allowances with balances and overage, boolean switches for features like SSO, and static JSON configuration for per-customer model access. Grants top allowances up once or on a schedule, resets roll balances over each usage period, and one API call tells your app whether a customer still has access right now. On the money side, plans carry flat, per-unit, tiered, package, or dynamic prices; subscriptions, credit balances, and the invoice lifecycle run alongside, with webhooks announcing everything to your other systems. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. Apache-2.0 licensed.
Benefits
- Real-time usage, enforced live
- Usage events aggregate as they arrive, so entitlement checks answer with current balances and overages instead of yesterday's batch file, keeping expensive AI features behind live limits.
- Pricing models without rebuilds
- Versioned plans mix flat, recurring, per-unit, tiered, package, and dynamic prices with add-ons, so packaging experiments ship as configuration rather than billing-system surgery.
- Credits, grants, and prepaid flows
- One-time and recurring grants, credit balances, top-ups, and pre-purchase commitments are first-class, covering prepaid AI products and enterprise deals without spreadsheet side-channels.
- Bring your payment stack
- OpenMeter handles metering, rating, and invoicing while integrating with the payment and tax providers you already use, so it slots into existing finance workflows.
Features
- CloudEvents ingestion pipeline
- Producers send CloudEvents to the ingest API; Kafka carries them to a sink worker that validates, deduplicates, and persists usage into ClickHouse for aggregation.
- Metered entitlement balances
- Metered entitlements track usage against limits per period with resets and grant rollovers, and a single endpoint returns access, balance, usage, and overage.
- Plans and dynamic pricing
- Define versioned plans, features, and add-ons with flat, per-unit, tiered, package, or dynamic prices, then assign customer subscriptions that evolve over time.
- Invoices and credit ledgers
- The billing worker rates flat and usage-based charges, manages customer credit balances and subscription changes, and drives invoices through their full lifecycle.
- SDKs, API, and webhooks
- A REST API with JavaScript, Python, and Go SDKs plus Svix-powered webhooks connects metering and billing events to the rest of your stack.