Create Meter

Enabled per organization

Usage-based billing must be enabled for your organization before these endpoints accept requests. Contact your WHITELABEL account manager to enable it. Requests from an organization where it is not enabled return 403 PRODUCT_NOT_ENABLED.

event_name and aggregation are immutable

They define what your systems send and how it counts, so they can’t change after creation (a PATCH that includes them is silently ignored). To change either, create a new meter with a new event_name and archive the old one with Update Meter (status: INACTIVE). event_name is unique per account across active and archived meters, so pick a name you won’t need to reuse. status sent on creation is ignored — a new meter is always ACTIVE.

See The Meter Object for every field, and the Usage-Based Billing guide for the end-to-end flow. Refer to Meter Error Codes for the possible error outcomes.

POST/subscriptions/meters

Usage-based billing must be enabled for your organization before this endpoint accepts requests (otherwise 403 PRODUCT_NOT_ENABLED). Creates a meter: a named, countable action your product performs (tokens, API requests, gigabytes held). The meter defines the event_name your systems send and how the reported values aggregate per billing cycle. Attach it to a plan as a metered price to bill usage.

Header Parameters

X-Idempotency-Keystringrequired

Unique identifier used in HTTP headers to ensure that a request is processed only once, even if it is retried due to network issues or timeouts. Optional, as on the rest of the WHITELABEL API.

Body application/json

account_idstringrequired

The unique identifier of the account the meter belongs to (UUID, 36 chars).

namestringrequired

The meter display name (MAX 255; MIN 3). Leading and trailing spaces are trimmed.

descriptionstring

What the meter counts and how. Optional but recommended — it is how your team and WHITELABEL support understand the meter.

event_namestringrequired

The key your systems send on every usage event to reference this meter (MAX 100; lowercase letters, digits, _ and . only — ^[a-z0-9_.]+$). Must be unique across all meters of the account, ACTIVE or INACTIVE, else 409 METER_EVENT_NAME_CONFLICT. Immutable after creation.

aggregation"SUM" | "COUNT" | "LAST"required

How reported events roll up into the cycle quantity. SUM adds every event value (tokens, minutes). COUNT counts events, ignoring value (API requests). LAST keeps the most recent value (a gauge such as gigabytes held). Immutable after creation.

unit_labelstring

Singular unit label used when the usage is displayed. Example: token.

plural_unit_labelstring

Plural unit label used when the usage is displayed. Example: tokens.

default_priceobject
Show default_price properties
currencystringrequired

MAX 3; MIN 3. Must be USD — any other currency is rejected with 400 INVALID_PARAMETERS.

valuenumber<float>required

Default price per unit beyond the included credits (multiple of 0.0001). Inherited by USD plans that attach this meter without an explicit price_per_credit.

metadataobject[]

Optional key-value pairs attached to the meter (MAX 48 entries; keys must be unique per meter).

Show metadata properties
keystringrequired

MAX 48.

valuestringrequired

MAX 512.

status"ACTIVE" | "INACTIVE"

Ignored on creation — a new meter is always ACTIVE. Use Update Meter to archive it.

Response

201

idstring

The unique identifier of the meter.

account_idstring

The unique identifier of the account that owns the meter.

namestring
descriptionstring
event_namestring
aggregation"SUM" | "COUNT" | "LAST"
unit_labelstring
plural_unit_labelstring
default_priceobject
Show default_price properties
currencystring
valuenumber
metadataobject[]
Show metadata properties
keystring
valuestring
status"ACTIVE" | "INACTIVE"
created_atstring

Set by WHITELABEL on creation.

updated_atstring

Set by WHITELABEL on every update.

400

codestring
messagesstring[]

403

codestring
messagesstring[]

409

codestring
messagesstring[]