Class: Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadUsage

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb,
sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, inspect, #inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(active_seconds: nil, cache_creation: nil, cache_read_input_tokens: nil, input_tokens: nil, list_cost: nil, output_tokens: nil, server_tool_use: nil) ⇒ BetaManagedAgentsSessionThreadUsage

Cumulative token usage for a session thread across all turns.

Some parameter documentations has been truncated, see Anthropic::Models::Beta::Sessions::BetaManagedAgentsSessionThreadUsage for more details.

Parameters:

  • active_seconds (Float) (defaults to: nil) —

    Cumulative time in seconds this thread spent in running status. Equal to

  • cache_creation (Anthropic::Models::Beta::BetaManagedAgentsCacheCreationUsage) (defaults to: nil) —

    Tokens used to create prompt cache entries, broken down by cache TTL.

  • cache_read_input_tokens (Integer) (defaults to: nil) —

    Total tokens read from prompt cache.

  • input_tokens (Integer) (defaults to: nil) —

    Total input tokens consumed across all turns.

  • list_cost (Anthropic::Models::BetaMonetaryAmount, nil) (defaults to: nil) —

    Cumulative list cost of this thread across all turns, priced at public list rate

  • output_tokens (Integer) (defaults to: nil) —

    Total output tokens generated across all turns.

  • server_tool_use (Anthropic::Models::Beta::BetaManagedAgentsServerToolUsage, nil) (defaults to: nil) —

    Cumulative server-executed tool usage across all turns of this thread. Absent un

  • active_seconds: (Float) (defaults to: nil)
  • cache_creation: (Anthropic::Beta::BetaManagedAgentsCacheCreationUsage) (defaults to: nil)
  • cache_read_input_tokens: (Integer) (defaults to: nil)
  • input_tokens: (Integer) (defaults to: nil)
  • list_cost: (Anthropic::BetaMonetaryAmount, nil) (defaults to: nil)
  • output_tokens: (Integer) (defaults to: nil)
  • server_tool_use: (Anthropic::Beta::BetaManagedAgentsServerToolUsage, nil) (defaults to: nil)


# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 58

Instance Attribute Details

#active_seconds ⇒ Float?

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.

Parameters:

  • (Float)

Returns:

  • (Float, nil)


14
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 14

optional :active_seconds, Float

#cache_creation ⇒ Anthropic::Models::Beta::BetaManagedAgentsCacheCreationUsage?

Tokens used to create prompt cache entries, broken down by cache TTL.

Parameters:

  • (Anthropic::Beta::BetaManagedAgentsCacheCreationUsage)

Returns:



20
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 20

optional :cache_creation, -> { Anthropic::Beta::BetaManagedAgentsCacheCreationUsage }

#cache_read_input_tokens ⇒ Integer?

Total tokens read from prompt cache.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


26
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 26

optional :cache_read_input_tokens, Integer

#input_tokens ⇒ Integer?

Total input tokens consumed across all turns.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


32
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 32

optional :input_tokens, Integer

#list_cost ⇒ Anthropic::Models::BetaMonetaryAmount?

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_cost additionally 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.

Parameters:

Returns:



43
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 43

optional :list_cost, -> { Anthropic::BetaMonetaryAmount }, nil?: true

#output_tokens ⇒ Integer?

Total output tokens generated across all turns.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


49
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 49

optional :output_tokens, Integer

#server_tool_use ⇒ Anthropic::Models::Beta::BetaManagedAgentsServerToolUsage?

Cumulative server-executed tool usage across all turns of this thread. Absent until server-tool tracking is available for the thread.

Parameters:

  • value (Anthropic::Beta::BetaManagedAgentsServerToolUsage, nil)

Returns:



56
# File 'lib/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rb', line 56

optional :server_tool_use, -> { Anthropic::Beta::BetaManagedAgentsServerToolUsage }, nil?: true

Instance Method Details

#to_hash ⇒ { active_seconds: Float, cache_creation: Anthropic::Beta::BetaManagedAgentsCacheCreationUsage, cache_read_input_tokens: Integer, input_tokens: Integer, list_cost: Anthropic::BetaMonetaryAmount?, output_tokens: Integer, server_tool_use: Anthropic::Beta::BetaManagedAgentsServerToolUsage? }

Returns:

  • ({ active_seconds: Float, cache_creation: Anthropic::Beta::BetaManagedAgentsCacheCreationUsage, cache_read_input_tokens: Integer, input_tokens: Integer, list_cost: Anthropic::BetaMonetaryAmount?, output_tokens: Integer, server_tool_use: Anthropic::Beta::BetaManagedAgentsServerToolUsage? })


53
54
55
56
57
58
59
60
61
# File 'sig/anthropic/models/beta/sessions/beta_managed_agents_session_thread_usage.rbs', line 53

def to_hash: -> {
  active_seconds: Float,
  cache_creation: Anthropic::Beta::BetaManagedAgentsCacheCreationUsage,
  cache_read_input_tokens: Integer,
  input_tokens: Integer,
  list_cost: Anthropic::BetaMonetaryAmount?,
  output_tokens: Integer,
  server_tool_use: Anthropic::Beta::BetaManagedAgentsServerToolUsage?
}