The goal of our service is to free our users from fixed costs, and to charge based on usage instead. Logically, creating transparency about dynamic costs is an important feature of our product. In this short tutorial, we explain how usage is defined, how we track it, and how it is visible to users.
What Do We Meter?
We track and bill all every byte of outgoing network traffic to our service, and the billing unit is in MiB (mebibyte - 10242 bytes). We do not currently bill based on the number of requests or similar, as others might do. Incoming traffic is free, because in the case of a data relay, it's approximately the same as the outgoing data, and we would otherwise double-charge. What we meter is not just the payload data, but every single byte including the protocol overhead, which is typically less than 2%. Currently, we believe that this is the fairest type of usage measurement, and this is also how we pay our infrastructure service providers. This principle incentivizes to compress the data to be transferred, if feasible.
How Do We Meter?
We try to reflect usage as soon as possible and keep the total by calendar month (globally using UTC timezone). Whenever a connection to our relay is terminated, we report the outgoing bytes and add them to the monthly total. This statistic is directly accessible, and used for billing at the end of the month.
Showing Current and Past Usage
There are two ways to show the usage: in the web dashboard, or using the ZebraStream Management API.
In The Dashboard
The dashboard only shows the usage of the current month and the last month, if you click the button "Show Usage".
You will see the usage report below after a few seconds.
Using the ZebraStream Management API
The API allows you to retrieve the usage of the current and past months. Access requires a Management API Key as described in our "Getting Started" tutorial. Here, we show how to query the API using curl by example.
To retrieve the usage of a specific month, use the following query:
curl --request GET --header "Authorization: Bearer mng_Eezai2soocaiSohkeja9uoh4" https://api.zebrastream.io/v0/usage.show
This query will result in a JSON response like this
{
"month" : "2025-01",
"volume_bytes" : 1721
}
Instead of showing the current month, we encourage users to pass the explicit month as a query parameter:
curl --request GET --header "Authorization: Bearer mng_Eezai2soocaiSohkeja9uoh4" --data 'month=2025-01' --get https://api.zebrastream.io/v0/usage.show
Future Usage Tracking
We think that a monthly total is the minimum level of transparency needed. We plan to increase the resolution in the future, for instance to inspect the usage for individual streams and namespaces. Your feedback on this topic is very welcome.