Class BetaManagedAgentsSessionThreadUsage
-
- All Implemented Interfaces:
public final class BetaManagedAgentsSessionThreadUsageCumulative token usage for a session thread across all turns.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classBetaManagedAgentsSessionThreadUsage.BuilderA builder for BetaManagedAgentsSessionThreadUsage.
-
Method Summary
Modifier and Type Method Description final Optional<Double>activeSeconds()Cumulative time in seconds this thread spent in running status. final Optional<BetaManagedAgentsCacheCreationUsage>cacheCreation()Tokens used to create prompt cache entries, broken down by cache TTL. final Optional<Integer>cacheReadInputTokens()Total tokens read from prompt cache. final Optional<Integer>inputTokens()Total input tokens consumed across all turns. final Optional<BetaMonetaryAmount>listCost()Cumulative list cost of this thread across all turns, priced at public list rates. final Optional<Integer>outputTokens()Total output tokens generated across all turns. final Optional<BetaManagedAgentsServerToolUsage>serverToolUse()Cumulative server-executed tool usage across all turns of this thread. final JsonField<Double>_activeSeconds()Returns the raw JSON value of activeSeconds. final JsonField<BetaManagedAgentsCacheCreationUsage>_cacheCreation()Returns the raw JSON value of cacheCreation. final JsonField<Integer>_cacheReadInputTokens()Returns the raw JSON value of cacheReadInputTokens. final JsonField<Integer>_inputTokens()Returns the raw JSON value of inputTokens. final JsonField<BetaMonetaryAmount>_listCost()Returns the raw JSON value of listCost. final JsonField<Integer>_outputTokens()Returns the raw JSON value of outputTokens. final JsonField<BetaManagedAgentsServerToolUsage>_serverToolUse()Returns the raw JSON value of serverToolUse. final Map<String, JsonValue>_additionalProperties()final BetaManagedAgentsSessionThreadUsage.BuildertoBuilder()final BetaManagedAgentsSessionThreadUsagevalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static BetaManagedAgentsSessionThreadUsage.Builderbuilder()Returns a mutable builder for constructing an instance of BetaManagedAgentsSessionThreadUsage. -
-
Method Detail
-
activeSeconds
final Optional<Double> activeSeconds()
Cumulative time in seconds this thread spent in running status. Equal to
stats.active_seconds; surfaced here so a thread's usage carries every quantity its cost is priced on.
-
cacheCreation
final Optional<BetaManagedAgentsCacheCreationUsage> cacheCreation()
Tokens used to create prompt cache entries, broken down by cache TTL.
-
cacheReadInputTokens
final Optional<Integer> cacheReadInputTokens()
Total tokens read from prompt cache.
-
inputTokens
final Optional<Integer> inputTokens()
Total input tokens consumed across all turns.
-
listCost
final Optional<BetaMonetaryAmount> listCost()
Cumulative list cost of this thread across all turns, priced at public list rates. Absent until cost tracking is available for the thread. Each figure is rounded to the nearest cent independently and the session's aggregate
usage.list_costadditionally includes session runtime, so per-thread costs do not sum exactly to the session figure; the session figure is authoritative and is what a budget is enforced against.
-
outputTokens
final Optional<Integer> outputTokens()
Total output tokens generated across all turns.
-
serverToolUse
final Optional<BetaManagedAgentsServerToolUsage> serverToolUse()
Cumulative server-executed tool usage across all turns of this thread. Absent until server-tool tracking is available for the thread.
-
_activeSeconds
final JsonField<Double> _activeSeconds()
Returns the raw JSON value of activeSeconds.
Unlike activeSeconds, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheCreation
final JsonField<BetaManagedAgentsCacheCreationUsage> _cacheCreation()
Returns the raw JSON value of cacheCreation.
Unlike cacheCreation, this method doesn't throw if the JSON field has an unexpected type.
-
_cacheReadInputTokens
final JsonField<Integer> _cacheReadInputTokens()
Returns the raw JSON value of cacheReadInputTokens.
Unlike cacheReadInputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_inputTokens
final JsonField<Integer> _inputTokens()
Returns the raw JSON value of inputTokens.
Unlike inputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_listCost
final JsonField<BetaMonetaryAmount> _listCost()
Returns the raw JSON value of listCost.
Unlike listCost, this method doesn't throw if the JSON field has an unexpected type.
-
_outputTokens
final JsonField<Integer> _outputTokens()
Returns the raw JSON value of outputTokens.
Unlike outputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_serverToolUse
final JsonField<BetaManagedAgentsServerToolUsage> _serverToolUse()
Returns the raw JSON value of serverToolUse.
Unlike serverToolUse, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final BetaManagedAgentsSessionThreadUsage.Builder toBuilder()
-
validate
final BetaManagedAgentsSessionThreadUsage validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
builder
final static BetaManagedAgentsSessionThreadUsage.Builder builder()
Returns a mutable builder for constructing an instance of BetaManagedAgentsSessionThreadUsage.
-
-
-
-