Error
A valid request URL is required to generate request examples{
"totalTokens": 123,
"cachedContentTokenCount": 123,
"promptTokensDetails": [
{
"modality": "<string>",
"tokenCount": 123
}
],
"cacheTokensDetails": [
{
"modality": "<string>",
"tokenCount": 123
}
]
}GenAI Integration
Count tokens (Gemini format)
Counts tokens using Google Gemini API format.
POST
/
genai
/
v1beta
/
models
/
{model}
:countTokens
Error
A valid request URL is required to generate request examples{
"totalTokens": 123,
"cachedContentTokenCount": 123,
"promptTokensDetails": [
{
"modality": "<string>",
"tokenCount": 123
}
],
"cacheTokensDetails": [
{
"modality": "<string>",
"tokenCount": 123
}
]
}Authorizations
BearerAuthBasicAuthVirtualKeyAuthApiKeyAuth
Bearer token authentication. Use your provider API key or Bifrost authentication token.
Virtual keys (prefixed with sk-bf-) can also be passed here.
Path Parameters
Model name with action (e.g., gemini-pro:countTokens)
Body
application/json
Response
Successful response
Number of tokens that the model tokenizes the prompt into
Number of tokens in the cached part of the prompt
Modalities processed in the request input
Show child attributes
Show child attributes
Modalities in the cached content
Show child attributes
Show child attributes
Was this page helpful?
⌘I

