# Count tokens

URL: https://docs.router.ezat.io/reference/api/countMessageTokens

> Counts the input tokens a Messages request would use, without running the model. It is free and isn't billed or listed in your usage, but it counts toward your key's requests per minute.

The body is the same as for creating a message. `model` and a non-empty `messages` are required. `max_tokens` and `stream` are accepted and ignored. The `anthropic-beta` header is not passed on.


## POST /v1/messages/count_tokens

Counts the input tokens a Messages request would use, without running the model. It is free and isn't billed or listed in your usage, but it counts toward your key's requests per minute.

The body is the same as for creating a message. `model` and a non-empty `messages` are required. `max_tokens` and `stream` are accepted and ignored. The `anthropic-beta` header is not passed on.


Full request and response schemas: https://docs.router.ezat.io/openapi.yaml