CostSample
Auto-generated API reference for CostSample.
Interface: CostSample
Defined in: observability/src/cost-chargeback.ts:16
Chargeback / cost-attribution exporter. Group LLM call samples by tenant + (user | skill | tool | model | custom) and produce CSV / JSON for finance dashboards or per-tenant invoicing.
Inputs are caller-supplied CostSample[] rows. Wire your runtime
to emit one sample per llm:end event (the multiTenantCostGuard
already tracks the same data β feed its observer hook into a
persistence layer to build the sample set).
Closes #790.
#Properties
#at
at:
string
Defined in: observability/src/cost-chargeback.ts:18
ISO 8601 β when the call completed.
#completionTokens
completionTokens:
number
Defined in: observability/src/cost-chargeback.ts:28
#costUsd?
optionalcostUsd?:number
Defined in: observability/src/cost-chargeback.ts:33
Pre-computed cost in USD. When omitted, chargebackReport will
compute it from the (model, token counts, prices) triple.
#model
model:
string
Defined in: observability/src/cost-chargeback.ts:26
Model id used for this call.
#promptTokens
promptTokens:
number
Defined in: observability/src/cost-chargeback.ts:27
#skill?
optionalskill?:string
Defined in: observability/src/cost-chargeback.ts:23
Optional skill / tool that drove the call.
#tenant
tenant:
string
Defined in: observability/src/cost-chargeback.ts:19
#tool?
optionaltool?:string
Defined in: observability/src/cost-chargeback.ts:24
#user?
optionaluser?:string
Defined in: observability/src/cost-chargeback.ts:21
Optional acting user id within the tenant.