Introduction
Lark is a flexible billing platform that helps you define your pricing models, handle credits, track usage, and manage feature access for your customers. Whether you’re building a traditional SaaS product or an AI powered API service, Lark provides the tools you need to implement complex billing logic without the complexity.Just show me the code
Follow our three-step quickstart guide to get started.
I want to try it out
Define your rate cards in our playground and test it with our billing simulator.
Core Concepts
Lark models your billing integration using a few key domains that work together to create flexible pricing structures.Quantity and Usage Events
You always bill your customers for a certain quantity of something (seats, API calls, LLM tokens, etc.). This quantity can either be specified directly upfront or inferred from usage events. If you bill your customers based on how much they use your product, usage events help you track their activity. A usage event is a simple JSON object representing customer usage activity. It must have anevent_name
field and can include additional key-value pairs for filtering when defining prices.
Pricing Metric
A pricing metric defines how you aggregate usage events over a service period that gets billed to your customer. For example, you can choose to sum all usage events for a givenevent_name
and bill on that total. You can also define pricing metrics using custom SQL for more complex aggregation logic.
Price
A price defines how you convert a quantity into an amount. For example, if you have a simple fee of $1, a quantity of 10 will translate into a total price of $10. Lark supports flat fee, tiered, and package prices. Prices can also be defined in custom units (relevant if you use custom credits).Credits
Credits can be granted to customers to offset their future bills. Credits can be defined in monetary or custom units. These can be used as part of your core rate card or as part of promotional campaigns / customer incentives.Rates
A rate is an abstraction over price, credits, and pricing metrics. It defines how your customer gets charged for specific things. Rates can either be fixed or usage-based.- Fixed rates are charged upfront in a billing cycle. You can optionally specify benefits like credit grants. For example, a $20 per month license rate might give a customer 20,000 monthly credits.
- Usage-based rates are charged in arrears and are attached to a pricing metric. The pricing metric determines the quantity that needs to be billed. You can also specify an included quantity for usage rates—usage after the included quantity is priced.