Skip to main content
GET
List spend summaries

Authorizations

Authorization
string
header
required

Admin API key for organization-level operations (managing projects, API keys). Create one in Settings > API Keys or via POST /api/api-keys. Format: sk-lw-{id}_{secret}.

Query Parameters

group_by
string
required

One or two dimensions, comma separated: virtual_key, end_user, project, model, provider, principal, request_type. A dimension may not repeat. Each row's key is the first dimension's value and group names them all, so two rows may share a key.

Example:

"model,end_user"

bucket
enum<string>
default:none
Available options:
none,
hour,
day
timezone
string
default:UTC
Required string length: 1 - 64
allow_unstable
string
default:false

true, 1, yes for yes; false, 0, no or omitted for no. Case does not matter, so a Python True is accepted as sent.

Example:

"true"

from
integer
required

Milliseconds since the Unix epoch, not seconds. An epoch in seconds is a valid integer here and answers for 1970, so a mismatched unit reads as an empty window rather than as an error.

Required range: x <= 9007199254740991
Example:

1782864000000

to
integer
required

Milliseconds since the Unix epoch, not seconds. An epoch in seconds is a valid integer here and answers for 1970, so a mismatched unit reads as an empty window rather than as an error.

Required range: x <= 9007199254740991
Example:

1782864000000

cursor
string
Maximum string length: 500
limit
integer
default:500
Required range: x <= 1000
project_id
Required string length: 1 - 100
team_id
Required string length: 1 - 100
external_id
Required string length: 1 - 200
virtual_key_id
Required string length: 1 - 100
end_user_id
Required string length: 1 - 256
principal_user_id
Required string length: 1 - 100
model
Required string length: 1 - 200
provider_key
Required string length: 1 - 100
request_type
Required string length: 1 - 50
label
Required string length: 1 - 200
metadata
Required string length: 3 - 640
status
enum<string>

Narrow to one lifecycle status. admitted is not accepted here: a rollup sums the cost of requests past admission, and an admitted request is still in flight with no cost of its own yet. Ask /spend-events for those.

Available options:
success,
error,
confirmed,
failed,
settled

Response

Per-key spend rollups

data
object[]
required
next_cursor
string | null
required