We've set our Orchestrate API key in our environment variables, which we use to initialize the db at the start. Then, on every request, we simply increment the count. Finally, we retrieve the current count and return it.
It's important to do the increment this way, so that concurrent updates aren't lost. We then read back out the current value, which may have been updated by someone else already, but that doesn't much matter.
The count is stored on a document with an ID matching the "TONIC_MOUNT_PATH" environment variable, which is the URL of this document.