One Logo Pool Ball
FoundationModels · IOS API REFERENCE

LanguageModelSession.Usage.Input

struct · iOS 27.0+ · SDK 27.1

struct Input

Token counts for the transcript submitted to the model.

Members (5)

init · iOS 27.0+

init

TypeScript
static init(totalTokenCount: number, cachedTokenCount: number): LanguageModelSession_Usage_Input
Swift declaration
init(totalTokenCount: Int, cachedTokenCount: Int)

Creates an input token count. - Parameters: - totalTokenCount: The total number of input tokens from the transcript. - cachedTokenCount: The number of input tokens served from a cache.

get · iOS 27.0+

totalTokenCount

TypeScript
get totalTokenCount(): number
Swift declaration
var totalTokenCount: Int

The total number of input tokens from the transcript.

set · iOS 27.0+

totalTokenCount

TypeScript
set totalTokenCount(value: number)
Swift declaration
var totalTokenCount: Int

The total number of input tokens from the transcript.

get · iOS 27.0+

cachedTokenCount

TypeScript
get cachedTokenCount(): number
Swift declaration
var cachedTokenCount: Int

The number of input tokens that were served from a cache. This value is always less than or equal to ``totalTokenCount``.

set · iOS 27.0+

cachedTokenCount

TypeScript
set cachedTokenCount(value: number)
Swift declaration
var cachedTokenCount: Int

The number of input tokens that were served from a cache. This value is always less than or equal to ``totalTokenCount``.

Skipped declarations

No declarations were skipped in this snapshot.

All FoundationModels types →