completion_tokens: number

Number of tokens in the generated completion.

prompt_tokens: number

Number of tokens in the prompt.

total_tokens: number

Total number of tokens used in the request (prompt + completion).

completion_tokens_details?: CompletionTokensDetails { accepted_prediction_tokens, audio_tokens, reasoning_tokens, 2 more }

Breakdown of tokens used in a completion.

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.

text_tokens?: number

Text output tokens generated by the model.

prompt_tokens_details?: PromptTokensDetails { audio_tokens, cache_write_tokens, cached_tokens, 2 more }

Breakdown of tokens used in the prompt.

audio_tokens?: number

Audio input tokens present in the prompt.

cache_write_tokens?: number

The unadjusted number of prompt tokens written to cache.

cached_tokens?: number

Cached tokens present in the prompt.

image_tokens?: number

Image input tokens present in the prompt.

text_tokens?: number

Text input tokens present in the prompt.