Skip to main content

CostBrick

One flat row in a CostBreakdown. cost_eur is the brick's OWN contribution (not a cumulative subtree sum). The parent pointer is resolved by matching parent_brick_id to another brick's id within the same response. Field names are sourced exactly from backend lib/cost_breakdown_types.ts (CostBrick).

idstringrequired

Deterministic brick id (brick_<sha1-prefix>), stable only within a single response payload.

Example: brick_a1b2c3d4e5f6
categorystringrequired

Brick category, used by consumers to group/colour the display.

Possible values: [llm, compute, connector, dataset, platform]

node_idstringrequired

Workflow node this cost is attributed to (e.g. deepAgent-4, mcpServer-7), or platform for synthetic/residue attribution.

parent_brick_idstring | nullnullablerequired

null for a root brick; otherwise the id of the enclosing brick within this response. compute container bricks are typically roots; llm/connector/dataset detail bricks point at their node's compute container.

cost_eurnumberrequired

This brick's own EUR contribution, rounded to 4 decimals. Container bricks are reduced as detail bricks attribute portions back, so the flat sum equals executionCost.

units object

Category-specific detail, intentionally open-ended on the wire (Record<string, unknown>) so new categories can extend it without a schema bump. Observed shapes by category:

  • llm: { model, input_tokens, output_tokens, call_count }
  • compute: { node_type } (container)
  • connector: { connector_id, endpoint_id, billed_units, call_count, unit_price_cents, billed_units_unknown }
  • dataset: { dataset_id, access_count, unit_price_eur, proxy_paths[] }
  • platform: {} (reconciliation residue)
modelstring

llm: the model id.

input_tokensinteger

llm: summed prompt tokens.

output_tokensinteger

llm: summed completion tokens.

call_countinteger

llm/connector: number of underlying calls aggregated into this brick.

node_typestring

compute: the workflow node type.

connector_idinteger

connector.

endpoint_idinteger

connector.

billed_unitsnumber

connector: total billed units.

unit_price_centsnumber

connector: price per unit in cents.

billed_units_unknownboolean

connector: true when unit price was 0/unknown.

dataset_idinteger

dataset.

access_countinteger

dataset: number of accesses.

unit_price_eurnumber

dataset: per-access price in EUR.

proxy_pathsstring[]

dataset: distinct proxy paths accessed.

property name*any

Category-specific detail, intentionally open-ended on the wire (Record<string, unknown>) so new categories can extend it without a schema bump. Observed shapes by category:

  • llm: { model, input_tokens, output_tokens, call_count }
  • compute: { node_type } (container)
  • connector: { connector_id, endpoint_id, billed_units, call_count, unit_price_cents, billed_units_unknown }
  • dataset: { dataset_id, access_count, unit_price_eur, proxy_paths[] }
  • platform: {} (reconciliation residue)
CostBrick
{
"id": "brick_a1b2c3d4e5f6",
"category": "llm",
"node_id": "string",
"parent_brick_id": "string",
"cost_eur": 0,
"units": {
"model": "string",
"input_tokens": 0,
"output_tokens": 0,
"call_count": 0,
"node_type": "string",
"connector_id": 0,
"endpoint_id": 0,
"billed_units": 0,
"unit_price_cents": 0,
"billed_units_unknown": true,
"dataset_id": 0,
"access_count": 0,
"unit_price_eur": 0,
"proxy_paths": [
"string"
]
}
}