Count of input (or prompt) tokens. Sum of all input token types.
Count of output (or completion) tokens. Sum of all output token types.
Total token count. Sum of input_tokens + output_tokens.
Optional
input_cost?: numberThe cost of the input tokens.
Optional
input_cost_details?: Record<string, unknown>The cost details of the input tokens.
Optional
input_token_details?: InputTokenDetailsBreakdown of input token counts.
Does not need to sum to full input token count. Does not need to have all keys.
Optional
output_cost?: numberThe cost of the output tokens.
Optional
output_cost_details?: Record<string, unknown>The cost details of the output tokens.
Optional
output_token_details?: OutputTokenDetailsBreakdown of output token counts.
Does not need to sum to full output token count. Does not need to have all keys.
Optional
total_cost?: numberThe total cost of the tokens.
Usage metadata for a message, such as token counts.