Skip to main content
POST
Create Meter
Enabled per organizationUsage-based billing must be enabled for your organization before these endpoints accept requests. Contact your Yuno account manager to enable it. Requests from an organization where it is not enabled return 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.
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.

Authorizations

public-api-key
string
header
default:<Your public-api-key>
required
private-secret-key
string
header
default:<Your private-secret-key>
required

Headers

X-Idempotency-Key
string
required

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

application/json
account_id
string
required

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

name
string
required

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

event_name
string
required

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
enum<string>
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.

Available options:
SUM,
COUNT,
LAST
description
string

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

unit_label
string

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

plural_unit_label
string

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

default_price
object
metadata
object[]

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

status
enum<string>

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

Available options:
ACTIVE,
INACTIVE

Response

201

id
string

The unique identifier of the meter.

account_id
string

The unique identifier of the account that owns the meter.

name
string
description
string | null
event_name
string
aggregation
enum<string>
Available options:
SUM,
COUNT,
LAST
unit_label
string | null
plural_unit_label
string | null
default_price
object
metadata
object[]
status
enum<string>
Available options:
ACTIVE,
INACTIVE
Example:

"ACTIVE"

created_at
string

Set by Yuno on creation.

updated_at
string

Set by Yuno on every update.