How to handle OpenAI's API rate limits in Xano?

Hi,

OpenAI's API has rate limits.

In the case of chat completions on the free trial, the api rate limits currently are:

1. Requests per minute: 3 requests per minute.
2. Tokens per minute: 40,000 tokens per minute.
You'll get the amount of tokens you consumed in each api response (see image below).

My use case is the following: I am looping through a list of products, so I use 'for each loop' in Xano and send each product to the OpenAI API, one by one, to ask gpt to describe each product.

For each product, I do 4 different requests to OpenAI (so I do 4 requests per loop), this is causing me errors because of the mentioned OpenAI api rate limits.

What ideas would you have to make Xano respect both of this rate limits (requests per minute and tokens per minute)?

Any help would be appreciated.

Thanks!

4 replies