Question about word counting

I am building an Ai powered writing tool and i want to limit the amount of words per month that the ai can generate depending on the users subscription.

Is it possible to make some sort of counter that counts the words that is generated and when the counter hits the limit the applications stops making api calls, or something along those lines. An when a new month hits the counter is set to zero.

My second question, and I have asked a similar question to this one before, but i am still not 100% shore. How do I limit the amount of words per month to a specific subscription.