Utilities
Estimate Token Count
Estimates the number of tokens that would be used for a given set of messages and model. The input structure is almost identical to that of chat completion.
post/v1/tokenizers/estimate-token-count
Request
- Base URL: https://api.moonshot.ai
- URL: https://api.moonshot.ai/v1/tokenizers/estimate-token-count
- Auth: HTTP bearer
Request body
Example request
{
"messages": [
{
"role": "user"
}
]
}Response
Token count estimation
Example response
{
"data": {
"total_tokens": 80
}
}Changes
No recorded changes to this operation across all 1 revision of this API.