Create Pricing Metric
/pricing-metrics
Create Pricing Metric
Body Parameters
event_name: string
The name of the event that the pricing metric is computed on.
name: string
The name of the pricing metric.
unit: string
Unit of measurement for the pricing metric.
dimensions: optional array of string
The dimensions by which the events are grouped to compute the pricing metric.
Returns
Create Pricing Metric
curl https://api.uselark.ai/pricing-metrics \
-H 'Content-Type: application/json' \
-H "X-API-Key: $LARK_API_KEY" \
-d '{
"aggregation": {
"aggregation_type": "sum",
"value_field": "compute_hours"
},
"event_name": "job_completed",
"name": "Compute Hours",
"unit": "hours"
}'
{
"id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
"aggregation": {
"aggregation_type": "sum",
"value_field": "compute_hours"
},
"event_name": "job_completed",
"name": "Compute Hours",
"unit": "hours",
"dimensions": [
"string"
]
}Returns Examples
{
"id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
"aggregation": {
"aggregation_type": "sum",
"value_field": "compute_hours"
},
"event_name": "job_completed",
"name": "Compute Hours",
"unit": "hours",
"dimensions": [
"string"
]
}