v1

latestOpenAPI 3.1.0Apache 2.02026-07-264001921002.3 KB
GenAI Integration

Count tokens (Gemini format)

Counts tokens using Google Gemini API format.

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

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