Menu
Platform
AI
App store purchases
Credits
Database
Flags
Generated Assets
Jobs and cron
Localization
Monitoring
Notifications
Payments
Sandboxes
Webhooks
Getting Started
Authentication
KV Store
Deploy & Infrastructure
Reference
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
| Field | Type | What it is |
|---|---|---|
name | string | orgs/{org}/projects/{project}/envs/{env}/usage_meters/{usage_meter}; the id is the meter key. |
uid | string | umtr_<cell><ulid>; never reused. Output only. |
meta | ResourceMeta | Resource metadata. |
unit | string | The unit of one quantity, for example token. It cannot change once the meter has recorded usage. Required. |
display_name | string | A name for people. |
reservation_optional | bool | Whether usage may be recorded without a reservation. |
active | bool | A retired meter (false) refuses new usage; its history stays. |
current_unit_price_nano | string | The 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.
| Method | Call | What it does |
|---|---|---|
GET | get | Gets a usage meter. |
GET | list | Lists usage meters. |
PATCH | update | Creates 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