GenAI Integration

Count tokens (Gemini format)

Counts tokens using Google Gemini API format.

post/genai/v1beta/models/{model}:countTokens

Request

Path parameters

modelstring required

Model name with action (e.g., gemini-pro:countTokens)

Request body

Response

Successful response

totalTokensinteger

Number of tokens that the model tokenizes the prompt into

cachedContentTokenCountinteger

Number of tokens in the cached part of the prompt

Changes

No recorded changes to this operation across all 1 revision of this API.