[beta] Anthropic Messages Token Counting
Count Tokens
Changed onCount tokens for Anthropic Messages API format.
This endpoint follows the Anthropic Messages API token counting specification. It accepts the same parameters as the /v1/messages endpoint but returns token counts instead of generating a response.
Example usage:
curl -X POST "http://localhost:4000/v1/messages/count_tokens?beta=true" -H "Content-Type: application/json" -H "Authorization: Bearer your-key" -d '{
"model": "claude-3-sonnet-20240229",
"messages": [{"role": "user", "content": "Hello Claude!"}]
}'
Returns: {"input_tokens": <number>}
post/v1/messages/count_tokens
Request
- Base URLhttps://api.flock.io (the document declares no server; this is the origin it was published from)
- URLhttps://api.flock.io/v1/messages/count_tokens
- AuthAPI key in header x-litellm-api-key
Response
Successful Response
unknown required
Changes
- info
api tag
[beta] Anthropic Messages Token Countingadded - info
api tag
anthropic_passthroughremoved
- info
- info
api tag
anthropic_passthroughadded - info
api tag
[beta] Anthropic Messages Token Countingremoved
- info