IntelligenceX
Class

TurnUsage

IntelligenceX.OpenAI.AppServer.Models

Namespace
IntelligenceX.OpenAI.AppServer.Models
Assembly
IntelligenceX
Modifiers
sealed

Represents token usage details for a single turn.

Inheritance

  • object
  • TurnUsage

Usage

Explore 3 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

Returned or exposed by 2

Accepted by parameters 1

Constructors

public TurnUsage(long? inputTokens, long? outputTokens, long? totalTokens, long? cachedInputTokens, long? reasoningTokens, JsonObject raw, JsonObject? additional) #

Initializes a new turn usage model.

Parameters

inputTokens long? required
outputTokens long? required
totalTokens long? required
cachedInputTokens long? required
reasoningTokens long? required
raw IntelligenceX.Json.JsonObject required
additional IntelligenceX.Json.JsonObject? required

Methods

public static TurnUsage? FromJson(JsonObject? obj) #

Parses turn usage from JSON.

Parameters

obj IntelligenceX.Json.JsonObject? required
Source usage object.

Returns

TurnUsage? The parsed usage or null.
public JsonObject ToJson() #

Serializes usage to JSON.

Returns

JsonObject

Properties

public long? InputTokens { get; } #

Gets input/prompt token count.

public long? OutputTokens { get; } #

Gets output/completion token count.

public long? TotalTokens { get; } #

Gets total token count.

public long? CachedInputTokens { get; } #

Gets cached input token count.

public long? ReasoningTokens { get; } #

Gets reasoning token count.

public JsonObject Raw { get; } #

Gets the raw JSON usage object.

public JsonObject? Additional { get; } #

Gets unrecognized fields from the payload.