Skip to content
Console
Menu

Generated Assets

Workflows

Getting Started

Authentication

KV Store

Usage meters

A Usage Meter names one kind of usage a merchant bills for: its unit and whether usage may be recorded without a reservation.

A Usage Meter names one kind of usage a merchant bills for: its unit and whether usage may be recorded without a reservation. The merchant creates and changes it through this API; its prices are UsageMeterPrice records.

Service Sylphx Money · Resource type money.sylphx.com/UsageMeter · Name pattern orgs/{org}/projects/{project}/envs/{env}/usage_meters/{usage_meter} · Shape record

#Fields

FieldTypeWhat it is
namestringorgs/{org}/projects/{project}/envs/{env}/usage_meters/{usage_meter}; the id is the meter key.
uidstringumtr_<cell><ulid>; never reused. Output only.
metaResourceMetaResource metadata.
unitstringThe unit of one quantity, for example token. It cannot change once the meter has recorded usage. Required.
display_namestringA name for people.
reservation_optionalboolWhether usage may be recorded without a reservation.
activeboolA retired meter (false) refuses new usage; its history stays.
current_unit_price_nanostringThe unit price in force now, nano-minor, a decimal string; empty before the meter's first price. Output only.

#Methods

Every method of the collection, in the registry's order, with the scope it needs. The full request, response and examples are one link away.

MethodCallWhat it does
GETgetGets a usage meter.
GETlistLists usage meters.
PATCHupdateCreates or updates a usage meter. The unit cannot change once it has recorded usage.

#get

Gets a usage meter.

GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_meters/usage-meter · scope billing:read · effect read · Request, response and examples

#list

Lists usage meters.

GET https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_meters · scope billing:read · effect read · paginated · Request, response and examples

#update

Creates or updates a usage meter. The unit cannot change once it has recorded usage.

PATCH https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_meters/usage-meter · scope billing:write · effect write · Request, response and examples