ConfigsSep 12, 2026·3 min read

FlexPrice — Open Source Usage-Based Billing Platform

An open-source billing engine for usage-based pricing with real-time metering, credit management, and payment orchestration via Stripe.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
FlexPrice Overview
Direct install command
npx -y tokrepo@latest install c945e671-ae6a-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

FlexPrice is an open-source billing platform built for usage-based and hybrid pricing models. It handles real-time usage metering, credit and wallet management, invoice generation, and payment orchestration through Stripe. Designed for SaaS companies that charge based on consumption rather than flat subscriptions, it provides a no-code dashboard alongside a developer API.

What FlexPrice Does

  • Meters usage events in real-time with sub-second ingestion
  • Calculates charges based on configurable pricing tiers and schedules
  • Manages customer credits, wallets, and top-up workflows
  • Generates invoices and orchestrates payments via Stripe
  • Provides a no-code dashboard for pricing configuration and analytics

Architecture Overview

FlexPrice is built with Go for the backend and uses ClickHouse for high-throughput event storage and aggregation. Usage events flow through Kafka for reliable ingestion, then are aggregated by ClickHouse for real-time billing calculations. PostgreSQL stores customer and pricing configuration data, while Temporal handles long-running billing workflows like invoice generation and payment retries.

Self-Hosting & Configuration

  • Deploy with Docker Compose including all dependencies
  • Configure pricing plans through the web dashboard or API
  • Connect a Stripe account for payment processing
  • Ingest usage events via the REST API or SDK
  • Set up webhooks for billing lifecycle events

Key Features

  • Real-time usage metering with ClickHouse-backed aggregation
  • Flexible pricing models including per-unit, tiered, and volume pricing
  • Built-in credit and wallet system for prepaid balances
  • Stripe integration for payment collection and invoicing
  • No-code dashboard for business teams to manage pricing

Comparison with Similar Tools

  • Lago — Ruby-based billing; FlexPrice uses Go and ClickHouse for higher throughput
  • Stripe Billing — Managed service with vendor lock-in; FlexPrice is self-hosted and open-source
  • Orb — Cloud-only usage billing; FlexPrice can run on your infrastructure
  • Metronome — Enterprise usage billing; FlexPrice is open-source with a similar feature set

FAQ

Q: What payment providers are supported? A: Stripe is the primary integration. Additional providers can be added through the payment adapter interface.

Q: How does it handle high event volumes? A: Usage events are ingested through Kafka and stored in ClickHouse, which handles millions of events per second.

Q: Can I use it for subscription-only billing? A: Yes. FlexPrice supports pure subscription, pure usage, and hybrid billing models.

Q: Is there a hosted version? A: FlexPrice offers a managed cloud option alongside the self-hosted open-source version.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets