usage
The hourly usage windows compute meters per allocation and hands to Better IAM billing, as the tenant can read them. Both methods decide `compute:usage:read` on `compute-tenant/{tenantId}`, or on `compute-project/{projectId}` when the call names a project, since windows carry their project as a tag. See [Billing and usage](/docs/guides/iam/billing-and-usage).
The hourly usage windows compute meters per allocation and hands to Better IAM billing, as the tenant can read them. Both methods decide compute:usage:read on compute-tenant/{tenantId}, or on compute-project/{projectId} when the call names a project, since windows carry their project as a tag. See Billing and usage.
All 2 methods are served by this release.
| Method | Kind | Authorization | Phase | Status |
|---|---|---|---|---|
list | read | compute:usage:read @ compute-tenant or compute:usage:read @ compute-project | v0.1 | registered |
export | read | compute:usage:read @ compute-tenant or compute:usage:read @ compute-project | v0.2 | registered |
list
POST /api/compute/usage/list
Lists the tenant's usage windows ordered by window start, optionally for one project, one meter and a time range; returns a page with a cursor.
-
Each window carries its billing idempotency key (
cmp:<allocationId>:<windowStartMs>), meter, quantity, bounds and tags, and, once the usage sink has handed it to IAM billing,recordedAtand theoutcome(recorded,duplicate,reattributedordead-lettered). -
fromandto(epoch milliseconds) select windows that end afterfromand start beforeto;tonot afterfromisINVALID_INPUT. -
limitis at most 500 (100 by default). A cursor this method did not return isINVALID_INPUT. -
Kind: read
-
Authorization:
compute:usage:read@compute-tenantorcompute:usage:read@compute-project -
Module:
server -
Phase: v0.1 (registered)
Input
| Field | Type | Required | Constraints |
|---|---|---|---|
tenantId | string | yes | at most 128 characters; matches ^[A-Za-z0-9._:-]{1,128}$ |
projectId | string | at most 64 characters; matches ^prj_[0-9a-hjkmnp-tv-z]{26,52}$ | |
meter | string | at most 128 characters; matches ^[a-z][a-z0-9_.-]{0,127}$ | |
from | integer | at least 0 | |
to | integer | at least 0 | |
limit | integer | 1-500; default 100 | |
cursor | string | at most 256 characters; matches ^[A-Za-z0-9_-]{1,256}$ |
export
POST /api/compute/usage/export
Exports every usage window of a time range as CSV (the default) or JSON Lines, with the window count and the summed quantity per meter.
-
fromandtoare required, and the range is at most 93 days;tonot afterfrom, or a longer range, isINVALID_INPUT. -
One export returns at most 50,000 windows; when more match,
truncatedistrueand the range or meter should be narrowed. -
CSV has a header row and ISO 8601 timestamps; JSON Lines has one window object per line.
-
Kind: read
-
Authorization:
compute:usage:read@compute-tenantorcompute:usage:read@compute-project -
Module:
server -
Phase: v0.2 (registered)
Input
| Field | Type | Required | Constraints |
|---|---|---|---|
tenantId | string | yes | at most 128 characters; matches ^[A-Za-z0-9._:-]{1,128}$ |
projectId | string | at most 64 characters; matches ^prj_[0-9a-hjkmnp-tv-z]{26,52}$ | |
meter | string | at most 128 characters; matches ^[a-z][a-z0-9_.-]{0,127}$ | |
from | integer | yes | at least 0 |
to | integer | yes | at least 0 |
format | one of csv, jsonl |
Better Compute is created by Sean Filimon
Last updated
tunnels
Interactive access to an instance or a node through its gateway and daemon: exec, SSH, TCP or the serial console of an instance, or the console of a node. The server's tunnels module hosts this group when the deployment configures `tunnels` with an exec ticket issuer. See [Tunnels](/docs/guides/access/tunnels).
webhooks
Per-tenant subscriptions that POST every matching committed event to an HTTPS endpoint, signed with a secret only the tenant and Better Compute know, with at-least-once delivery, retries with backoff, dead letters and redelivery. The events module hosts this group, and every method decides `compute:webhooks:manage` on `compute-tenant/{tenantId}`. See [Webhooks](/docs/guides/events/webhooks).