nr_getTokenCount

This API method helps you to get the number of tokens.