UsageUpdatedEvent
@forge/monorepo / backend/src / UsageUpdatedEvent
Type Alias: UsageUpdatedEvent
UsageUpdatedEvent =
EventBase<"usage.updated"> &object
Defined in: backend/src/core/events.ts:127
Type Declaration
audioSeconds?
readonlyoptionalaudioSeconds?:number
cachedInputTokens?
readonlyoptionalcachedInputTokens?:number
cacheWriteTokens?
readonlyoptionalcacheWriteTokens?:number
Tokens written into a prompt cache — task #247. Absent means the provider reported no breakdown.
costMinorUnits?
readonlyoptionalcostMinorUnits?:number
currency?
readonlyoptionalcurrency?:string
imageCount?
readonlyoptionalimageCount?:number
Non-text input this step carried — #185 AC-4.
On the event, not only in the cost, so the ledger can say why a step cost what it did. A multimodal turn and a text turn that happened to price the same are otherwise indistinguishable after the fact, which makes a pricing mistake invisible.
inputTokens
readonlyinputTokens:number
modelId?
readonlyoptionalmodelId?:string
When present, the worker records a durable UsageEvent for this realized step.
outputTokens
readonlyoutputTokens:number
reasoningTokens?
readonlyoptionalreasoningTokens?:number
stepId?
readonlyoptionalstepId?:string
Stable per-step id so recording is idempotent across a recovery.