class

OpenAI::RealtimeResponseUsage

Inherits JSON::Serializable < Reference < Object

Usage statistics for the Response, this will correspond to billing. A Realtime API session will maintain a conversation context and append new Items to the Conversation, thus output from previous turns (text and audio tokens) will become the input for later turns.

Constructors

new(total_tokens : Int64 | Nil = nil, input_tokens : Int64 | Nil = nil, output_tokens : Int64 | Nil = nil, input_token_details : RealtimeResponseUsageInputTokenDetails | Nil = nil, output_token_details : RealtimeResponseUsageOutputTokenDetails | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

input_token_details

Details about the input tokens used in the Response. Cached tokens are tokens from previous turns in the conversation that are included as context for the current response. Cached tokens here are counted as a subset of input tokens, meaning input tokens will include cached and uncached tokens.

Source
input_token_details=(input_token_details : RealtimeResponseUsageInputTokenDetails | Nil)

Details about the input tokens used in the Response. Cached tokens are tokens from previous turns in the conversation that are included as context for the current response. Cached tokens here are counted as a subset of input tokens, meaning input tokens will include cached and uncached tokens.

Source
input_tokens

The number of input tokens used in the Response, including text and audio tokens.

Source
input_tokens=(input_tokens : Int64 | Nil)

The number of input tokens used in the Response, including text and audio tokens.

Source
output_token_details

Details about the output tokens used in the Response.

Source
output_token_details=(output_token_details : RealtimeResponseUsageOutputTokenDetails | Nil)

Details about the output tokens used in the Response.

Source
output_tokens

The number of output tokens sent in the Response, including text and audio tokens.

Source
output_tokens=(output_tokens : Int64 | Nil)

The number of output tokens sent in the Response, including text and audio tokens.

Source
total_tokens

The total number of tokens in the Response including input and output text and audio tokens.

Source
total_tokens=(total_tokens : Int64 | Nil)

The total number of tokens in the Response including input and output text and audio tokens.

Source