Class CompletionUsage.CompletionTokensDetails
-
- All Implemented Interfaces:
public final class CompletionUsage.CompletionTokensDetails
Breakdown of tokens used in a completion.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final class
CompletionUsage.CompletionTokensDetails.Builder
A builder for CompletionTokensDetails.
-
Method Summary
Modifier and Type Method Description final Optional<Long>
acceptedPredictionTokens()
When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion. final Optional<Long>
audioTokens()
Audio input tokens generated by the model. final Optional<Long>
reasoningTokens()
Tokens generated by the model for reasoning. final Optional<Long>
rejectedPredictionTokens()
When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. final JsonField<Long>
_acceptedPredictionTokens()
Returns the raw JSON value of acceptedPredictionTokens. final JsonField<Long>
_audioTokens()
Returns the raw JSON value of audioTokens. final JsonField<Long>
_reasoningTokens()
Returns the raw JSON value of reasoningTokens. final JsonField<Long>
_rejectedPredictionTokens()
Returns the raw JSON value of rejectedPredictionTokens. final Map<String, JsonValue>
_additionalProperties()
final CompletionUsage.CompletionTokensDetails.Builder
toBuilder()
final CompletionUsage.CompletionTokensDetails
validate()
final Boolean
isValid()
Boolean
equals(Object other)
Integer
hashCode()
String
toString()
final static CompletionUsage.CompletionTokensDetails.Builder
builder()
Returns a mutable builder for constructing an instance of CompletionTokensDetails. -
-
Method Detail
-
acceptedPredictionTokens
final Optional<Long> acceptedPredictionTokens()
When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.
-
audioTokens
final Optional<Long> audioTokens()
Audio input tokens generated by the model.
-
reasoningTokens
final Optional<Long> reasoningTokens()
Tokens generated by the model for reasoning.
-
rejectedPredictionTokens
final Optional<Long> rejectedPredictionTokens()
When using Predicted Outputs, the number of tokens in the prediction that did not appear in the completion. However, like reasoning tokens, these tokens are still counted in the total completion tokens for purposes of billing, output, and context window limits.
-
_acceptedPredictionTokens
final JsonField<Long> _acceptedPredictionTokens()
Returns the raw JSON value of acceptedPredictionTokens.
Unlike acceptedPredictionTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_audioTokens
final JsonField<Long> _audioTokens()
Returns the raw JSON value of audioTokens.
Unlike audioTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_reasoningTokens
final JsonField<Long> _reasoningTokens()
Returns the raw JSON value of reasoningTokens.
Unlike reasoningTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_rejectedPredictionTokens
final JsonField<Long> _rejectedPredictionTokens()
Returns the raw JSON value of rejectedPredictionTokens.
Unlike rejectedPredictionTokens, this method doesn't throw if the JSON field has an unexpected type.
-
_additionalProperties
final Map<String, JsonValue> _additionalProperties()
-
toBuilder
final CompletionUsage.CompletionTokensDetails.Builder toBuilder()
-
validate
final CompletionUsage.CompletionTokensDetails validate()
-
builder
final static CompletionUsage.CompletionTokensDetails.Builder builder()
Returns a mutable builder for constructing an instance of CompletionTokensDetails.
-
-
-
-