Skip to main content
Version: 0.22.0

Interface: SessionUsage

Defined in: core/runner.ts:63

Running totals for the whole query() session so far, not for one turn: the SDK's own total_cost_usd and modelUsage are cumulative across turns in a streaming-input session, so the latest turn-end carries the session total (never sum them).

Properties​

PropertyTypeDescriptionDefined in
cacheReadTokens?numberThe part of inputTokens read from the cache: the context sent again on every call. It grows with each call while the context barely does, so the chat shows it apart.core/runner.ts:70
costUsdnumberAn estimate, not a billing statement.core/runner.ts:73
inputTokensnumberInput tokens, cache reads and writes included, across every model the session used.core/runner.ts:65
outputTokensnumber-core/runner.ts:71