openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

retrofit2 429 exception

Open parisana opened this issue 2 years ago • 1 comments

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.

parisana avatar Dec 06 '22 20:12 parisana

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.

pepitoscrespo avatar Jan 28 '23 11:01 pepitoscrespo

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.

TheoKanning avatar Feb 14 '23 13:02 TheoKanning