Перейти к основному содержанию
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).