Monetize your AI product faster with Lago billing engine
Speed is key
The AI landscape evolves fast. Whether you are building an AI assistant, solving the blank page problem, or personalizing user experiences at scale, every AI company is aiming at providing user value as quickly as possible. Founding engineering teams should be 100% focused on monetizing, not getting bogged down by billing nightmares.
That's where Lago, with its open-source metering and billing engine, comes in. Lago has already been chosen by leading AI companies such as Mistral, Together.ai, Groq.com, Cerebrium and BentoML.
In this article, you will learn how to build a billing system mixing pay-as-you-go and subscriptions tailored to your AI company needs.
Focus on your monetization strategy, not billing
Agility and responsiveness are essential to succeed. Lago offers a developer-friendly solution that allows for the deployment of billing infrastructure in days, not months. Teams can focus on bringing an innovative product to market while the billing complexities are taken care of. From pay-as-you-go models to subscription-based plans and everything in between, Lago offers large capabilities to suit AI companies business needs.
Throughout this guide, you will learn how to implement a hybrid billing system with subscription and usage-based pricing for your AI startup. For example, you might want to have a free plan where users pay only for their usage (eg. tokens consumed) and a paid plan where users pay for extra features on top of their usage.
This can be done in 2 simple steps:
- Meter and aggregate customer usage with a billable metric
- Set up tiered pricing plan with a free subscription and a paid subscription
Aggregate customers usage into a billable metric
Lago’s engine uses the billable metric object to meter and aggregate customer events according to specific rules. To illustrate how this can be done for your AI company, we are going to assume that the pricing includes a single metric based on the total number of tokens processed by your platform.
We use the sum aggregation type to record usage and compute the total number of tokens used. In this case, we want the consumption to start over at 0 at the beginning of the next billing cycle so we select the metered option. In our example, there is one dimension model that will impact the price of the token. This dimension will then be used to assign different prices based on the model used.
Set up tiered pricing plan with a free subscription and a paid subscription
Now we need to create two pricing plans, one free where only the usage is billed and one paid where a subscription fee is billed on top of the usage.
For the plan creation, the first step is to define the plan model, with its billing frequency and subscription fee.
Create your free plan
For our first plan, we want the customer to be billed only for the tokens consumed, which means that there is no subscription fee. To do so, we select a monthly billing period and set the subscription fee at 0.
We then select the package pricing model for the usage-based charges as we want to set a specific price for each model consumed by the user.
Create your paid plan
For the paid plan, we follow the same steps as above except we set the subscription fee at $9 and select advance as we want the subscription price to be paid at the beginning of the billing period.
Send and monitor usage in real-time
Understanding and monitoring customers' consumption is crucial for building a healthy business. Lago gives access to real-time usage data, providing a single source of truth for consumption-based metrics.
Lago is able to ingest events at scale while preventing duplicates. It will group the events received according to the billable metric code and properties - the model in our example. For each charge, the billing system will automatically compute the total token usage and corresponding total price.
This consumption and revenue information is available in the ‘Usage’ tab of the user interface. Looking ahead you can imagine embedding this information directly into your product to offer customers transparency in their usage and costs.
Going further
Lago’s billing engine is flexible and supports advanced use-cases. In this section, we’ll expand our example to learn more about:
- Allow customers to buy prepaid credits for better spend visibility
- How to offer free credits to your customers
- Implement progressive billing to maximize cash collection and reduce fraud
Implement prepaid credits for better spend visibility
Pay-as-you-go pricing offers a lot of flexibility to users. Yet, this flexibility comes at the expense of visibility and budgeting. To give customers better spend visibility you can implement prepaid credits with Lago.
Prepaid credits are standard market practices for AI companies and facilitate payment collection in advance. Users prepay for credits corresponding to their anticipated model usage.
To prepay for usage with Lago follow this simple steps:
- Create a new wallet for prepaid credits;
- Assign a value for each credit (eg. 1 credit equals 1$);
- Specify the number of credits to purchase; and
- Configure recurring top-up rules based on real-time consumption (threshold or interval top-ups)
For a complete example, you can check how to replicate Mistral’s pricing with our template.
Offer free credits to your customers
Using the same logic as prepaid credits you can give free credits to newcomers so they can try your product without friction.
Follow the same step as above, and specify how many free credits to offer when a new customer signs up.
For a complete example, you can check how to replicate BigQuery’s pricing with our template.
Implement progressive billing to maximize cash collection
Offering a free tier when launching a product for an AI company can be risky. New customers arrive in numbers and you actually know very little about them. Each model request comes with its marginal cost and AI models exposed are an attractive target for spammers.
Progressive billing allows AI companies to cap their downside. Lago offers the possibility to define a dollar threshold per customer, triggering a new invoice each time that dollar value is hit over the course of a billing cycle.
For example, you set a threshold at 3$ for new customers on the free plan. Customers will be invoiced either their 3$ threshold or their pay-as-you-go consumption at the end of the billing cycle (monthly in our example), whichever comes first.
Lago’s threshold billing opens a lot of flexibility. You can for example gradually increase the threshold as you get to know customers better (eg. 3$ for the first step, 7$ for the following one etc). This gives your AI company the change to maximize its growth while minimizing risks and model costs.
Wrap-up
Launching and monetizing your AI product requires 100% focus. To put all chances on your side, billing should not be on your mind nor slowing down your product development.
With Lago, you can create a production-grade and tailored billing system that meets your needs and allows you to concentrate on what matters most: building a product users want and love.
Give it a try, click here to get started!
Two hosting options, same benefits
Whether you choose the cloud version or decide to host the solution yourself, you will benefit from our powerful API and user-friendly interface.
Lago Premium
The optimal solution for teams with control and flexibility.
Lago Open Source
The optimal solution for small projects.