Small edit in script.js
Change this in project_openai_codex/blob/main/client/script.js
const response = await fetch('https://codex-im0y.onrender.com/', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt: data.get('prompt') }) })
To this
// Change 'http://localhost:5000' to your host address
const response = await fetch('http://localhost:5000/', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ prompt: data.get('prompt') }) })
I was getting errors and noticed it was calling a wrong OpenAI API than my own. After changing it to the localhost address it was working great.
Its not working :(
incase your .env file is outside the Server folder then take it inside it then it will work properly