Class RealtimeResponseUsage
-
- All Implemented Interfaces:
public final class RealtimeResponseUsage
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
RealtimeResponseUsage.Builder
A builder for RealtimeResponseUsage.
-
Method Summary
Modifier and Type Method Description final Optional<RealtimeResponseUsageInputTokenDetails>
inputTokenDetails()
Details about the input tokens used in the Response. final Optional<Long>
inputTokens()
The number of input tokens used in the Response, including text and audio tokens. final Optional<RealtimeResponseUsageOutputTokenDetails>
outputTokenDetails()
Details about the output tokens used in the Response. final Optional<Long>
outputTokens()
The number of output tokens sent in the Response, including text and audio tokens. final Optional<Long>
totalTokens()
The total number of tokens in the Response including input and output text and audio tokens. final JsonField<RealtimeResponseUsageInputTokenDetails>
_inputTokenDetails()
Returns the raw JSON value of inputTokenDetails. final JsonField<Long>
_inputTokens()
Returns the raw JSON value of inputTokens. final JsonField<RealtimeResponseUsageOutputTokenDetails>
_outputTokenDetails()
Returns the raw JSON value of outputTokenDetails. final JsonField<Long>
_outputTokens()
Returns the raw JSON value of outputTokens. final JsonField<Long>
_totalTokens()
Returns the raw JSON value of totalTokens. final Map<String, JsonValue>
_additionalProperties()
final RealtimeResponseUsage.Builder
toBuilder()
final RealtimeResponseUsage
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static RealtimeResponseUsage.Builder
builder()
Returns a mutable builder for constructing an instance of RealtimeResponseUsage. -
-
Method Detail
-
inputTokenDetails
final Optional<RealtimeResponseUsageInputTokenDetails> inputTokenDetails()
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.
-
inputTokens
final Optional<Long> inputTokens()
The number of input tokens used in the Response, including text and audio tokens.
-
outputTokenDetails
final Optional<RealtimeResponseUsageOutputTokenDetails> outputTokenDetails()
Details about the output tokens used in the Response.
-
outputTokens
final Optional<Long> outputTokens()
The number of output tokens sent in the Response, including text and audio tokens.
-
totalTokens
final Optional<Long> totalTokens()
The total number of tokens in the Response including input and output text and audio tokens.
-
_inputTokenDetails
final JsonField<RealtimeResponseUsageInputTokenDetails> _inputTokenDetails()
Returns the raw JSON value of inputTokenDetails.
Unlike inputTokenDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_inputTokens
final JsonField<Long> _inputTokens()
Returns the raw JSON value of inputTokens.
Unlike inputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_outputTokenDetails
final JsonField<RealtimeResponseUsageOutputTokenDetails> _outputTokenDetails()
Returns the raw JSON value of outputTokenDetails.
Unlike outputTokenDetails, this method doesn't throw if the JSON field has an unexpected type.
-
_outputTokens
final JsonField<Long> _outputTokens()
Returns the raw JSON value of outputTokens.
Unlike outputTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_totalTokens
final JsonField<Long> _totalTokens()
Returns the raw JSON value of totalTokens.
Unlike totalTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final RealtimeResponseUsage.Builder toBuilder()
-
validate
final RealtimeResponseUsage validate()
-
builder
final static RealtimeResponseUsage.Builder builder()
Returns a mutable builder for constructing an instance of RealtimeResponseUsage.
-
-
-
-