Skip to content
Join our SlackContact usGet started

List Pricing Metrics

pricing_metrics.list(PricingMetricListParams**kwargs) -> PricingMetricListResponse
get/pricing-metrics

List Pricing Metrics

ParametersExpand Collapse
limit: Optional[int]
maximum100
minimum1
ReturnsExpand Collapse
class PricingMetricListResponse:
has_more: bool
pricing_metrics: List[PricingMetricResource]
id: str

The ID of the pricing metric.

aggregation: Aggregation

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

Accepts one of the following:
class AggregationSumAggregationPricingMetricResource:
aggregation_type: Literal["sum"]
Accepts one of the following:
"sum"
value_field: str

The field to sum over.

class AggregationCountAggregationPricingMetricResource:
aggregation_type: Literal["count"]
Accepts one of the following:
"count"
class AggregationMaxAggregationPricingMetricResource:
aggregation_type: Literal["max"]
Accepts one of the following:
"max"
value_field: str

The field to get the max value of.

class AggregationLastAggregationPricingMetricResource:
aggregation_type: Literal["last"]
Accepts one of the following:
"last"
value_field: str

The field to get the last value of.

event_name: str

The event name that the pricing metric is computed on.

name: str

The name of the pricing metric.

unit: str

The unit of the value computed by the pricing metric.

dimensions: Optional[List[str]]

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

List Pricing Metrics
from lark import Lark

client = Lark(
    api_key="My API Key",
)
pricing_metrics = client.pricing_metrics.list()
print(pricing_metrics.has_more)
{
  "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"
      ]
    }
  ]
}