Cursor-paginated. Filters (all AND): runId (with includeDescendants, its whole subtree), rootRunId, flowId, agentId, conversationId, category, providerId, model, servedModel, from, to. Sort order is fixed: occurredAt desc, id desc. Records represent one accounted resource event each — a model call (categoryllm.inference: one record per call, with its model, usage and what the vendor said about it), tool invocation, storage write, sandbox execution, etc. include=rawUsage adds each model call’s usage as the vendor reported it.
Where the previous page ended: its nextCursor, as it came. A runtime that seals cursors takes one only for the same list, filters and caller, within a day; otherwise 400 bad-input, and the list starts again without it. Absent → first page.
runId
stringformat: uuid
Filter records to this run id (exact match).
agentId
string
Filter records to this agent id (exact match).
conversationId
stringformat: uuid
Filter records to this conversation id (exact match).
category
string
Filter to a specific category (llm.inference, tool.invocation, storage.write, sandbox.exec, …). Exact match.
providerId
string
Filter records to this provider id (exact match).
model
string
Filter model calls to this model, the one actually called (exact match).
servedModel
string
Filter model calls to the exact model version the vendor reported (exact match).
rootRunId
stringformat: uuid
Every record of the run tree whose root is this run: a flow run and the agent turns and sub-flows it started.
flowId
string
Every record of the run trees whose root is a run of this flow (the record’s flowId, exact match): the flow’s spend across its runs, any version.
includeDescendants
boolean
With runId: the run’s records and those of every run it started, at any depth. true or false (default).
from
stringformat: date-time
ISO 8601 timestamp; records with occurredAt >= from. Required on /v1/cost/aggregate (or both endpoints omitted for default last-30-days window).
to
stringformat: date-time
ISO 8601 timestamp; records with occurredAt < to (exclusive). Required on /v1/cost/aggregate (or both endpoints omitted for default last-30-days window).
scopeKind
Discriminator for the ?scopeKind + ?scopeId + ?inherit triplet. Tenant carries no id (implicit from session); org/project require scopeId.
string
Allowed values: tenantorgproject
Optional scope discriminator. If absent, no scope filter is applied.
scopeId
string
>= 1 characters
Required IF scopeKind is org or project. MUST be absent if scopeKind=tenant (the workspace is implicit from the session). Malformed combinations return 400 scope-invalid.
inherit
boolean
default: true
Default true. false = literal-at-this-scope only (admin/audit view). Load-bearing for policy/config-scoped resources (mcp-endpoints); documented no-op for content-scoped resources (agents/flows/tools/…).
include
Array<string>
Allowed values: rawUsage
Extra fields, one or more, comma-separated: include=rawUsage. rawUsage: each model call’s usage object exactly as the vendor reported it.
A model call’s id (categoryllm.inference); its provenance model-call node carries it too.
string
projectId
stringformat: uuid
rootRunId
The root of the record’s run tree (a flow run, for its agent turns).
stringformat: uuid
parentRunId
stringformat: uuid
agentVersion
string
flowId
The flow of the run tree’s root.
string
nodeId
The step that made the call.
string
step
The turn’s step number.
integer
>= 1
purpose
What the call was for, beyond the turn’s own model step: guardrail-judge:<guardrail id>.
string
model
The model actually called.
string
servedModel
The exact model version the vendor reported (vendors alias).
string
fallback
The router picked a fallback provider for the turn.
boolean
status
ok: the provider answered. failed: the call threw.
string
Allowed values: okfailed
usage
The call’s tokens. promptTokens / completionTokens are the totals; cacheReadTokens / cacheWriteTokens are parts of promptTokens, reasoningTokens of completionTokens, present when the provider reports them.
object
promptTokens
required
integer
completionTokens
required
integer
cacheReadTokens
integer
cacheWriteTokens
integer
reasoningTokens
integer
thinking
The call’s thinking. asked without level: nothing was sent (the model doesn’t think, or its adapter doesn’t say). level without asked: the model’s thinking.default. asked and level differ: the level was rounded to one the model takes, and the call warned thinking-level-adjusted.
object
asked
The level the call asked for: the agent’s model settings, or a judge’s lowest.
The vendor’s own fields as they went out ({ "thinkingLevel": "LOW" }, { "reasoning_effort": "low" }); on the AI SDK path, { "reasoning": <the portable value> }.
object
key
additional properties
string
durationMs
integer
finishReason
string
providerRequestId
The vendor’s id for the request.
string
attempts
HTTP attempts the call took, the client’s retries included.
integer
>= 1
error
Why a model call failed (status: failed).
object
message
required
string
rawUsage
The vendor’s own usage object, exactly as it reported it. Only with include=rawUsage.
rate-limit-exceeded with details.limit: "api-requests", on a runtime that sets workspace limits (Kindgi Cloud): this workspace’s limit on API requests a minute is reached, so the request wasn’t run; Retry-After says when to send it again.
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
string
message
required
string
details
Optional, kind-specific.
object
key
additional properties
any
requestId
required
Server-assigned request id; also echoed via X-Request-Id header.
The database was too busy to answer in time (database-busy), or the authorization store couldn’t be reached (authz-backend-unavailable); Retry-After (whole seconds) says when to try again.
Media typeapplication/json
object
error
required
object
code
required
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
string
message
required
string
details
Optional, kind-specific.
object
key
additional properties
any
requestId
required
Server-assigned request id; also echoed via X-Request-Id header.