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
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
sylphx money usage-reservations create --parent orgs/acme/projects/shop/envs/production --subject-proof … --meter … --max-quantity 1POST https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/usage_reservations · scope billing:metering:write · effect write · Request, response and examples
Flags
| Flag | Type | What it does |
|---|---|---|
--parent | string | The parent to create in; defaults to the linked project or the key's scope. |
--meta.labels | key=value | Caller-writable, indexed labels (AIP-122 label rules). Repeat the flag for each value. |
--meta.annotations | key=value | Caller-writable, unindexed annotations. Repeat the flag for each value. |
--meta.display-name | string | Caller-writable human-readable name. |
--subject.end-user | string | An end user's id (Sylphx Auth, or the app's own OIDC issuer). |
--subject.customer-organization | string | A customer organization's id. |
--subject-proof | string | The 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-proof | string | For 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. |
--meter | string | The meter's lookup key. Required. |
--max-quantity | int | The most the work may use, in the meter's base unit. Required. |
--ttl | duration | How 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
sylphx money usage-reservations get orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservationGET 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
sylphx money usage-reservations settle orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservationPOST 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
| Flag | Type | What it does |
|---|---|---|
--quantity-used | int | What was used, in the meter's base unit; 0 to the granted quantity, or more after expiry (the work happened). Required. |
--occurred-time | timestamp | When 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
sylphx money usage-reservations release orgs/acme/projects/shop/envs/production/usage_reservations/usage-reservationPOST 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