public sealed class CountTokensResponse : IMessage<CountTokensResponse>, IEquatable<CountTokensResponse>, IDeepCloneable<CountTokensResponse>, IBufferMessage, IMessage
Reference documentation and code samples for the Vertex AI v1beta1 API class CountTokensResponse.
Response message for
[PredictionService.CountTokens][google.cloud.aiplatform.v1beta1.PredictionService.CountTokens].
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-14 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eCountTokensResponse\u003c/code\u003e class is part of the Vertex AI v1beta1 API, specifically used in the \u003ccode\u003ePredictionService.CountTokens\u003c/code\u003e method, and is the response message returned by it.\u003c/p\u003e\n"],["\u003cp\u003eThis class inherits from \u003ccode\u003eobject\u003c/code\u003e and implements several interfaces including \u003ccode\u003eIMessage\u003c/code\u003e, \u003ccode\u003eIEquatable\u003c/code\u003e, \u003ccode\u003eIDeepCloneable\u003c/code\u003e, and \u003ccode\u003eIBufferMessage\u003c/code\u003e, offering capabilities like deep cloning and message handling.\u003c/p\u003e\n"],["\u003cp\u003eThe class includes properties such as \u003ccode\u003ePromptTokensDetails\u003c/code\u003e, which provides a list of modalities processed in the request input, \u003ccode\u003eTotalBillableCharacters\u003c/code\u003e, which indicates the total billable characters, and \u003ccode\u003eTotalTokens\u003c/code\u003e, representing the total number of tokens counted.\u003c/p\u003e\n"],["\u003cp\u003eThere are two versions available in this document, \u003ccode\u003e1.0.0-beta21\u003c/code\u003e being the most recent, with a previous version of \u003ccode\u003e1.0.0-beta20\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCountTokensResponse\u003c/code\u003e class is found in the \u003ccode\u003eGoogle.Cloud.AIPlatform.V1Beta1\u003c/code\u003e namespace, within the \u003ccode\u003eGoogle.Cloud.AIPlatform.V1Beta1.dll\u003c/code\u003e assembly.\u003c/p\u003e\n"]]],[],null,["# Vertex AI v1beta1 API - Class CountTokensResponse (1.0.0-beta47)\n\nVersion latestkeyboard_arrow_down\n\n- [1.0.0-beta47 (latest)](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensResponse)\n- [1.0.0-beta46](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/1.0.0-beta46/Google.Cloud.AIPlatform.V1Beta1.CountTokensResponse) \n\n public sealed class CountTokensResponse : IMessage\u003cCountTokensResponse\u003e, IEquatable\u003cCountTokensResponse\u003e, IDeepCloneable\u003cCountTokensResponse\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Vertex AI v1beta1 API class CountTokensResponse.\n\nResponse message for\n\\[PredictionService.CountTokens\\]\\[google.cloud.aiplatform.v1beta1.PredictionService.CountTokens\\]. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e CountTokensResponse \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[CountTokensResponse](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensResponse), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[CountTokensResponse](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensResponse), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[CountTokensResponse](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.CountTokensResponse), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.AIPlatform.V1Beta1](/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1)\n\nAssembly\n--------\n\nGoogle.Cloud.AIPlatform.V1Beta1.dll\n\nConstructors\n------------\n\n### CountTokensResponse()\n\n public CountTokensResponse()\n\n### CountTokensResponse(CountTokensResponse)\n\n public CountTokensResponse(CountTokensResponse other)\n\nProperties\n----------\n\n### PromptTokensDetails\n\n public RepeatedField\u003cModalityTokenCount\u003e PromptTokensDetails { get; }\n\nOutput only. List of modalities that were processed in the request input.\n\n### TotalBillableCharacters\n\n public int TotalBillableCharacters { get; set; }\n\nThe total number of billable characters counted across all instances from\nthe request.\n\n### TotalTokens\n\n public int TotalTokens { get; set; }\n\nThe total number of tokens counted across all instances from the request."]]