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}:countTokensParameters
| Name | In | Required | Description |
|---|---|---|---|
| model | path | Yes | See schema. |
Responses
200
`{ totalTokens }`
400
Invalid request