AgentOptimizationJobTokenUsage Class

  • java.lang.Object
    • com.azure.ai.agents.models.AgentOptimizationJobTokenUsage

Implements

public final class AgentOptimizationJobTokenUsage
implements JsonSerializable<AgentOptimizationJobTokenUsage>

Aggregated token usage for one optimization stage and model.

Method Summary

Modifier and Type Method and Description
static AgentOptimizationJobTokenUsage fromJson(JsonReader jsonReader)

Reads an instance of AgentOptimizationJobTokenUsage from the JsonReader.

Long getCachedTokens()

Get the cachedTokens property: Input tokens served from the model's cache.

Long getInputTokens()

Get the inputTokens property: Total input tokens.

String getModel()

Get the model property: Model name or deployment name that served the calls.

Long getOutputTokens()

Get the outputTokens property: Total output tokens.

Long getReasoningTokens()

Get the reasoningTokens property: Reasoning tokens counted separately by reasoning models.

AgentOptimizationStage getStage()

Get the stage property: Optimization stage that generated these calls.

Long getTotalTokens()

Get the totalTokens property: Sum of input_tokens + output_tokens.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Method Details

fromJson

public static AgentOptimizationJobTokenUsage fromJson(JsonReader jsonReader)

Reads an instance of AgentOptimizationJobTokenUsage from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of AgentOptimizationJobTokenUsage if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getCachedTokens

public Long getCachedTokens()

Get the cachedTokens property: Input tokens served from the model's cache. Included in input_tokens and not additive. If omitted, the service defaults to 0.

Returns:

the cachedTokens value.

getInputTokens

public Long getInputTokens()

Get the inputTokens property: Total input tokens. Omitted when unmeasured.

Returns:

the inputTokens value.

getModel

public String getModel()

Get the model property: Model name or deployment name that served the calls.

Returns:

the model value.

getOutputTokens

public Long getOutputTokens()

Get the outputTokens property: Total output tokens. Omitted when unmeasured.

Returns:

the outputTokens value.

getReasoningTokens

public Long getReasoningTokens()

Get the reasoningTokens property: Reasoning tokens counted separately by reasoning models. Included in output_tokens and not additive. If omitted, the service defaults to 0.

Returns:

the reasoningTokens value.

getStage

public AgentOptimizationStage getStage()

Get the stage property: Optimization stage that generated these calls.

Returns:

the stage value.

getTotalTokens

public Long getTotalTokens()

Get the totalTokens property: Sum of input_tokens + output_tokens. Omitted when unmeasured.

Returns:

the totalTokens value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to