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.
public final class
RealtimeResponseUsage.InputTokenDetails
Details about the input tokens used in the Response.
public final class
RealtimeResponseUsage.OutputTokenDetails
Details about the output tokens used in the Response.
-
Method Summary
Modifier and Type Method Description final Optional<RealtimeResponseUsage.InputTokenDetails>
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<RealtimeResponseUsage.OutputTokenDetails>
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<RealtimeResponseUsage.InputTokenDetails>
_inputTokenDetails()
Returns the raw JSON value of inputTokenDetails. final JsonField<Long>
_inputTokens()
Returns the raw JSON value of inputTokens. final JsonField<RealtimeResponseUsage.OutputTokenDetails>
_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<RealtimeResponseUsage.InputTokenDetails> inputTokenDetails()
Details about the input tokens used in the Response.
-
inputTokens
final Optional<Long> inputTokens()
The number of input tokens used in the Response, including text and audio tokens.
-
outputTokenDetails
final Optional<RealtimeResponseUsage.OutputTokenDetails> 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<RealtimeResponseUsage.InputTokenDetails> _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<RealtimeResponseUsage.OutputTokenDetails> _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.
-
-
-
-