How to Understand Revenue and Cost of API Usage in Moesif
Overview
In this guide, you’ll learn how to use Moesif’s reporting-only Billing Meter and Billing Report Metrics to dig deep into your API usage and associated revenue.
Objectives
- Use Product Catalog to define products and prices that define your usage-based revenue model.
- Set up a reporting-only Billing Meter that tracks, meters, and reports API usage and the corresponding revenue.
- Use Billing Report Metrics to analyze and visualize usage-based revenue for your
existing billing meters.
- Filter and segment revenue metrics by billing meter, provider, currency, subscription, and more.
- Choose the metric you want the Billing Report Metrics to plot, such as the metric values your meters track usage of and credit balance in pre-paid systems.
Background
Moesif supports setting up billing meters that only report usage but don’t charge your customers for the usage. This allows you to leverage Moesif’s robust API usage metering system to monitor your API consumption, while giving you the maximum flexibility for the billing system you choose to charge your customers. You can roll out your own custom billing solution that accurately charges your customers based on the metering data Moesif collects. You also have the option to use existing billing providers like Stripe through Moesif’s integrations with them.
Before You Start
Make sure you have an active Moesif account.
Set Up a Reporting-Only Billing Meter
To set up a reporting-only Billing Meter, select Billing Meters menu item in the navigation menu and then select + Add Billing Meter. Alternatively, select + Create New in the navigation menu and then select Billing Meter from the API Monetization section.
Then follow these steps:
Step 1: Select Custom Billing Provider
In the new Billing Meters screen, enter a name for your Billing Meter and select Custom as the billing provider. Do not select any webhooks.
Step 2: Specify Plan and Price Details
Select a Plan that Moesif attributes the usage to and the Price that Moesif meters according to. You can select from the available plans and prices, or select Add New Plan or Add New Price to create new ones.
Selecting Add New Plan presents a dialog where you need to fill out the plan details. For more information, see Select or Create a Billing Plan.
Selecting Add New Price brings you to the Product Catalog Prices screen. For more information, see Creating a Price.
In this tutorial, we define a plan and price for an esignature API. Subscribers of the plan pay US$3 for each 1000 units of service. For an esignature API, unit translates to API requests. Therefore, we want to meter and rate for each API request the API receives. In the later steps when we define the billing meter for metering API usage, we’ll more concretely define the exact metric we want to charge customers for.
Here we create a plan “E-sign requests” and define a price for this plan “Pro E-Sign API”


Step 3: Select Subscription Status to Meter For
Next, in Report for Subscriptions in dropdown, select what subscription status you want to meter. For example, you may want to meter usage only for subscriptions that have an Active status. The dropdown menu has the following options:
- Active
- Future
- In Trial
- Paused
- Non-Renewing
For this tutorial, let’s choose Active.
Step 4: Define the Filters and Metrics
Lastly, define your billing criteria.
For the example esignature API, we want to meter for and rate all POST
requests
to the /esignature/documents
endpoint. According to the pricing strategy we’ve
defined in the preceding step, this means a customer pays US$3 for each thousand
POST
requests they make to the endpoint.
After finishing these steps, select Create to finish creating the billing meter.

Understand Revenue and Usage
Now Moesif tracks and meters your API consumption according to the reporting-only Billing Meter in real time. As usages accrue, you can observe the usage statistics with corresponding revenue in the Billing Meter’s Synced Usage pane at the bottom.

You can also switch to tabular form for the usage data:

Use Billing Report Metrics For Aggregated Metrics on Revenue and Usage
With Billing Report Metrics , you can gain more business critical insights into your API consumption and revenue.
To access Billing Report Metrics, follow these steps:
- Go to your Moesif Web Portal.
- Select Billing Meters in the navigation menu.
- Select Billing Reports.
Alternatively, select + Create New in the navigation menu and then select Billing Reports from the API Monetization section.
In this tutorial, we’ve created a single plan with usage-based pricing for the esignature API. In a real-world use case, a product offers customers multiple plans and prices to choose from. Therefore, you’ll likely have more than one billing meter. Billing Report Metrics offers a consolidated view into your product’s revenue stream across all your billing meters over a period of time. This makes it easier to evaluate your product’s growth and your current strategies.
Important: You must have at least one active Billing Meter to view billing reports in Billing Report Metrics.
In the following sections, we illustrate some of the features Billing Report Metrics offers.
Filter Your Analysis Data
By default, Billing Report Metrics takes into account all your subscriptions, customers, plans, prices, and active billing meters. You can fine-tune your analysis using filters. For example, here we define a filter to only include data for the “E-Sign requests” plan:

Compare Your Metrics Across Categories
Use the Group By pane to define groups that divide your billing report metrics into categories or demographics. For example, we can visualize usage and revenue across customers of the esignature API by grouping the data by company domains:


Choose the Metric to Plot
By default, Billing Report Metrics plots the sum of metric values in your billing meters. You can change the aggregation operation from summation to average calculation, and choose a different metric to plot.
For example, here we want to plot summation of revenue amounts:

Export Data
You can export Billing Report Metrics data in JSON and CSV formats according to the configurations you’ve defined like filters. Having the raw data accessible allows you to set up external workflows and further data analysis.
