IntelligenceX
Class

TurnUsage

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

Represents token usage details for a single turn.

Inheritance

  • Object
  • TurnUsage

Constructors

public TurnUsage(Nullable<Int64> inputTokens, Nullable<Int64> outputTokens, Nullable<Int64> totalTokens, Nullable<Int64> cachedInputTokens, Nullable<Int64> reasoningTokens, JsonObject raw, JsonObject additional) #

Initializes a new turn usage model.

Parameters

inputTokens System.Nullable{System.Int64} requiredposition: 0
outputTokens System.Nullable{System.Int64} requiredposition: 1
totalTokens System.Nullable{System.Int64} requiredposition: 2
cachedInputTokens System.Nullable{System.Int64} requiredposition: 3
reasoningTokens System.Nullable{System.Int64} requiredposition: 4
raw IntelligenceX.Json.JsonObject requiredposition: 5
additional IntelligenceX.Json.JsonObject requiredposition: 6

Methods

public static TurnUsage FromJson(JsonObject obj) #
Returns: TurnUsage

Parses turn usage from JSON.

Parameters

obj IntelligenceX.Json.JsonObject requiredposition: 0
Source usage object.

Returns

The parsed usage or null.

public JsonObject ToJson() #
Returns: JsonObject

Serializes usage to JSON.

Properties

public Nullable<Int64> InputTokens { get; } #

Gets input/prompt token count.

public Nullable<Int64> OutputTokens { get; } #

Gets output/completion token count.

public Nullable<Int64> TotalTokens { get; } #

Gets total token count.

public Nullable<Int64> CachedInputTokens { get; } #

Gets cached input token count.

public Nullable<Int64> 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.