Anthropic Token Counting API
Count the number of tokens in a Message, including tools, images, and documents, without creating it. The Token Count API accepts the same structured list of inputs as Messages including system prompts, tools, images, and PDFs. Free to use but subject to requests-per-minute rate limits.