openai-java
openai-java copied to clipboard
retrofit2 429 exception
Facing the below error
java.util.concurrent.CompletionException: retrofit2.adapter.rxjava2.HttpException: HTTP 429
Details:
- I have 7 threads creating a new instance of the OpenAiService.
- I have quite a few requests made on each thread.
- What is the cause of this exception. I know I have not exceeded my rate limit.
for free trial users the request is limited to 20 request per minute, that is highly likely to be exceeded within one minute using 7 threads despite the low absolute amount of each one. Use different users, or some kind of latch/asynchr procedure to start one thread after another.
Try upgrading to 0.10.0 and using the OpenAiService
from the new service
library. It will read the server error message and display it in the stack trace for you.