Skip to main content
GET
Serverless spend, grouped and bucketed

Authorizations

Authorization
string
header
required

A workspace-scoped Cloud JWT.

Query Parameters

groupBy
enum<string>
default:deployment

Aggregation key. none collapses every row into a single group. resource answers one group per kind: compute, storage and container_disk. deployment answers one group per deployment, with every release it ran; release answers each release a deployment ran apart.

Available options:
deployment,
user,
gpuClass,
resource,
none,
release
granularity
enum<string>
default:day

Time-bucket size. none returns totals only (breakdown/totals), with an empty buckets array — no series to draw.

Available options:
hour,
day,
week,
month,
none
timezone
string

IANA zone name (e.g. America/Los_Angeles), not a fixed offset. Default UTC. Applies to day/week/month bucketing; irrelevant for hour/none. An unrecognized name is a 400.

startingOn
string<date-time>

Inclusive. Default: 30 days before endingBefore (which itself defaults to the request time), truncated down to the granularity boundary in the requested timezone.

endingBefore
string<date-time>

Exclusive. Default the request time.

deploymentId
string[]

Repeatable. OR within the field. At most 100 values.

Maximum array length: 100
userId
string[]

Repeatable. Required by scope=user (identifies whose spend); usable as a plain narrowing filter under scope=workspace. Rejected under scope=self, which is already the caller. At most 100 values.

Maximum array length: 100
buildId
string[]

Repeatable. OR within the field. At most 100 values. Narrows to deployments cut from these builds; a deployment records the release it came from, and the release records its build.

Maximum array length: 100
resource
enum<string>[]

Repeatable. OR within the field. Omitted, or naming all three kinds, returns every kind together; naming only compute and storage leaves container_disk out.

Maximum array length: 100

What a charge is for. compute is GPU time; storage is the deployment's network volume, which bills continuously whether or not anything runs; container_disk is the worker's own local disk, itemised inside the endpoint's bucket by the provider. It is not charged: its rows are recorded at zero charge, though buckets stored before that change carry a charge for it.

Available options:
compute,
storage,
container_disk
gpuClass
string[]

Repeatable. OR within the field. At most 100 values.

Maximum array length: 100
scope
enum<string>
default:workspace

Whose spend to return. workspace (the default) is every row in the workspace, self is the deployments the caller created, user is the rows for the given userId. Spend is visible workspace-wide to every member, so no scope is role-gated; the workspace comes from the caller's identity and is the only boundary.

Available options:
self,
workspace,
user
sort
enum<string>
default:costDesc

Ranks groups by their total charged amount over the whole filtered set, or by group key. Accepted but inert when groupBy=none, since a single group has no order to rank.

Available options:
costDesc,
costAsc,
keyAsc,
keyDesc
limit
integer
default:20
Required range: 1 <= x <= 100
offset
integer
default:0

Pages groups (not buckets). Default 0.

Required range: x >= 0

Response

OK

groupBy
enum<string>
default:deployment
required

Aggregation key. none collapses every row into a single group. resource answers one group per kind: compute, storage and container_disk. deployment answers one group per deployment, with every release it ran; release answers each release a deployment ran apart.

Available options:
deployment,
user,
gpuClass,
resource,
none,
release
granularity
enum<string>
default:day
required

Time-bucket size. none returns totals only (breakdown/totals), with an empty buckets array — no series to draw.

Available options:
hour,
day,
week,
month,
none
timezone
string
required

The IANA zone actually used (the request's timezone, or UTC).

startingOn
string<date-time>
required
endingBefore
string<date-time>
required
groups
object[]
required

The selected page of groups, in sort order.

buckets
object[]
required

Sparse: a period with no matching rows is omitted, not zero-filled. Only covers the groups on this page. Empty when granularity=none.

breakdown
object[]
required

Per-group totals for the groups on this page, with share.

totalChargedMicroUsd
integer<int64>
required

What the workspace was charged across every group in the filtered set, not just this page.

totalCredits
integer<int64>
required
truncated
boolean
required

True when more groups exist beyond this page (limit/offset).