Skip to content

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

PropertyModifierTypeDescriptionDefined in
onUsage?readonly(info) => voidHook 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; } | nullOptional 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