Skip to content
Product Docs

Usage Metrics

Aggregate Usage Metrics
admin.usage_metrics.aggregate(UsageMetricAggregateParams**kwargs) -> UsageMetricAggregateResponse
GET/api/v1/admin/usage-metrics/aggregate
ModelsExpand Collapse
class UsageMetricAggregateResponse:

Response containing usage metrics aggregated by one or more dimensions.

buckets: List[Bucket]

The aggregation buckets, ordered by total credits descending

dimensions: Dict[str, str]

The dimension values that define this bucket

metric_count: int

Number of metric rows in this bucket

total_credits: Union[float, str]

Total credits consumed by metrics in this bucket

One of the following:
float
str
total_value: int

Total of the metric value field in this bucket

group_by: List[Literal["day", "event_type", "organization_id", 2 more]]

The dimensions the metrics were grouped by

One of the following:
"day"
"event_type"
"organization_id"
"project_id"
"user_id"