Create Meter
Creates a meter — a named, countable action of your product — that plans can price and subscriptions report usage against.
403 PRODUCT_NOT_ENABLED.event_name and aggregation are immutableThey 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.Authorizations
Headers
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 Yuno API.
Body
The unique identifier of the account the meter belongs to (UUID, 36 chars).
The meter display name (MAX 255; MIN 3). Leading and trailing spaces are trimmed.
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.
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.
SUM, COUNT, LAST What the meter counts and how. Optional but recommended — it is how your team and Yuno support understand the meter.
Singular unit label used when the usage is displayed. Example: token.
Plural unit label used when the usage is displayed. Example: tokens.
Optional key-value pairs attached to the meter (MAX 48 entries; keys must be unique per meter).
Ignored on creation — a new meter is always ACTIVE. Use Update Meter to archive it.
ACTIVE, INACTIVE Response
201
The unique identifier of the meter.
The unique identifier of the account that owns the meter.
SUM, COUNT, LAST ACTIVE, INACTIVE "ACTIVE"
Set by Yuno on creation.
Set by Yuno on every update.