Skip to content

Fetch a cost record

GET
/v1/cost/records/{recordId}
curl --request GET \
--url https://example.com/v1/cost/records/example \
--header 'Authorization: Bearer <token>'
recordId
required
string

CostRecordId — opaque string identifier chosen by the binding.

Cost record.

Media typeapplication/json
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
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.

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"
}
}

No cost record with that id under this tenant.

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"
}
}