Billable Metrics
Create a billable metric
Create a new billable metric for usage-based billing. Supported aggregation types: COUNT, SUM, MAX, UNIQUE_COUNT, LATEST, WEIGHTED_SUM.
post/api/billable-metrics
Request body
Example request
{
"name": "API Calls",
"code": "api_calls",
"description": "Number of API calls made",
"aggregationType": "COUNT",
"fieldName": "tokens",
"filters": [
{
"key": "region",
"values": [
"us-east",
"eu-west"
]
}
]
}Response
Billable metric created
Example response
{
"id": "clx1234567890",
"name": "API Calls",
"code": "api_calls",
"description": "Number of API calls made",
"aggregationType": "COUNT",
"fieldName": "tokens",
"filters": [
{
"id": "clx1234567890",
"key": "region",
"values": [
"us-east",
"us-west",
"eu"
]
}
]
}