Skip to content
Console
Menu

Generated Assets

Workflows

Getting Started

Authentication

KV Store

sylphx money usage_reservations

Every sylphx money usage_reservations command: its argument, its flags and a run line.

The usage_reservations commands of Sylphx Money, as the CLI spells them: the same calls as the usage_reservations API page, typed for the shell. Install, sign in and the grammar are on the CLI index.

#create

Reserves usage before the work starts. Refused with PLAN_LIMIT_REACHED (spend limit, no payment method) or INVALID_STATE (suspended) only while enforcement is on; while it is dark the reservation is granted and the refusal is recorded.

CLI

Shell
sylphx money usage-reservations create --parent orgs/acme/projects/shop/envs/production --subject-proof … --meter … --max-quantity 1

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_reservations · scope billing:metering:write · effect write · Request, response and examples

Flags

FlagTypeWhat it does
--parentstringThe parent to create in; defaults to the linked project or the key's scope.
--meta.labelskey=valueCaller-writable, indexed labels (AIP-122 label rules). Repeat the flag for each value.
--meta.annotationskey=valueCaller-writable, unindexed annotations. Repeat the flag for each value.
--meta.display-namestringCaller-writable human-readable name.
--subject.end-userstringAn end user's id (Sylphx Auth, or the app's own OIDC issuer).
--subject.customer-organizationstringA customer organization's id.
--subject-proofstringThe acting end user's access token, required on every reserve: Money proves the subject itself, fresh, with the caller's own key (auth:sessions:verify) or the merchant's configured issuer. Never stored. A raw id is refused with PERMISSION_DENIED (reason subject_unverified). Required.
--actor-proofstringFor a customer organization: the token of the acting user, whose membership of the organization is checked fresh. The subject is Sylphx Auth's bare organization id (acme), never a resource name. Never stored.
--meterstringThe meter's lookup key. Required.
--max-quantityintThe most the work may use, in the meter's base unit. Required.
--ttldurationHow long the hold lasts, at most 600s; default 600s.

#get

Gets a usage reservation.

NAME — the resource's name; a bare id is enough below the linked project.

CLI

Shell
sylphx money usage-reservations get orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservation

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

#settle

Settles a reservation with what was used; the unused part returns to headroom. A settle after expiry still records the usage.

NAME — the resource's name; a bare id is enough below the linked project.

CLI

Shell
sylphx money usage-reservations settle orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservation

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservation:settle · scope billing:metering:write · effect write · Request, response and examples

Flags

FlagTypeWhat it does
--quantity-usedintWhat was used, in the meter's base unit; 0 to the granted quantity, or more after expiry (the work happened). Required.
--occurred-timetimestampWhen the work happened; now when absent.

#release

Releases a reservation that used nothing.

NAME — the resource's name; a bare id is enough below the linked project.

CLI

Shell
sylphx money usage-reservations release orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservation

POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservation:release · scope billing:metering:write · effect write · Request, response and examples