ExtractionModelUsage

data class ExtractionModelUsage constructor(val inputTokens: Int? = null, val outputTokens: Int? = null, val totalTokens: Int? = null, val cachedInputTokens: Int? = null, val reasoningTokens: Int? = null)

Tokens a call actually consumed, as the provider reported them.

Recorded as reported. DICE does not recompute totalTokens from the other two or reconcile them when a provider's arithmetic looks off, because the point of an observed record is what was observed. Providers count cached and reasoning tokens differently and some report neither; absent means the provider said nothing, not zero.

Native usage objects are not stored. These are the portable counts, pulled out of whatever shape the SDK returned.

This is not the framework's own Usage, on purpose: Usage is a final class that cannot be extended, it carries a native SDK usage object this record never stores, and it has no field for cached or reasoning tokens. from converts the three counts Usage does carry and leaves the other two null.

EXPERIMENTAL. The shape may still change while extraction runs (DICE #67) land.

Constructors

Link copied to clipboard
constructor(inputTokens: Int? = null, outputTokens: Int? = null, totalTokens: Int? = null, cachedInputTokens: Int? = null, reasoningTokens: Int? = null)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val cachedInputTokens: Int? = null

Input tokens the provider served from its cache

Link copied to clipboard
val inputTokens: Int? = null

Tokens the provider counted on the way in

Link copied to clipboard
val outputTokens: Int? = null

Tokens the provider counted on the way out

Link copied to clipboard
val reasoningTokens: Int? = null

Output tokens the provider attributed to reasoning

Link copied to clipboard
val totalTokens: Int? = null

The provider's own total, when it gave one