Hey folks! We just shipped a new guide in the docs on what all the different error codes you might get are along with how to handle them, check it out and please send feedback if you have any: OpenAI API
Hi
Thank you for this. I have been meaning to add some error handling that gives my clients more insight into why a request has failed.
However, I have one observation about this error:
429 - The engine is currently overloaded. Please try again later.
Shouldnât this error be in the 500 range as its a server side problem?
4xx - This class of status code is intended for situations in which the error seems to have been caused by the client.
5xx - Response status codes beginning with the digit â5â indicate cases in which the server is aware that it has encountered an error or is otherwise incapable of performing the request
I feel a little embarrassed that I am quoting wikipedia and not an and RFC but I am pretty sure this is accurate.
`
This 429 Error code is from Cloudflare, not the back end server:
See:
That RFC defines 429 as
âThe 429 status code indicates that the user has sent too many requests in a given amount of time (ârate limitingâ).â
I agree, that is a user error.
But the OpenAI the description is
â429 - The engine is currently overloaded. Please try again later.â
The later is not describing a user error but instead calling out the server (as the âengineâ) as the cause of the error. And rather than admonishing the user for making to many request, it suggests they try again later as if they have done nothing wrong.
There probably should be an error for to many user requests at once. But experience is that the OpenAI server is also failing because it is overloaded. So a 500 error for that would be appropriate. (I also feel I have seen one in the 500 range for that; I will have to keep an eye out).
Yeah, itâs an application in beta, per the T&Cs, so of course things need to be polished and refined.
There are always issues with error messages and feedback to users during the beta stage of application development; but as someone currently working on my third OpenAI API app, these little beta issues are not very annoying to me, but I can see and understand how others are annoyed by them and wish they were much better.
Itâs good to document these issues. Well done.
Thank you. Iâm not complaining. Iâm trying to contribute.
Yes, you are a strong contributor @paul.armstrong and I always enjoy reading your posts.
Thank you.
Hello ![]()
Iâm using the model: âtext-davinci-003â in a nextJS typescript project and it works perfect from localhost:3000 but when I deploy to github and Netlify deploys the site, I get this error:
react_devtools_backend.js:4012 Error: Request failed with status 502
I checked devtools and I have âBreak on warningâ disabled . . .
I read in another forum that maybe application/JSON getâs converted to text/html on build and this could produce the error online but I havenât been able to solve it . . .
Any good ideas out there?
Thanx
This could be it? Iâve seen one other Netlify GPT project, I think.
Can you add âconsole.error,â so we can get more information?
Was it a one-time thing or does it happen multiple times? Always the same prompt?
Sorry youâre experiencing this! This sounds more like a client-specific or environment-specific error considering it works on your local machine, and I think this particular help article is more about error codes returned by the backend API itself.
Can you open an issue in the openai-node repository? I agree with Paul it would be helpful to see a full stack trace.
I made sure it returned JSON with accept in header So that works but still I get the error when online.
It happens on every call ⌠. itâs like the API is rejecting my post . . .
Hmmm . . .fulll stack tree . . . You can test the site here: https://blockdefi.netlify.app . .- left menu (You donât need to connect to use the OpenAI) . Iâm not so good with reading errors in console, but I found this:
Could it be an authentication issue? . . . I found that my APP_DOMAIN needs to be set to=domain.app while NEXTAUTH_URL must be= https://domain.app . . . Further more . . . Is it path specific in some way? . . .
Like if request comes from domain.app/api/auth/script.ts but somewhere is set simply the domain? . . . I donât know . . . Iâm reaching . . . . Iâve been struggling with this issue for 2 weeks for an exam project and I feel Iâve tried everything . . .

