Every once in a while, I send GPT a prompt, and I will get no response. After getting tired of waiting, I can start sending it more prompts or repeat the last prompt, and start getting responses again like normal, but then my console logs the error from the ignored prompt
Access to fetch at 'https://api.openai.com/v1/chat/completions' from origin 'https://<mywebsite>.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
POST https://api.openai.com/v1/chat/completions net::ERR_FAILED 502 (Bad Gateway)
I’ve already added the following lines to .htaccess, so I assume this is something on OpenAI’s side?
Header set Access-Control-Allow-Origin https://openai.com
Header set Access-Control-Allow-Origin https://api.openai.com
I have not figured out a direct cause or resolution. Since project is intended to run as a PWA, and as my development has winded down, I’m not paying attention to the dev console. However, If I recall correctly, I do have a work around in place. I’ve implemented a timeout in my fetch call. If fetch times out, it will retry up to 3 times.
I have started facing similar issue suddenly in my MERN application and I didn’t change anything at all, then I tried sending a cURL request and got the following error,
{
“error”: {
“message”: “You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.”,
“type”: “insufficient_quota”,
“param”: null,
“code”: “insufficient_quota”
}
}