class

OpenAI::CompletionUsageCompletionTokensDetails

Inherits JSON::Serializable < Reference < Object

Breakdown of tokens used in a completion.

Constructors

new(accepted_prediction_tokens : Int64 | Nil = nil, audio_tokens : Int64 | Nil = nil, reasoning_tokens : Int64 | Nil = nil, rejected_prediction_tokens : Int64 | Nil = nil)
Source
new(*, __pull_for_json_serializable pull : JSON::PullParser)
Source

Instance methods

accepted_prediction_tokens

When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.

Source
accepted_prediction_tokens=(accepted_prediction_tokens : Int64 | Nil)

When using Predicted Outputs, the number of tokens in the prediction that appeared in the completion.

Source
audio_tokens

Audio input tokens generated by the model.

Source
audio_tokens=(audio_tokens : Int64 | Nil)

Audio input tokens generated by the model.

Source
reasoning_tokens

Tokens generated by the model for reasoning.

Source
reasoning_tokens=(reasoning_tokens : Int64 | Nil)

Tokens generated by the model for reasoning.

Source
rejected_prediction_tokens

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.

Source
rejected_prediction_tokens=(rejected_prediction_tokens : Int64 | Nil)

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.

Source