For instance with stripe, it is possible to send metadata with each subscription tier. So you can then get that value that’s passed with a successful checkout and use that as a constant in your db for comparing their tokenage, so if a user gets idk…300,000 tokens in a package, you’d pass that 300,000 with the tier they bought, and then you can use that value how you see fit.
They run input through the chatbot and get a response.
The total tokens for the API call are 1000
My system is 1 credit = 1 token
They get 1000 credits deducted from their balance and now have 4000 left.
Then to ensure they don’t run some huge free transaction through, maybe you have to have a 1000 credit minimum balance to run a transaction.
Either way, I think this is more fair to users as they are only paying for what they use and I don’t have to worry about someone going nuts and running up a big APi bill for me under a $20/month plan or whatever.
Plus I’m building up to a dozen apps in my product system over time, so a universal credit system to use any of the apps that a user wants to use at a given time makesw even more sense to me.
If your concern is to control this, I’m already telling you that you won’t be able to. I have been waiting for a response to my unused consumption problems, and I have been waiting for about 4 days, the API blocked, my users without service. and… with all the services capped, the API continues to spend.