Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/provider / / WithCostTrackingOptions
Interface: WithCostTrackingOptions
Defined in: packages/provider/src/middleware/with-cost-tracking.ts:35
Options for withCostTracking.
Stable
Properties
| Property | Modifier | Type | Description | Defined in |
|---|---|---|---|---|
onUsage? | readonly | (info) => void | Hook fired on every finish event with the parsed usage. The hook receives the underlying provider's name + modelId so the caller can route into a per-model accumulator. | packages/provider/src/middleware/with-cost-tracking.ts:41 |
priceLookup? | readonly | (info) => | { inputPerMtok?: number; outputPerMtok?: number; } | null | Optional pricing lookup. When set, the middleware computes costUsd from the returned price and surfaces it on the hook. | packages/provider/src/middleware/with-cost-tracking.ts:54 |