docs-devsite/ai.usagemetadata.md
Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference
{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}
Usage metadata about a GenerateContentResponse<!-- -->.
<b>Signature:</b>
export interface UsageMetadata
| Property | Type | Description |
|---|---|---|
| cachedContentTokenCount | number | The number of tokens in the prompt that were served from the cache. If implicit caching is not active or no content was cached, this will be 0. |
| cacheTokensDetails | ModalityTokenCount<!-- -->[] | Detailed breakdown of the cached tokens by modality (for example, text or image). This list provides granular insight into which parts of the content were cached. |
| candidatesTokenCount | number | |
| candidatesTokensDetails | ModalityTokenCount<!-- -->[] | |
| promptTokenCount | number | |
| promptTokensDetails | ModalityTokenCount<!-- -->[] | |
| thoughtsTokenCount | number | The number of tokens used by the model's internal "thinking" process. |
| toolUsePromptTokenCount | number | The number of tokens used by tools. |
| toolUsePromptTokensDetails | ModalityTokenCount<!-- -->[] | A list of tokens used by tools, broken down by modality. |
| totalTokenCount | number |
The number of tokens in the prompt that were served from the cache. If implicit caching is not active or no content was cached, this will be 0.
<b>Signature:</b>
cachedContentTokenCount?: number;
Detailed breakdown of the cached tokens by modality (for example, text or image). This list provides granular insight into which parts of the content were cached.
<b>Signature:</b>
cacheTokensDetails?: ModalityTokenCount[];
<b>Signature:</b>
candidatesTokenCount: number;
<b>Signature:</b>
candidatesTokensDetails?: ModalityTokenCount[];
<b>Signature:</b>
promptTokenCount: number;
<b>Signature:</b>
promptTokensDetails?: ModalityTokenCount[];
The number of tokens used by the model's internal "thinking" process.
<b>Signature:</b>
thoughtsTokenCount?: number;
The number of tokens used by tools.
<b>Signature:</b>
toolUsePromptTokenCount?: number;
A list of tokens used by tools, broken down by modality.
<b>Signature:</b>
toolUsePromptTokensDetails?: ModalityTokenCount[];
<b>Signature:</b>
totalTokenCount: number;