Fetch a cost record
const url = 'https://example.com/v1/cost/records/example';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/example \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”CostRecordId — opaque string identifier chosen by the binding.
Responses
Section titled “Responses”Cost record.
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
{ "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": {}}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" }}No cost record with that id under this tenant.
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" }}