---
title: "Get usage analytics"
method: POST
path: "/events/analytics"
tags: ["Events"]
---

# Get usage analytics

`POST /events/analytics`

Use when building analytics views (e.g. usage by feature or customer over time). Supports filtering, grouping, and time-series breakdown.

## Request body

- GetUsageAnalyticsRequest
  - `breakdown_bucket` boolean — BreakdownBucket when true augments each time-series point with BucketID/PriceID and appends a BucketSummaries rollup to each item. Requires WindowSize to be set and the item to be linked to a subscription line item that has CommitmentTimeBuckets. Default: false (opt-in, backward compatible).
  - `end_time` string, date-time
  - `expand` string[] — allowed values: "price", "meter", "feature", "subscription_line_item","plan","addon"
  - `external_customer_id` string — ExternalCustomerID is the single external customer ID. Optional when ExternalCustomerIDs is provided; required otherwise.
  - `feature_ids` string[]
  - `group_by` string[] — allowed values: "source", "feature_id", "properties.<field_name>"
  - `include_children` boolean — IncludeChildren when true folds child customers' usage into the single aggregated total. Default: false.
  - `property_filters` object — Property filters to filter the events by the keys in `properties` field of the event
  - `sources` string[]
  - `start_time` string, date-time
  - `window_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'

## Response `200`

OK

- GetUsageAnalyticsResponse
  - `currency` string
  - `custom_analytics` CustomAnalyticItem[]
    - `feature_name` string — Name of the feature this applies to
    - `id` string
    - `name` string — Calculation name (e.g., "Revenue per Minute")
    - `type` string — "feature", "meter", "event_name"
    - `value` string
  - `items` UsageAnalyticItem[]
    - `add_on_id` string
    - `addon` Addon
      - `created_at` string, date-time
      - `created_by` string
      - `description` string
      - `environment_id` string
      - `id` string
      - `lookup_key` string
      - `metadata` object
      - `name` string
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `updated_at` string, date-time
      - `updated_by` string
    - `aggregation_type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
    - `bucket_summaries` BucketSummary[] — BucketSummaries is populated only when BreakdownBucket=true. Contains one entry per defined CommitmentTimeBucket plus one for out-of-bucket usage.
      - `base_charge` string
      - `bucket_id` string
      - `commitment_type` string
      - `commitment_value` string
      - `computed_overage` string
      - `computed_true_up` string
      - `computed_utilized` string
      - `end` TypesBucket
        - `hour` integer
        - `minute` integer
      - `price_id` string — PriceID is the bucket's own price (the line item's price for the out-of-bucket row).
      - `start` TypesBucket
        - `hour` integer
        - `minute` integer
      - `subscription_line_item_id` string — SubscriptionLineItemID is the line item this bucket is configured on.
      - `total_usage` string
    - `commitment_info` TypesCommitmentInfo
      - `amount` string
      - `computed_commitment_utilized_amount` string
      - `computed_overage_amount` string
      - `computed_true_up_amount` string — total_cost = computed_commitment_utilized_amount + computed_overage_amount + computed_true_up_amount
      - `duration` 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
      - `is_windowed` boolean
      - `overage_factor` string
      - `quantity` string — Only used for quantity-based commitments
      - `true_up_enabled` boolean
      - `type` 'amount' | 'quantity'
    - `currency` string
    - `event_count` integer — Number of events that contributed to this aggregation
    - `event_name` string
    - `feature` Feature
      - `alert_settings` TypesAlertSettings
        - `alert_enabled` boolean
        - `critical` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `info` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
        - `warning` TypesAlertThreshold
          - `condition` 'above' | 'below'
          - `threshold` string
      - `created_at` string, date-time
      - `created_by` string
      - `description` string
      - `environment_id` string
      - `group` GroupGroup
        - `created_at` string, date-time
        - `created_by` string
        - `entity_type` 'price' | 'feature'
        - `environment_id` string
        - `id` string
        - `lookup_key` string
        - `metadata` object
        - `name` string
        - `status` 'published' | 'deleted' | 'archived'
        - `tenant_id` string
        - `updated_at` string, date-time
        - `updated_by` string
      - `group_id` string
      - `id` string
      - `lookup_key` string
      - `metadata` TypesMetadata
      - `meter_id` string
      - `name` string
      - `reporting_unit` TypesReportingUnit
        - `conversion_rate` number — Multiplier: reporting_unit_value = unit_value * conversion_rate; must be > 0
        - `unit_plural` string — Display unit label, plural (e.g. "seconds")
        - `unit_singular` string — Display unit label, singular (e.g. "second")
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `type` 'metered' | 'boolean' | 'static' | 'config'
      - `unit_plural` string
      - `unit_singular` string
      - `updated_at` string, date-time
      - `updated_by` string
    - `feature_id` string
    - `group` GroupGroup
      - `created_at` string, date-time
      - `created_by` string
      - `entity_type` 'price' | 'feature'
      - `environment_id` string
      - `id` string
      - `lookup_key` string
      - `metadata` object
      - `name` string
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `updated_at` string, date-time
      - `updated_by` string
    - `meter` MeterMeter
      - `aggregation` MeterAggregation
        - `bucket_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'
        - `expression` string — Expression is an optional CEL expression to compute per-event quantity from event.properties. When set, it replaces Field-based extraction. Property names are used directly (e.g., token * duration * pixel).
        - `field` string — Field is the key in $event.properties on which the aggregation is to be applied For ex if the aggregation type is sum for API usage, the field could be "duration_ms" Ignored when Expression is set.
        - `group_by` string — GroupBy is the property name in event.properties to group by before aggregating. Currently only supported for MAX aggregation with bucket_size. When set, aggregation is applied per unique value of this property within each bucket, then the per-group results are summed to produce the bucket total.
        - `multiplier` string — Multiplier is the multiplier for the aggregation For ex if the aggregation type is sum_with_multiplier for API usage, the multiplier could be 1000 to scale up by a factor of 1000. If not provided, it will be null.
        - `type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
      - `created_at` string, date-time
      - `created_by` string
      - `environment_id` string — EnvironmentID is the environment identifier for the meter
      - `event_name` string — EventName is the unique identifier for the event that this meter is tracking It is a mandatory field in the events table and hence being used as the primary matching field We can have multiple meters tracking the same event but with different filters and aggregation
      - `filters` MeterFilter[] — Filters define the criteria for the meter to be applied on the events before aggregation It also defines the possible values on which later the charges will be applied
        - `key` string — Key is the key for the filter from $event.properties Currently we support only first level keys in the properties and not nested keys
        - `values` string[] — Values are the possible values for the filter to be considered for the meter For ex "model_name" could have values "o1-mini", "gpt-4o" etc
      - `id` string — ID is the unique identifier for the meter
      - `name` string — Name is the display name of the meter
      - `reset_usage` 'BILLING_PERIOD' | 'NEVER'
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `updated_at` string, date-time
      - `updated_by` string
    - `meter_id` string — Meter ID
    - `name` string
    - `plan` Plan
      - `created_at` string, date-time
      - `created_by` string
      - `description` string
      - `display_order` integer
      - `environment_id` string
      - `id` string
      - `lookup_key` string
      - `metadata` TypesMetadata
      - `name` string
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `updated_at` string, date-time
      - `updated_by` string
    - `plan_id` string
    - `points` UsageAnalyticPoint[]
      - `buckets` PointBucket[] — Buckets lists every commitment bucket this (possibly rolled-up) window overlaps — only populated when BreakdownBucket=true and the line item has CommitmentTimeBuckets. A coarse window can overlap more than one bucket, and only partially, so this is a list. Empty when the window touches no bucket. It is an informational HINT only: the point's single cost/computed_* totals mix all overlapped buckets and out-of-bucket time and CANNOT be split per bucket — read bucket_summaries for exact per-bucket cost.
        - `bucket_id` string
        - `price_id` string
      - `computed_commitment_utilized_amount` string — Commitment breakdown (only populated for windowed commitments)
      - `computed_overage_amount` string
      - `computed_true_up_amount` string
      - `cost` string — Cost is the final cost after discount (Subtotal - Discount)
      - `discount` string
      - `event_count` integer — Number of events in this time window
      - `subtotal` string
      - `timestamp` string
      - `usage` string
    - `price` PriceResponse
      - `addon` AddonResponse
        - `created_at` string, date-time
        - `created_by` string
        - `credit_grants` CreditGrantResponse[]
          - `addon_id` string
          - `cadence` 'ONETIME' | 'RECURRING'
          - `conversion_rate` string — amount in the currency = number of credits * conversion_rate ex if conversion_rate is 1, then 1 USD = 1 credit ex if conversion_rate is 2, then 1 USD = 0.5 credits ex if conversion_rate is 0.5, then 1 USD = 2 credits
          - `created_at` string, date-time
          - `created_by` string
          - `credit_grant_anchor` string, date-time
          - `credits` string
          - `end_date` string, date-time
          - `environment_id` string
          - `expiration_duration` integer
          - `expiration_duration_unit` 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'
          - `expiration_type` 'NEVER' | 'DURATION' | 'BILLING_CYCLE'
          - `id` string
          - `metadata` TypesMetadata
          - `name` string
          - `period` 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'ANNUAL' | 'QUARTERLY' | 'HALF_YEARLY'
          - `period_count` integer
          - `plan_id` string
          - `priority` integer
          - `scope` 'PLAN' | 'SUBSCRIPTION' | 'ADDON'
          - `start_date` string, date-time
          - `status` 'published' | 'deleted' | 'archived'
          - `subscription_id` string
          - `tenant_id` string
          - `topup_conversion_rate` string — topup_conversion_rate is the conversion rate for the topup to the currency ex if topup_conversion_rate is 1, then 1 USD = 1 credit ex if topup_conversion_rate is 2, then 1 USD = 0.5 credits ex if topup_conversion_rate is 0.5, then 1 USD = 2 credits
          - `updated_at` string, date-time
          - `updated_by` string
        - `description` string
        - `entitlements` EntitlementResponse[]
          - `addon` AddonResponse — recursive
          - `aggregation_mode` 'additive' | 'parallel'
          - `config_value` object
          - `created_at` string, date-time
          - `created_by` string
          - `display_order` integer
          - `end_date` string, date-time
          - `entity_id` string
          - `entity_type` 'PLAN' | 'SUBSCRIPTION' | 'ADDON'
          - `environment_id` string
          - `feature` FeatureResponse
            - `alert_settings` TypesAlertSettings
              - …
            - `created_at` string, date-time
            - `created_by` string
            - `description` string
            - `environment_id` string
            - `group` GroupResponse
              - …
            - `group_id` string
            - `id` string
            - `lookup_key` string
            - `metadata` TypesMetadata
            - `meter` MeterResponse
              - …
            - `meter_id` string
            - `name` string
            - `reporting_unit` TypesReportingUnit
              - …
            - `status` 'published' | 'deleted' | 'archived'
            - `tenant_id` string
            - `type` 'metered' | 'boolean' | 'static' | 'config'
            - `unit_plural` string
            - `unit_singular` string
            - `updated_at` string, date-time
            - `updated_by` string
          - `feature_id` string
          - `feature_type` 'metered' | 'boolean' | 'static' | 'config'
          - `grant_duration_unit` 'hour' | 'day' | 'week'
          - `grant_duration_value` integer
          - `grant_measure` 'quantity' | 'amount'
          - `grant_quota` number
          - `id` string
          - `is_enabled` boolean
          - `is_soft_limit` boolean
          - `parent_entitlement_id` string
          - `plan` PlanResponse
            - `created_at` string, date-time
            - `created_by` string
            - `credit_grants` CreditGrantResponse[]
              - …
            - `description` string
            - `display_order` integer
            - `entitlements` EntitlementResponse[]
            - `environment_id` string
            - `id` string
            - `lookup_key` string
            - `metadata` TypesMetadata
            - `name` string
            - `prices` PriceResponse[] — TODO: Add inline addons
            - `status` 'published' | 'deleted' | 'archived'
            - `tenant_id` string
            - `updated_at` string, date-time
            - `updated_by` string
          - `plan_id` string — TODO: Remove this once we have a proper entitlement entity type
          - `start_date` string, date-time
          - `static_value` string
          - `status` 'published' | 'deleted' | 'archived'
          - `tenant_id` string
          - `updated_at` string, date-time
          - `updated_by` string
          - `usage_limit` integer
          - `usage_reset_period` 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'NEVER'
        - `environment_id` string
        - `id` string
        - `lookup_key` string
        - `metadata` object
        - `name` string
        - `prices` PriceResponse[] — Optional expanded fields
        - `status` 'published' | 'deleted' | 'archived'
        - `tenant_id` string
        - `updated_at` string, date-time
        - `updated_by` string
      - `amount` string — Amount stored in main currency units (e.g., dollars, not cents) For USD: 12.50 means $12.50
      - `billing_cadence` 'RECURRING'
      - `billing_model` 'FLAT_FEE' | 'PACKAGE' | 'TIERED'
      - `billing_period` 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
      - `billing_period_count` integer — BillingPeriodCount is the count of the billing period ex 1, 3, 6, 12
      - `conversion_rate` string — ConversionRate is the conversion rate of the price unit to the fiat currency
      - `created_at` string, date-time
      - `created_by` string
      - `currency` string — Currency 3 digit ISO currency code in lowercase ex usd, eur, gbp
      - `description` string — Description of the price
      - `display_amount` string — DisplayAmount is the formatted amount with currency symbol For USD: $12.50
      - `display_name` string — DisplayName is the name of the price
      - `display_price_unit_amount` string — DisplayPriceUnitAmount is the formatted amount of the price unit
      - `end_date` string, date-time — EndDate is the end date of the price
      - `entity_id` string — EntityID holds the value of the "entity_id" field.
      - `entity_type` 'PLAN' | 'SUBSCRIPTION' | 'ADDON' | 'PRICE' | 'COSTSHEET'
      - `environment_id` string — EnvironmentID is the environment identifier for the price
      - `group` GroupResponse
        - `created_at` string, date-time
        - `entity_ids` string[]
        - `entity_type` string
        - `id` string
        - `lookup_key` string
        - `metadata` object
        - `name` string
        - `status` string
        - `updated_at` string, date-time
      - `group_id` string — GroupID references the group this price belongs to
      - `id` string — ID uuid identifier for the price
      - `invoice_cadence` 'ARREAR' | 'ADVANCE'
      - `lookup_key` string — LookupKey used for looking up the price in the database
      - `metadata` PriceJSONBMetadata
      - `meter` MeterResponse
        - `aggregation` MeterAggregation
          - `bucket_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'
          - `expression` string — Expression is an optional CEL expression to compute per-event quantity from event.properties. When set, it replaces Field-based extraction. Property names are used directly (e.g., token * duration * pixel).
          - `field` string — Field is the key in $event.properties on which the aggregation is to be applied For ex if the aggregation type is sum for API usage, the field could be "duration_ms" Ignored when Expression is set.
          - `group_by` string — GroupBy is the property name in event.properties to group by before aggregating. Currently only supported for MAX aggregation with bucket_size. When set, aggregation is applied per unique value of this property within each bucket, then the per-group results are summed to produce the bucket total.
          - `multiplier` string — Multiplier is the multiplier for the aggregation For ex if the aggregation type is sum_with_multiplier for API usage, the multiplier could be 1000 to scale up by a factor of 1000. If not provided, it will be null.
          - `type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
        - `created_at` string, date-time
        - `event_name` string
        - `filters` MeterFilter[]
          - `key` string — Key is the key for the filter from $event.properties Currently we support only first level keys in the properties and not nested keys
          - `values` string[] — Values are the possible values for the filter to be considered for the meter For ex "model_name" could have values "o1-mini", "gpt-4o" etc
        - `id` string
        - `name` string
        - `reset_usage` 'BILLING_PERIOD' | 'NEVER'
        - `status` string
        - `tenant_id` string
        - `updated_at` string, date-time
      - `meter_id` string — MeterID is the id of the meter for usage based pricing
      - `min_quantity` string, nullable — MinQuantity is the minimum quantity of the price
      - `parent_price_id` string — ParentPriceID references the root price (always set for price lineage tracking)
      - `plan` PlanResponse
        - `created_at` string, date-time
        - `created_by` string
        - `credit_grants` CreditGrantResponse[]
          - `addon_id` string
          - `cadence` 'ONETIME' | 'RECURRING'
          - `conversion_rate` string — amount in the currency = number of credits * conversion_rate ex if conversion_rate is 1, then 1 USD = 1 credit ex if conversion_rate is 2, then 1 USD = 0.5 credits ex if conversion_rate is 0.5, then 1 USD = 2 credits
          - `created_at` string, date-time
          - `created_by` string
          - `credit_grant_anchor` string, date-time
          - `credits` string
          - `end_date` string, date-time
          - `environment_id` string
          - `expiration_duration` integer
          - `expiration_duration_unit` 'DAY' | 'WEEK' | 'MONTH' | 'YEAR'
          - `expiration_type` 'NEVER' | 'DURATION' | 'BILLING_CYCLE'
          - `id` string
          - `metadata` TypesMetadata
          - `name` string
          - `period` 'DAILY' | 'WEEKLY' | 'MONTHLY' | 'ANNUAL' | 'QUARTERLY' | 'HALF_YEARLY'
          - `period_count` integer
          - `plan_id` string
          - `priority` integer
          - `scope` 'PLAN' | 'SUBSCRIPTION' | 'ADDON'
          - `start_date` string, date-time
          - `status` 'published' | 'deleted' | 'archived'
          - `subscription_id` string
          - `tenant_id` string
          - `topup_conversion_rate` string — topup_conversion_rate is the conversion rate for the topup to the currency ex if topup_conversion_rate is 1, then 1 USD = 1 credit ex if topup_conversion_rate is 2, then 1 USD = 0.5 credits ex if topup_conversion_rate is 0.5, then 1 USD = 2 credits
          - `updated_at` string, date-time
          - `updated_by` string
        - `description` string
        - `display_order` integer
        - `entitlements` EntitlementResponse[]
          - `addon` AddonResponse
            - `created_at` string, date-time
            - `created_by` string
            - `credit_grants` CreditGrantResponse[]
              - …
            - `description` string
            - `entitlements` EntitlementResponse[]
            - `environment_id` string
            - `id` string
            - `lookup_key` string
            - `metadata` object
            - `name` string
            - `prices` PriceResponse[] — Optional expanded fields
            - `status` 'published' | 'deleted' | 'archived'
            - `tenant_id` string
            - `updated_at` string, date-time
            - `updated_by` string
          - `aggregation_mode` 'additive' | 'parallel'
          - `config_value` object
          - `created_at` string, date-time
          - `created_by` string
          - `display_order` integer
          - `end_date` string, date-time
          - `entity_id` string
          - `entity_type` 'PLAN' | 'SUBSCRIPTION' | 'ADDON'
          - `environment_id` string
          - `feature` FeatureResponse
            - `alert_settings` TypesAlertSettings
              - …
            - `created_at` string, date-time
            - `created_by` string
            - `description` string
            - `environment_id` string
            - `group` GroupResponse
              - …
            - `group_id` string
            - `id` string
            - `lookup_key` string
            - `metadata` TypesMetadata
            - `meter` MeterResponse
              - …
            - `meter_id` string
            - `name` string
            - `reporting_unit` TypesReportingUnit
              - …
            - `status` 'published' | 'deleted' | 'archived'
            - `tenant_id` string
            - `type` 'metered' | 'boolean' | 'static' | 'config'
            - `unit_plural` string
            - `unit_singular` string
            - `updated_at` string, date-time
            - `updated_by` string
          - `feature_id` string
          - `feature_type` 'metered' | 'boolean' | 'static' | 'config'
          - `grant_duration_unit` 'hour' | 'day' | 'week'
          - `grant_duration_value` integer
          - `grant_measure` 'quantity' | 'amount'
          - `grant_quota` number
          - `id` string
          - `is_enabled` boolean
          - `is_soft_limit` boolean
          - `parent_entitlement_id` string
          - `plan` PlanResponse — recursive
          - `plan_id` string — TODO: Remove this once we have a proper entitlement entity type
          - `start_date` string, date-time
          - `static_value` string
          - `status` 'published' | 'deleted' | 'archived'
          - `tenant_id` string
          - `updated_at` string, date-time
          - `updated_by` string
          - `usage_limit` integer
          - `usage_reset_period` 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'NEVER'
        - `environment_id` string
        - `id` string
        - `lookup_key` string
        - `metadata` TypesMetadata
        - `name` string
        - `prices` PriceResponse[] — TODO: Add inline addons
        - `status` 'published' | 'deleted' | 'archived'
        - `tenant_id` string
        - `updated_at` string, date-time
        - `updated_by` string
      - `price_unit` string — PriceUnit is the code of the price unit (e.g., 'btc', 'eth')
      - `price_unit_amount` string — PriceUnitAmount is the amount of the price unit
      - `price_unit_id` string — PriceUnitID is the id of the price unit (for CUSTOM type)
      - `price_unit_tiers` PricePriceTier[] — PriceUnitTiers are the tiers for the price unit when BillingModel is TIERED
        - `flat_amount` string — flat_amount is the flat amount for the given tier (optional) Applied on top of unit_amount*quantity. Useful for cases like "2.7$ + 5c"
        - `unit_amount` string — unit_amount is the amount per unit for the given tier
        - `up_to` integer — up_to is the quantity up to which this tier applies. It is null for the last tier. IMPORTANT: Tier boundaries are INCLUSIVE. - If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier - This behavior is consistent across both VOLUME and SLAB tier modes
      - `price_unit_type` 'FIAT' | 'CUSTOM'
      - `pricing_unit` PriceUnitResponse
        - `base_currency` string
        - `code` string
        - `conversion_rate` string
        - `created_at` string, date-time
        - `created_by` string
        - `environment_id` string
        - `id` string
        - `metadata` TypesMetadata
        - `name` string
        - `status` 'published' | 'deleted' | 'archived'
        - `symbol` string
        - `tenant_id` string
        - `updated_at` string, date-time
        - `updated_by` string
      - `sequence` integer — Sequence is the monotonic stamp bumped on every state change that subscription line items need to react to. Read by the plan-price sync; set by the database (DEFAULT nextval) on create and by the price repository on termination / compatibility-affecting edits.
      - `start_date` string, date-time — StartDate is the start date of the price
      - `status` 'published' | 'deleted' | 'archived'
      - `tenant_id` string
      - `tier_mode` 'VOLUME' | 'SLAB'
      - `tiers` PricePriceTier[]
        - `flat_amount` string — flat_amount is the flat amount for the given tier (optional) Applied on top of unit_amount*quantity. Useful for cases like "2.7$ + 5c"
        - `unit_amount` string — unit_amount is the amount per unit for the given tier
        - `up_to` integer — up_to is the quantity up to which this tier applies. It is null for the last tier. IMPORTANT: Tier boundaries are INCLUSIVE. - If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier - This behavior is consistent across both VOLUME and SLAB tier modes
      - `transform_quantity` PriceJSONBTransformQuantity
        - `divide_by` integer — Divide quantity by this number
        - `round` 'up' | 'down'
      - `trial_period_days` integer — TrialPeriodDays is the number of days for the trial period Note: This is only applicable for recurring prices (BILLING_CADENCE_RECURRING)
      - `type` 'USAGE' | 'FIXED'
      - `updated_at` string, date-time
      - `updated_by` string
    - `price_id` string — Price ID used for this usage
    - `properties` object — Stores property values for flexible grouping (e.g., org_id -> "org123")
    - `reporting_unit` TypesReportingUnit
      - `conversion_rate` number — Multiplier: reporting_unit_value = unit_value * conversion_rate; must be > 0
      - `unit_plural` string — Display unit label, plural (e.g. "seconds")
      - `unit_singular` string — Display unit label, singular (e.g. "second")
    - `source` string
    - `sources` string[] — List of sources when not grouping by source
    - `sub_line_item_id` string — Subscription line item ID
    - `subscription_id` string — Subscription ID
    - `subscription_line_item` SubscriptionSubscriptionLineItem
      - `addon_association_id` string
      - `billing_period` 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
      - `billing_period_count` integer — from price at create; default 1
      - `commitment_amount` string — Commitment fields
      - `commitment_duration` 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
      - `commitment_overage_factor` string
      - `commitment_quantity` string
      - `commitment_time_buckets` TypesTimeOfDayBucket[]
        - `commitment_type` 'amount' | 'quantity'
        - `commitment_value` string
        - `end` TypesBucket
          - `hour` integer
          - `minute` integer
        - `id` string — ID is server-assigned. Stable for the lifetime of the line item; invoice breakdown and analytics responses reference this ID.
        - `overage_factor` number
        - `price_id` string — PriceID is the SUBSCRIPTION-scoped price created at bucket-creation time. Immutable post-create; changing pricing requires a successor line item.
        - `start` TypesBucket
          - `hour` integer
          - `minute` integer
        - `true_up_enabled` boolean
      - `commitment_true_up_enabled` boolean
      - `commitment_type` 'amount' | 'quantity'
      - `commitment_windowed` boolean
      - `created_at` string, date-time
      - `created_by` string
      - `currency` string
      - `customer_id` string
      - `display_name` string
      - `end_date` string, date-time
      - `entity_id` string
      - `entity_type` 'plan' | 'addon' | 'subscription'
      - `environment_id` string
      - `id` string
      - `invoice_cadence` 'ARREAR' | 'ADVANCE'
      - `metadata` object
      - `meter` MeterMeter
        - `aggregation` MeterAggregation
          - `bucket_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'
          - `expression` string — Expression is an optional CEL expression to compute per-event quantity from event.properties. When set, it replaces Field-based extraction. Property names are used directly (e.g., token * duration * pixel).
          - `field` string — Field is the key in $event.properties on which the aggregation is to be applied For ex if the aggregation type is sum for API usage, the field could be "duration_ms" Ignored when Expression is set.
          - `group_by` string — GroupBy is the property name in event.properties to group by before aggregating. Currently only supported for MAX aggregation with bucket_size. When set, aggregation is applied per unique value of this property within each bucket, then the per-group results are summed to produce the bucket total.
          - `multiplier` string — Multiplier is the multiplier for the aggregation For ex if the aggregation type is sum_with_multiplier for API usage, the multiplier could be 1000 to scale up by a factor of 1000. If not provided, it will be null.
          - `type` 'COUNT' | 'SUM' | 'AVG' | 'COUNT_UNIQUE' | 'LATEST' | 'SUM_WITH_MULTIPLIER' | 'MAX' | 'WEIGHTED_SUM'
        - `created_at` string, date-time
        - `created_by` string
        - `environment_id` string — EnvironmentID is the environment identifier for the meter
        - `event_name` string — EventName is the unique identifier for the event that this meter is tracking It is a mandatory field in the events table and hence being used as the primary matching field We can have multiple meters tracking the same event but with different filters and aggregation
        - `filters` MeterFilter[] — Filters define the criteria for the meter to be applied on the events before aggregation It also defines the possible values on which later the charges will be applied
          - `key` string — Key is the key for the filter from $event.properties Currently we support only first level keys in the properties and not nested keys
          - `values` string[] — Values are the possible values for the filter to be considered for the meter For ex "model_name" could have values "o1-mini", "gpt-4o" etc
        - `id` string — ID is the unique identifier for the meter
        - `name` string — Name is the display name of the meter
        - `reset_usage` 'BILLING_PERIOD' | 'NEVER'
        - `status` 'published' | 'deleted' | 'archived'
        - `tenant_id` string
        - `updated_at` string, date-time
        - `updated_by` string
      - `meter_display_name` string
      - `meter_id` string
      - `plan_display_name` string
      - `price` PricePrice
        - `amount` string — Amount stored in main currency units (e.g., dollars, not cents) For USD: 12.50 means $12.50
        - `billing_cadence` 'RECURRING'
        - `billing_model` 'FLAT_FEE' | 'PACKAGE' | 'TIERED'
        - `billing_period` 'MONTHLY' | 'ANNUAL' | 'WEEKLY' | 'DAILY' | 'QUARTERLY' | 'HALF_YEARLY' | 'ONETIME'
        - `billing_period_count` integer — BillingPeriodCount is the count of the billing period ex 1, 3, 6, 12
        - `conversion_rate` string — ConversionRate is the conversion rate of the price unit to the fiat currency
        - `created_at` string, date-time
        - `created_by` string
        - `currency` string — Currency 3 digit ISO currency code in lowercase ex usd, eur, gbp
        - `description` string — Description of the price
        - `display_amount` string — DisplayAmount is the formatted amount with currency symbol For USD: $12.50
        - `display_name` string — DisplayName is the name of the price
        - `display_price_unit_amount` string — DisplayPriceUnitAmount is the formatted amount of the price unit
        - `end_date` string, date-time — EndDate is the end date of the price
        - `entity_id` string — EntityID holds the value of the "entity_id" field.
        - `entity_type` 'PLAN' | 'SUBSCRIPTION' | 'ADDON' | 'PRICE' | 'COSTSHEET'
        - `environment_id` string — EnvironmentID is the environment identifier for the price
        - `group_id` string — GroupID references the group this price belongs to
        - `id` string — ID uuid identifier for the price
        - `invoice_cadence` 'ARREAR' | 'ADVANCE'
        - `lookup_key` string — LookupKey used for looking up the price in the database
        - `metadata` PriceJSONBMetadata
        - `meter_id` string — MeterID is the id of the meter for usage based pricing
        - `min_quantity` string, nullable — MinQuantity is the minimum quantity of the price
        - `parent_price_id` string — ParentPriceID references the root price (always set for price lineage tracking)
        - `price_unit` string — PriceUnit is the code of the price unit (e.g., 'btc', 'eth')
        - `price_unit_amount` string — PriceUnitAmount is the amount of the price unit
        - `price_unit_id` string — PriceUnitID is the id of the price unit (for CUSTOM type)
        - `price_unit_tiers` PricePriceTier[] — PriceUnitTiers are the tiers for the price unit when BillingModel is TIERED
          - `flat_amount` string — flat_amount is the flat amount for the given tier (optional) Applied on top of unit_amount*quantity. Useful for cases like "2.7$ + 5c"
          - `unit_amount` string — unit_amount is the amount per unit for the given tier
          - `up_to` integer — up_to is the quantity up to which this tier applies. It is null for the last tier. IMPORTANT: Tier boundaries are INCLUSIVE. - If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier - This behavior is consistent across both VOLUME and SLAB tier modes
        - `price_unit_type` 'FIAT' | 'CUSTOM'
        - `sequence` integer — Sequence is the monotonic stamp bumped on every state change that subscription line items need to react to. Read by the plan-price sync; set by the database (DEFAULT nextval) on create and by the price repository on termination / compatibility-affecting edits.
        - `start_date` string, date-time — StartDate is the start date of the price
        - `status` 'published' | 'deleted' | 'archived'
        - `tenant_id` string
        - `tier_mode` 'VOLUME' | 'SLAB'
        - `tiers` PricePriceTier[]
          - `flat_amount` string — flat_amount is the flat amount for the given tier (optional) Applied on top of unit_amount*quantity. Useful for cases like "2.7$ + 5c"
          - `unit_amount` string — unit_amount is the amount per unit for the given tier
          - `up_to` integer — up_to is the quantity up to which this tier applies. It is null for the last tier. IMPORTANT: Tier boundaries are INCLUSIVE. - If up_to is 1000, then quantity less than or equal to 1000 belongs to this tier - This behavior is consistent across both VOLUME and SLAB tier modes
        - `transform_quantity` PriceJSONBTransformQuantity
          - `divide_by` integer — Divide quantity by this number
          - `round` 'up' | 'down'
        - `trial_period_days` integer — TrialPeriodDays is the number of days for the trial period Note: This is only applicable for recurring prices (BILLING_CADENCE_RECURRING)
        - `type` 'USAGE' | 'FIXED'
        - `updated_at` string, date-time
        - `updated_by` string
      - `price_id` string
      - `price_type` 'USAGE' | 'FIXED'
      - `price_unit` string
      - `price_unit_id` string
      - `quantity` string
      - `start_date` string, date-time
      - `status` 'published' | 'deleted' | 'archived'
      - `subscription_id` string
      - `subscription_phase_id` string
      - `tenant_id` string
      - `updated_at` string, date-time
      - `updated_by` string
    - `subtotal` string
    - `total_cost` string — TotalCost is the final cost after discount (Subtotal - TotalDiscount)
    - `total_discount` string
    - `total_usage` string
    - `total_usage_display` string — Empty string when feature has no reporting unit; otherwise the value in reporting units
    - `unit` string
    - `unit_plural` string
    - `window_size` 'MINUTE' | '15MIN' | '30MIN' | 'HOUR' | '3HOUR' | '6HOUR' | '12HOUR' | 'DAY' | 'WEEK' | 'MONTH'
  - `subtotal` string
  - `total_cost` string — TotalCost is the final cost after discount (Subtotal - TotalDiscount)
  - `total_discount` string

## Other responses

- `400` — Invalid request
- `500` — Server error

---

[API](https://skmtc.net/flexprice/apis/flexprice-api.md) · [All operations](https://skmtc.net/flexprice/apis/flexprice-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/flexprice/flexprice-api/revisions/f0601ed97bd3/schema)
