This is an opinionated implementation of the Token Bucket algorithm for PostgreSQL.
I had several tasks, running on several intances, trying to query ChatGPT API at the same time.
I needed a solution to rate limit the number of queries made to OPENAI API, this information had to be available accross several services.
I only had one database (pg) available.