Breakdown of tokens used in a completion.

interface CompletionTokensDetails {
    accepted_prediction_tokens?: number;
    audio_tokens?: number;
    reasoning_tokens?: number;
    rejected_prediction_tokens?: number;
}

Properties

accepted_prediction_tokens?: number

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

audio_tokens?: number

Audio input tokens generated by the model.

reasoning_tokens?: number

Tokens generated by the model for reasoning.

rejected_prediction_tokens?: number

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.