POST Gemini

Gemini countTokens

Gemini's token-counting endpoint. A model served natively on this protocol is counted by its upstream; any other count is an estimate, marked by `x-aiduct-token-count: estimated`. Not billed.

Endpoint

post/v1beta/models/{model}:countTokens

Parameters

NameInRequiredDescription
modelpathYesSee schema.

Responses

200

`{ totalTokens }`

400

Invalid request