OpenAIResponsesUsage
@Serializable
Token usage statistics from an OpenAI Responses API response.
Example:
{
"input_tokens": 10,
"output_tokens": 20,
"total_tokens": 30,
"input_tokens_details": { "cached_tokens": 4 },
"output_tokens_details": { "reasoning_tokens": 5 }
}Content copied to clipboard
Constructors
Link copied to clipboard
constructor(inputTokens: Int, outputTokens: Int, totalTokens: Int, inputTokensDetails: OpenAIResponsesInputTokensDetails? = null, outputTokensDetails: OpenAIResponsesOutputTokensDetails? = null)
Properties
Link copied to clipboard
Number of tokens in the input.
Link copied to clipboard
@SerialName(value = "input_tokens_details")
Breakdown of input tokens (e.g. cached tokens). null when details are not included.
Link copied to clipboard
Number of tokens in the output.
Link copied to clipboard
@SerialName(value = "output_tokens_details")
Breakdown of output tokens (e.g. reasoning tokens). null when details are not included.
Link copied to clipboard
Total number of tokens (input + output).