Skip to content
Join our SlackContact usGet started

List Pricing Metrics

get/pricing-metrics

List Pricing Metrics

Query ParametersExpand Collapse
limit: optional number
maximum100
minimum1
ReturnsExpand Collapse
has_more: boolean
pricing_metrics: array of PricingMetricResource { id, aggregation, event_name, 3 more }
id: string

The ID of the pricing metric.

aggregation: object { aggregation_type, value_field } or object { aggregation_type } or object { aggregation_type, value_field } or object { aggregation_type, value_field }

The aggregation function used to compute the value of the pricing metric.

Accepts one of the following:
Sum = object { aggregation_type, value_field }
aggregation_type: "sum"
Accepts one of the following:
"sum"
value_field: string

The field to sum over.

Count = object { aggregation_type }
aggregation_type: "count"
Accepts one of the following:
"count"
Max = object { aggregation_type, value_field }
aggregation_type: "max"
Accepts one of the following:
"max"
value_field: string

The field to get the max value of.

Last = object { aggregation_type, value_field }
aggregation_type: "last"
Accepts one of the following:
"last"
value_field: string

The field to get the last value of.

event_name: string

The event name that the pricing metric is computed on.

name: string

The name of the pricing metric.

unit: string

The unit of the value computed by the pricing metric.

dimensions: optional array of string

The dimensions by which the events are grouped to compute the pricing metric.

List Pricing Metrics
curl https://api.uselark.ai/pricing-metrics \
    -H "X-API-Key: $LARK_API_KEY"
{
  "has_more": true,
  "pricing_metrics": [
    {
      "id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
      "aggregation": {
        "aggregation_type": "sum",
        "value_field": "compute_hours"
      },
      "event_name": "job_completed",
      "name": "Compute Hours",
      "unit": "hours",
      "dimensions": [
        "string"
      ]
    }
  ]
}
Returns Examples
{
  "has_more": true,
  "pricing_metrics": [
    {
      "id": "pmtr_GlX5Tcm2HOn00CoRTFxw2Amw",
      "aggregation": {
        "aggregation_type": "sum",
        "value_field": "compute_hours"
      },
      "event_name": "job_completed",
      "name": "Compute Hours",
      "unit": "hours",
      "dimensions": [
        "string"
      ]
    }
  ]
}