Skip to content

List cost records

GET
/v1/cost/records
curl --request GET \
--url 'https://example.com/v1/cost/records?limit=25&scopeKind=tenant&inherit=true' \
--header 'Authorization: Bearer <token>'

Cursor-paginated. Filters (all AND): runId, agentId, conversationId, category, providerId, from, to. Sort order is fixed: occurredAt desc, id desc. Records represent one accounted resource event each — LLM inference, tool invocation, storage write, sandbox execution, etc.

limit
integer
default: 25 >= 1 <= 100

1..100. Default 25.

cursor
string

Opaque cursor from a prior response. Absent → first page.

runId
string format: uuid

Filter records to this run id (exact match).

agentId
string

Filter records to this agent id (exact match).

conversationId
string format: 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).

from
string format: 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
string format: date-time

ISO 8601 timestamp; records with occurredAt <= to. 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: tenant org project

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 (tenant 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/…).

Page of cost records.

Media typeapplication/json
object
data
required
Array<object>
object
id
required
string
tenantId
required
string format: uuid
category
required

Free-form resource category (llm.inference, tool.invocation, storage.write, sandbox.exec, …). Maps to resourceKind in the runtime.

string
providerId
string
runId
string format: uuid
agentId
string
conversationId
string format: uuid
quantity
required
number
unit
required

Metered unit (tokens, seconds, bytes, …).

string
costUsd
number
occurredAt
required
string format: date-time
metrics

Kind-specific counters (e.g. { promptTokens, completionTokens }).

object
key
additional properties
any
attributes

Free-form filter/display tags — never counters.

object
key
additional properties
any
nextCursor
string
hasMore
required
boolean
Examplegenerated
{
"data": [
{
"id": "example",
"tenantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"category": "example",
"providerId": "example",
"runId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"agentId": "example",
"conversationId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"quantity": 1,
"unit": "example",
"costUsd": 1,
"occurredAt": "2026-04-15T12:00:00Z",
"metrics": {},
"attributes": {}
}
],
"nextCursor": "example",
"hasMore": true
}

Malformed query parameter.

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.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}

Missing / malformed / expired / revoked bearer token.

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.

string
Examplegenerated
{
"error": {
"code": "example",
"message": "example",
"details": {},
"requestId": "example"
}
}