CountTokensResponse

class CountTokensResponse


The model's response to a count tokens request.

Important: The counters in this class do not include billable image, video or other non-text input. See Pricing for details.

Summary

Public functions

operator Int
operator List<ModalityTokenCount>

Public properties

List<ModalityTokenCount>

The breakdown, by modality, of how many tokens are consumed by the prompt.

Int

The total number of tokens in the input given to the model as a prompt.

Public functions

component1

operator fun component1(): Int

component2

operator fun component2(): List<ModalityTokenCount>

Public properties

promptTokensDetails

val promptTokensDetails: List<ModalityTokenCount>

The breakdown, by modality, of how many tokens are consumed by the prompt.

totalTokens

val totalTokens: Int

The total number of tokens in the input given to the model as a prompt.