Class: CodexSDK::TokenUsage

Inherits:
Data
  • Object
show all
Defined in:
lib/codex_sdk/options.rb

Overview

Detailed token usage from rollout token_count snapshots.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input_tokens: 0, cached_input_tokens: 0, output_tokens: 0, reasoning_output_tokens: 0, total_tokens: 0) ⇒ TokenUsage

Returns a new instance of TokenUsage.



74
75
76
77
78
79
80
81
82
# File 'lib/codex_sdk/options.rb', line 74

def initialize(
  input_tokens: 0,
  cached_input_tokens: 0,
  output_tokens: 0,
  reasoning_output_tokens: 0,
  total_tokens: 0
)
  super
end

Instance Attribute Details

#cached_input_tokensObject (readonly)

Returns the value of attribute cached_input_tokens

Returns:

  • (Object)

    the current value of cached_input_tokens



67
68
69
# File 'lib/codex_sdk/options.rb', line 67

def cached_input_tokens
  @cached_input_tokens
end

#input_tokensObject (readonly)

Returns the value of attribute input_tokens

Returns:

  • (Object)

    the current value of input_tokens



67
68
69
# File 'lib/codex_sdk/options.rb', line 67

def input_tokens
  @input_tokens
end

#output_tokensObject (readonly)

Returns the value of attribute output_tokens

Returns:

  • (Object)

    the current value of output_tokens



67
68
69
# File 'lib/codex_sdk/options.rb', line 67

def output_tokens
  @output_tokens
end

#reasoning_output_tokensObject (readonly)

Returns the value of attribute reasoning_output_tokens

Returns:

  • (Object)

    the current value of reasoning_output_tokens



67
68
69
# File 'lib/codex_sdk/options.rb', line 67

def reasoning_output_tokens
  @reasoning_output_tokens
end

#total_tokensObject (readonly)

Returns the value of attribute total_tokens

Returns:

  • (Object)

    the current value of total_tokens



67
68
69
# File 'lib/codex_sdk/options.rb', line 67

def total_tokens
  @total_tokens
end