Anthropic has released some exciting beta features within the last couple of days which have largely gone under the radar. Considered one of these was the power to process PDFs with their models, which may now understand each text and visual content inside PDF documents. I’ll perhaps write up something on that at a later date.
The opposite exciting beta feature, and the topic of this text, was the introduction of token counting. Crucially, you’ll be able to count the tokens in user messages, PDFs and pictures before you send them to Claude. This is superb news for individuals who like to observe their token usage costs closely.
In keeping with the official announcement from Anthropic (link here),
“The token counting endpoint accepts the identical structured list of inputs for making a message, including support for system prompts, tools, images, and PDFs. The response incorporates the full variety of input tokens.”
And supports the next models,
“Claude 3.5 Sonnet
Claude 3.5 Haiku
Claude 3 Haiku
Claude 3 Opus”