chat-with-gpt icon indicating copy to clipboard operation
chat-with-gpt copied to clipboard

Issue Connecting with Open AI API

Open jsanchezl12 opened this issue 1 year ago • 5 comments

Hello, I am having trouble with the API Key setting, maybe is something that I need to configure? I just set my API Key, and run it locally, but it stills showing an error

image image

I run it as docker container

image

jsanchezl12 avatar Mar 14 '23 14:03 jsanchezl12

If you're sure you set the API key correctly, it's probably just OpenAI's servers being overloaded. I noticed the completion API started to return a higher rate of errors a few hours ago, usually with an HTTP response that says "this model is overloaded, try again". See if clicking Regenerate fixes it. I'll add automatic retry logic soon which should help.

cogentapps avatar Mar 14 '23 14:03 cogentapps

Thanks 👍

I test it in the page but is not working, maybe we can't access anymore. 😓 Link

image

jsanchezl12 avatar Mar 15 '23 19:03 jsanchezl12

I'm seeing the same. I can connect with the same API key using curl without issues, but the web app fails with a "401 Unauthorized". The API key is entered correctly. Not sure how to troubleshoot further.

johnvesalius avatar Mar 16 '23 07:03 johnvesalius

So, the 401 unauthorized error (as seen in the image above) is not related. The chatapi/sync endpoint is for storing and syncing the message you submitted, but only works when you are signed in. (It should only run when signed in, but that logic isn’t implemented yet, so there’s an error.)

In the network debugger you can look for a request to the OpenAI chat completion endpoint right when you submit your message. That’s the important one. For me, it’s been failing off and on over the last few days, usually with a 429 Too Many Requests error and a message that says the model is overloaded. Since it’s an OpenAI API error, there’s not much that can be done in the app, except resubmitting the request.

I saw several threads about this issue on the OpenAI Discord - I imagine they’re having to scale up server capacity to meet demand for GPT-4 and these are just growing pains.

cogentapps avatar Mar 16 '23 08:03 cogentapps

Makes sense, thanks!

johnvesalius avatar Mar 16 '23 08:03 johnvesalius