PromptTokensDetails

@Serializable
class PromptTokensDetails(val cachedTokens: Int? = null)

Breakdown of the prompt tokens counted by Usage, returned by the API under the prompt_tokens_details key.

Distinct from the older flat fields Usage.promptCacheHitTokens / Usage.promptCacheMissTokens: both shapes may appear in the same response, and either may be null depending on the model and the API version that served the request.

Constructors

Link copied to clipboard
constructor(cachedTokens: Int? = null)

Properties

Link copied to clipboard

Number of prompt tokens served from the context cache, or null when the server did not report this breakdown.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String