Graphorin API reference v0.7.0
Graphorin API reference / @graphorin/core / / Cost
Interface: Cost
Defined in: packages/core/src/types/usage.ts:46
Money figure attached to a Usage. Always carries a 3-letter currency code so that consumers can perform aggregation safely.
Stable
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
amount | number | Amount in WHOLE units of currency - for USD that is dollars, and fractional values are expected (a typical LLM call costs a fraction of a cent, e.g. 0.0042). This is deliberately NOT "minor units" / cents (W-045): the canonical producer - calculateCost in @graphorin/pricing - and every consumer (CostTracker in @graphorin/observability, the memory consolidator's costUsd budget, persisted checkpoints) already operate in whole currency units, and sub-cent per-call figures make minor units impractical. Do not divide by 100. | packages/core/src/types/usage.ts:58 |
currency | string | ISO-4217 currency code; default 'USD'. | packages/core/src/types/usage.ts:60 |