Botbot AI assist - Metering Setup Guide

Screenshot 2024-08-06 at 10.56.53.png

Use the following step-by-step guide to create a Botbot AI assist example stream in Usage Engine. See for an overview of the Botbot use case.

To process usage using the Botbot AI assist example stream, you need to create:

  • meter types (the product you want to meter)

  • meters (buckets to measure the usage per customer for the product).

Meters and meter types are usually created using APIs called from an external system. You can automate this step for this example stream by importing the helper streams listed below. See .

Helper streams

  1. Provisioning Meter Types - This stream creates the meter types. It uses the aggregation type ‘sum’ and has a monthly reset interval meaning the golden records are sent once every month.

  2. Provisioning Meters - This stream creates the meters for the above meter types. The user ID for each company is the company name. In this example, there are two meters created for each company - one for the L1 support bot and one for the L2 support bot.

  3. Purge Meters - This is an additional stream to clean up the meters post-processing.


Step 1

Create a new application access for your account. This is needed for authenticating with the Usage Engine APIs, see .

Step 2

Create a new secret in the secrets wallet of type OAuth 2.0 containing your application's credentials. Select the authentication type “Client credentials“ and add the client ID and client secret created in the previous step, see .

Step 3

Import all helper streams using the above links.

Step 4

Update the authentication in all streams with your new secret. This is done in the functions within the streams that have a red error notification on them. Ensure that the audience and access token URL of the OAuth 2.0 authentication is configured to match your API base URL.

Step 5

Run stream 1. Provisioning Meter Types. When the stream has completed you will have six new meter types in the Usage metering view.

Step 6

Open the stream configuration of Botbot AI assist and copy the meter key from the Meter Processor for later.

Step 7

Open the stream configuration of 2. Provisioning Meters and open the script named "Prepare Meters". Paste in the meter key that you got from the previous step.

Step 8

Run stream 2. Provisioning Meters Once the stream is completed, you will have 12 meters in total.

Step 9

The meters you created in the previous step are now associated with the Meter processor in the stream.

Run the stream. When it is completed, you will see the aggregated values from the input records in the .

Step 10 (Optional)

If you want to delete your meters, run the Purge Meters stream. Now all the meters related to have been deleted.