See the setup.js
file below which shows how to create the right kinds
of products and prices. The report.js file shows how the periodic usage
reporting would work.
In order to use a model where a new invoice is cut every time usage reaches a threshold, but also to support the case where we can handle decreasing usage over time, we have to take a hybrid approach where we keep track of how many images are already paid for in a given period, and only report usage over that amount.