跳转到主要内容
GET
Serverless spend, grouped and bucketed

授权

Authorization
string
header
必填

A workspace-scoped Cloud JWT.

查询参数

groupBy
enum<string>
默认值: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.

可用选项:
deployment,
user,
gpuClass,
resource,
none,
release
granularity
enum<string>
默认值:day

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

可用选项:
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.

可用选项:
compute,
storage,
container_disk
gpuClass
string[]

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

Maximum array length: 100
scope
enum<string>
默认值: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.

可用选项:
self,
workspace,
user
sort
enum<string>
默认值: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.

可用选项:
costDesc,
costAsc,
keyAsc,
keyDesc
limit
integer
默认值:20
必填范围: 1 <= x <= 100
offset
integer
默认值:0

Pages groups (not buckets). Default 0.

必填范围: x >= 0

响应

OK

groupBy
enum<string>
默认值: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.

可用选项:
deployment,
user,
gpuClass,
resource,
none,
release
granularity
enum<string>
默认值:day
必填

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

可用选项:
hour,
day,
week,
month,
none
timezone
string
必填

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

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

The selected page of groups, in sort order.

buckets
object[]
必填

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[]
必填

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

totalChargedMicroUsd
integer<int64>
必填

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

totalCredits
integer<int64>
必填
truncated
boolean
必填

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