Count tokens in a message.
POST/v1/messages/count_tokens
Count the number of tokens in a message request. For some providers, this will cost input tokens and 1 output token.
Request
Responses
- 200
- 400
- 429
- 500
- default
Token count for the request.
Bad Request
Too Many Requests
Internal Server Error
Default Response