List cost records
const url = 'https://example.com/v1/cost/records?limit=25&scopeKind=tenant&inherit=true';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”1..100. Default 25.
Opaque cursor from a prior response. Absent → first page.
Filter records to this run id (exact match).
Filter records to this agent id (exact match).
Filter records to this conversation id (exact match).
Filter to a specific category (llm.inference, tool.invocation, storage.write, sandbox.exec, …). Exact match.
Filter records to this provider id (exact match).
ISO 8601 timestamp; records with occurredAt >= from. Required on /v1/cost/aggregate (or both endpoints omitted for default last-30-days window).
ISO 8601 timestamp; records with occurredAt <= to. Required on /v1/cost/aggregate (or both endpoints omitted for default last-30-days window).
Discriminator for the ?scopeKind + ?scopeId + ?inherit triplet. Tenant carries no id (implicit from session); org/project require scopeId.
Optional scope discriminator. If absent, no scope filter is applied.
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.
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/…).
Responses
Section titled “Responses”Page of cost records.
object
object
Free-form resource category (llm.inference, tool.invocation, storage.write, sandbox.exec, …). Maps to resourceKind in the runtime.
Metered unit (tokens, seconds, bytes, …).
Kind-specific counters (e.g. { promptTokens, completionTokens }).
object
Free-form filter/display tags — never counters.
object
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.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}Missing / malformed / expired / revoked bearer token.
object
object
Stable machine-readable discriminant. Values match domain error codes (see docs/API-ROUTE-CONVENTIONS.md §4.3).
Optional, kind-specific.
object
Server-assigned request id; also echoed via X-Request-Id header.
Examplegenerated
{ "error": { "code": "example", "message": "example", "details": {}, "requestId": "example" }}