Count tokens
Count the input tokens of a Messages request without running it.
POST https://code.test.indicia-ai.com/v1/messages/count_tokensCounts the input tokens of a Messages request without running it. It takes
the same body as /v1/messages, without
max_tokens. It counts toward a service token's requests per minute, not its
tokens per day.
Example request
curl https://code.test.indicia-ai.com/v1/messages/count_tokens \
-H "x-api-key: $INDICIA_TOKEN" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-sonnet-5-5",
"messages": [{"role": "user", "content": "Say hello"}]
}'Response
{"input_tokens": 12}