Usage
Defined in: src/models/streaming.ts:371
Token usage statistics for a model invocation. Tracks input, output, and total tokens, plus cache-related metrics.
Properties
Section titled “Properties”inputTokens
Section titled “inputTokens”inputTokens: number;Defined in: src/models/streaming.ts:375
Number of tokens in the input (prompt).
outputTokens
Section titled “outputTokens”outputTokens: number;Defined in: src/models/streaming.ts:380
Number of tokens in the output (completion).
totalTokens
Section titled “totalTokens”totalTokens: number;Defined in: src/models/streaming.ts:385
Total number of tokens (input + output).
cacheReadInputTokens?
Section titled “cacheReadInputTokens?”optional cacheReadInputTokens: number;Defined in: src/models/streaming.ts:391
Number of input tokens read from cache. This can reduce latency and cost.
cacheWriteInputTokens?
Section titled “cacheWriteInputTokens?”optional cacheWriteInputTokens: number;Defined in: src/models/streaming.ts:397
Number of input tokens written to cache. These tokens can be reused in future requests.