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

Meters

A meter captures the usage measurement configuration of a metered feature.

Sample MeterJSON

API Index URL

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

Meters attributes

id
required, string, max chars=50

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

name
required, string, max chars=50

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

description
optional, string, max chars=500

A brief description of the meter.

type
required, enumerated string

The type of meter that determines how usage is measured for the meter.

Enum Values
simple

Usage is computed from the 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 meter.

Enum Values
active

The meter is active and new entitlements can be created towards it.

archived

No new entitlements can be created towards the meter. However, any pre-existing entitlements from the time that the meter was active remain effective.

deleted

The meter has been permanently deleted.

query
required, string, max chars=500

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

created_at
required, timestamp(UTC) in seconds

When the meter was created.

updated_at
optional, timestamp(UTC) in seconds

When the meter was last updated.

column_definitions

Definitions of the columns or properties referenced by the meter's query. Each entry describes one column used to measure usage.

features

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

Column definition attributes

column_name
required, string, max chars=100

Name of the column or property used in the query. For example, request_count or input_tokens.

data_type
required, enumerated string

Data type of the column or property.

Enum Values
number

The column or property holds a numeric value.

string

The column or property holds a string value.

Feature attributes

id
required, string, max chars=50

A unique and immutable identifier for the feature. This is the same as meter.id.

name
required, string, max chars=50

A case-sensitive unique name for the feature.

description
optional, string, max chars=500

A brief description of the feature.

status
optional, enumerated string

The current status of the feature.

Enum Values
active

The feature is published. Any entitlements or subscription entitlements defined for the feature take effect immediately.

archived

No new entitlements or subscription entitlements can be created for the feature. However, any pre-existing item or subscription entitlements from the time that the feature was active remain effective.

draft

This value is not applicable for metered features.

type
optional, enumerated string

The type of feature. The value is always range.

Enum Values
switch

This value is not applicable for metered features.

custom

This value is not applicable for metered features.

quantity

This value is not applicable for metered features.

range

The feature is quantity based, with entitlement levels between 1 and unlimited.

unit
optional, string, max chars=50

Specifies the unit of measure. The value is expected in the singular form. It is pluralized automatically as needed. For example, for a feature such as user licenses, the unit can be license.

resource_version
optional, long

The version number of this resource. For every change made to the resource, resource_version is updated with a new timestamp in milliseconds.

updated_at
optional, timestamp(UTC) in seconds

When the feature was last updated.

created_at
required, timestamp(UTC) in seconds

When the feature was created.

metered
required, boolean

Indicates whether the feature is metered. Always true.

levels

An ordered list of entitlement levels available for the feature.