How to track API usage and cost by API key?

cool stuff. Do you have it open source or are you aware of other projects?