A credit-based pricing model, otherwise known as internal or virtual currency, is widely adopted in "Swiss Army Knife"-kind of API products that provide a rich set of APIs for many applications.
If you're an API developer or considering developing an API and making money with it, this pricing model might be a good fit.

The idea is simple: the user buys some amount of internal currency upfront, be it "coins", "atoms", "credits" or anything else. Each call to an API endpoint consumes some number of these units. Calls to different APIs can all consume the same amount of internal currency, or each endpoint can have its own price.
If pricing model is somewhat complex, it can be confusing for the customers, as it will be hard to predict the total cost.
In its simplest form, it can be just a row in a database storing the current balance available to the customer. Whenever a payment is made, the balance is increased, when the customer calls an endpoint, the balance is decreased by the cost of the call.
One of the things important to keep in mind is concurrency. If two calls reach your API at the very same moment and there is enough balance for only one API call, the second one can still pass if both calls read the same number from the database and think there is enough balance for them.
If there were 10 concurrent calls, they all would pass for the price of one.
In order to prevent overdrafts, the row should be exclusively locked each time when a manipulation with the balance is implied.
If you want currency units to expire after some time (e.g. customers buy 1000 tokens which expire in 6 months), then some process on your side should track the expiration dates and deduct the expired amounts from the balance.
If the balance should be automatically topped up every month (e.g. 1000 credits monthly for $10 per month), then there should be some mechanism in place to ensure recurring monthly payments from the customer and reset the balance.
Instead of updating the row with the balance each time it changes, a new row is inserted into the database, capturing the change. If the balance increases (a payment has been made), you insert +100 and the date, if the balance decreases (a call to API has been made), you insert -1.
In order to calculate the actual balance, you sum all records.
With Project X, credit-based pricing model can be configured in a couple of simple steps.
After you added a new API product and selected API endpoints to be included, you create a quota called, say, "Coins" and specify the number of coins included in the product, the recurring period - a period when the quota is reset - and the endpoints calls to which will consume the coins.

Then you create a price for that quota with the same billing period, and now it's up to you how you want to charge for the coins.
It can be:

That's it. Now get a checkout link from the Product dashboard and pass it to your customers, so they can subscribe to your product, pay and start using the coins. Project X will make sure to collect payments, prevent overdrafts and top up the balance each month.