Count message tokens including MCP servers (beta)
One step with Anthropic. We can help you get access.
Look something up
Count message tokens including MCP servers (beta)
with Anthropic · Model Inference
Use Anthropic: its Anthropic Messages API lets you count message tokens including MCP servers (beta) in a single step (POST /v1/messages/count_tokens?beta=true). capabilities.work can help you get signed up and connected.
- Can I count tokens for a prompt that uses MCP servers or context management?
- What's the beta-flag token counter for requests with an output format?
Say it to your AI assistant
- With the beta flag, count tokens for {messages} on {model} including MCP servers {mcp_servers}.
- Tally beta token usage for {messages} on {model} with context management {context_management}.
For your developer
POST /v1/messages/count_tokens?beta=true in Anthropic Messages API. Full spec on APIs.io.