Introducing the Better Auth Chargebee plugin: Use it to handle subscriptions, billing, and auth seamlessly.
Chargebeechargebee API

Metered features

A metered feature object represents two things:

  • the feature whose entitlement is consumed based on measured usage.
  • the configuration that measures that usage.

Sample Metered featureJSON

API Index URL

https://[site].chargebee.com/api/v2/metered_features

Metered features attributes

id
required, string, max chars=50

A unique identifier for the metered feature. This is the same as feature.id.

name
optional, string, max chars=50

A case-sensitive name for the metered feature. For example: API Calls, Input Tokens.

description
optional, string, max chars=250

A brief description of the metered feature.

type
optional, enumerated string

The type of meter. Determines how usage is measured for the metered feature.

Enum Values
simple

Usage is computed from a SQL query over usage_event properties.

compound

Usage is computed from a mathematical formula combining other meters.

status
optional, enumerated string

The current status of the metered feature.

Enum Values
active

The metered feature is active and new entitlements and subscription entitlements can be created for it.

archived

No new entitlements and subscription entitlements can be created for the metered feature. However, any pre-existing entitlements and subscription entitlements remain effective.

deleted

The metered feature has been permanently deleted.

query
optional, string, max chars=500

The SQL query used to measure usage from usage_event properties. For example: SELECT SUM(api_calls) FROM events.

Constraint:

  • The properties referenced in the query are always one of column_definitions.column_name.
column_definitions

Definitions of the columns or properties referenced by the metered feature's query.

features

The feature associated with this metered feature. This array has only one element since any given metered feature is associated with only one feature.