Stay organized with collections
Save and categorize content based on your preferences.
Firebase.AI.CountTokensResponse
The model's response to a count tokens request.
Summary
Properties
|
PromptTokensDetails
|
The breakdown, by modality, of how many tokens are consumed by the prompt.
|
TotalBillableCharacters
|
int
Deprecated.
Use TotalTokens instead; Gemini 2.0 series models and newer are always billed by token count. The total number of billable characters in the text input given to the model as a prompt. |
TotalTokens
|
int
The total number of tokens in the input given to the model as a prompt.
|
Properties
PromptTokensDetails
IReadOnlyList< ModalityTokenCount > Firebase::AI::CountTokensResponse::PromptTokensDetails
The breakdown, by modality, of how many tokens are consumed by the prompt.
TotalBillableCharacters
int Firebase::AI::CountTokensResponse::TotalBillableCharacters
The total number of billable characters in the text input given to the model as a prompt.
Important: This does not include billable image, video or other non-text input. See Firebase AI pricing for details.
Use TotalTokens instead; Gemini 2.0 series models and newer are always billed by token count.
Deprecated.
Use TotalTokens instead; Gemini 2.0 series models and newer are always billed by token count.
TotalTokens
int Firebase::AI::CountTokensResponse::TotalTokens
The total number of tokens in the input given to the model as a prompt.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-07-24 UTC.
[null,null,["Last updated 2025-07-24 UTC."],[],[],null,["# Firebase.AI.CountTokensResponse Struct Reference\n\nFirebase.AI.CountTokensResponse\n===============================\n\nThe model's response to a count tokens request.\n\nSummary\n-------\n\n| ### Properties ||\n|------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [PromptTokensDetails](#struct_firebase_1_1_a_i_1_1_count_tokens_response_1a60965b6a6cf4790205e1a425786eed74) | `IReadOnlyList\u003c `[ModalityTokenCount](/docs/reference/unity/struct/firebase/a-i/modality-token-count#struct_firebase_1_1_a_i_1_1_modality_token_count)` \u003e` The breakdown, by modality, of how many tokens are consumed by the prompt. |\n| [TotalBillableCharacters](#struct_firebase_1_1_a_i_1_1_count_tokens_response_1a6eb175efeeae649f94f3d6e83e497bec) | `int` **[Deprecated.](/docs/reference/unity/deprecated/deprecated)** Use TotalTokens instead; Gemini 2.0 series models and newer are always billed by token count. The total number of billable characters in the text input given to the model as a prompt. |\n| [TotalTokens](#struct_firebase_1_1_a_i_1_1_count_tokens_response_1a4cd653f744e15be9e5ea40748e3c2c39) | `int` The total number of tokens in the input given to the model as a prompt. |\n\nProperties\n----------\n\n### PromptTokensDetails\n\n```c#\nIReadOnlyList\u003c ModalityTokenCount \u003e Firebase::AI::CountTokensResponse::PromptTokensDetails\n``` \nThe breakdown, by modality, of how many tokens are consumed by the prompt. \n\n### TotalBillableCharacters\n\n```c#\nint Firebase::AI::CountTokensResponse::TotalBillableCharacters\n``` \nThe total number of billable characters in the text input given to the model as a prompt.\n\nImportant: This does not include billable image, video or other non-text input. See [Firebase AI pricing](https://firebase.google.com/docs/vertex-ai/pricing) for details.\n\nUse TotalTokens instead; Gemini 2.0 series models and newer are always billed by token count.\n\n**[Deprecated.](/docs/reference/unity/deprecated/deprecated)**Use TotalTokens instead; Gemini 2.0 series models and newer are always billed by token count. \n\n### TotalTokens\n\n```c#\nint Firebase::AI::CountTokensResponse::TotalTokens\n``` \nThe total number of tokens in the input given to the model as a prompt."]]