This is one of those things that I like to leave for an existing provider.
To keep things simple, put something in front of your API that is solely responsible for speed limits and consumer control of the API. This is often done with some API proxy.
3scale is a good solution. It is efficient Nginx with a module to perform all the heavy lifting. http://www.3scale.net/ It's also cheap (or free, depending on your load).
There are others, such as Mashery, but to be honest, I had terrible luck with Mashery since Intel bought them. DNS resolution issues, high prices, etc.
source share