Count tokens
POST/v1/messages/count_tokens
Prompt tokens a Messages request would consume. Exact for a concrete Claude model name; an estimate from the platform's Claude counting model for any other alias. Free and unmetered.
Request
Responses
- 200
- 400
- 401
The count.
Malformed body, or a parameter the target model cannot honor and that is refused rather than dropped (param_not_supported, invalid_param, max_tokens_exceeded, model_not_configured).
Missing or invalid Authorization: Bearer mdb_… (invalid_credentials).