# ThreadUsageSummary

Represents cumulative token usage for a thread/session.

Class 

`IntelligenceX.OpenAI.AppServer.Models`

**Namespace**

`IntelligenceX.OpenAI.AppServer.Models`

**Assembly**

`IntelligenceX`

**Source**

[ThreadInfo.cs:89](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L89)

**Modifiers**

sealed

Represents cumulative token usage for a thread/session.

## Inheritance

- object
- ThreadUsageSummary

## 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

- Property [ThreadInfo.UsageSummary](/api/intelligencex-openai-appserver-models-threadinfo/#property-usagesummary)
- Method [ThreadUsageSummary.FromJson](/api/intelligencex-openai-appserver-models-threadusagesummary/#method-fromjson-intelligencex-json-jsonobject)

### Accepted by parameters 1

- Constructor [ThreadInfo.ThreadInfo](/api/intelligencex-openai-appserver-models-threadinfo/#constructor-ctor-string-string-string-nullable-system-datetimeoffset-nullable-system-datetimeoffset-intelligencex-json-jsonobject-intelligencex-json-jsonobject-intelligencex-openai-appserver-models-threadusagesummary) parameter `usageSummary`

Filter members 

Show inherited

## Constructors

`public ThreadUsageSummary(long? inputTokens, long? outputTokens, long? totalTokens, int? turns, JsonObject raw, JsonObject? additional)` [#](#constructor-ctor-nullable-system-int64-nullable-system-int64-nullable-system-int64-nullable-system-int32-intelligencex-json-jsonobject-intelligencex-json-jsonobject)

[ThreadInfo.cs:89](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L89)

Initializes a new usage summary model.

Parameters

**inputTokens long? required**

**outputTokens long? required**

**totalTokens long? required**

**turns int? required**

**raw IntelligenceX.Json.JsonObject required**

**additional IntelligenceX.Json.JsonObject? required**

## Methods

`public static ThreadUsageSummary? FromJson(JsonObject? obj)` [#](#method-fromjson-intelligencex-json-jsonobject)

[ThreadInfo.cs:130](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L130)

Parses usage summary from JSON.

Parameters

**obj IntelligenceX.Json.JsonObject? required**

Source JSON object.

Returns

`ThreadUsageSummary?` The parsed summary or null.

`public JsonObject ToJson()` [#](#method-tojson)

[ThreadInfo.cs:150](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L150)

Serializes usage summary to JSON.

Returns

`JsonObject`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public long? InputTokens { get; }` [#](#property-inputtokens)

[ThreadInfo.cs:102](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L102)

Gets cumulative input token count.

`public long? OutputTokens { get; }` [#](#property-outputtokens)

[ThreadInfo.cs:106](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L106)

Gets cumulative output token count.

`public long? TotalTokens { get; }` [#](#property-totaltokens)

[ThreadInfo.cs:110](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L110)

Gets cumulative total token count.

`public int? Turns { get; }` [#](#property-turns)

[ThreadInfo.cs:114](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L114)

Gets number of turns with usage recorded.

`public JsonObject Raw { get; }` [#](#property-raw)

[ThreadInfo.cs:118](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L118)

Gets the raw JSON object.

`public JsonObject? Additional { get; }` [#](#property-additional)

[ThreadInfo.cs:122](https://github.com/EvotecIT/IntelligenceX/blob/master/IntelligenceX/Providers/OpenAI/AppServer/Models/ThreadInfo.cs#L122)

Gets unrecognized fields from the payload.

<!-- PowerForge markdown artifact sha256:378B745B4BC01186FFD09F0EE11D0D0FA096DE74B6E8B413BDB9172E54474788 -->
