One Logo Pool Ball
FoundationModels · IOS API REFERENCE

LanguageModelSession.Usage.Output

struct · iOS 27.0+ · SDK 27.1

struct Output

Token counts for the output produced by the model.

Members (5)

init · iOS 27.0+

init

TypeScript
static init(totalTokenCount: number, reasoningTokenCount: number): LanguageModelSession_Usage_Output
Swift declaration
init(totalTokenCount: Int, reasoningTokenCount: Int)

Creates an output token count. - Parameters: - totalTokenCount: The total number of output tokens. - reasoningTokenCount: The number of output tokens from reasoning.

get · iOS 27.0+

totalTokenCount

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

The total number of output tokens.

set · iOS 27.0+

totalTokenCount

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

The total number of output tokens.

get · iOS 27.0+

reasoningTokenCount

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

The number of output tokens that were part of the model's reasoning output. This value is always less than or equal to ``totalTokenCount``. A non-zero value requires the model to declare the ``LanguageModelCapabilities/Capability/reasoning`` capability.

set · iOS 27.0+

reasoningTokenCount

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

The number of output tokens that were part of the model's reasoning output. This value is always less than or equal to ``totalTokenCount``. A non-zero value requires the model to declare the ``LanguageModelCapabilities/Capability/reasoning`` capability.

Skipped declarations

No declarations were skipped in this snapshot.

All FoundationModels types →