[null,null,["Last updated 2025-06-30 UTC."],[],[],null,["# CountTokensResponse interface\n\nResponse from calling [GenerativeModel.countTokens()](./ai.generativemodel.md#generativemodelcounttokens).\n\n**Signature:** \n\n export interface CountTokensResponse \n\nProperties\n----------\n\n| Property | Type | Description |\n|---------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|----------------------------------------------------------------------------|\n| [promptTokensDetails](./ai.counttokensresponse.md#counttokensresponseprompttokensdetails) | [ModalityTokenCount](./ai.modalitytokencount.md#modalitytokencount_interface)\\[\\] | The breakdown, by modality, of how many tokens are consumed by the prompt. |\n| [totalBillableCharacters](./ai.counttokensresponse.md#counttokensresponsetotalbillablecharacters) | number | |\n| [totalTokens](./ai.counttokensresponse.md#counttokensresponsetotaltokens) | number | The total number of tokens counted across all instances from the request. |\n\nCountTokensResponse.promptTokensDetails\n---------------------------------------\n\nThe breakdown, by modality, of how many tokens are consumed by the prompt.\n\n**Signature:** \n\n promptTokensDetails?: ModalityTokenCount[];\n\nCountTokensResponse.totalBillableCharacters\n-------------------------------------------\n\n\u003e | **Warning:** This API is now obsolete.\n\u003e\n\u003e Use `totalTokens` instead. This property is undefined when using models greater than `gemini-1.5-*`.\n\u003e\n\u003e The total number of billable characters counted across all instances from the request.\n\n**Signature:** \n\n totalBillableCharacters?: number;\n\nCountTokensResponse.totalTokens\n-------------------------------\n\nThe total number of tokens counted across all instances from the request.\n\n**Signature:** \n\n totalTokens: number;"]]