Comments (47)
I used http://localhost:5000 and it fixed it :)
Just wanted to verify that this solved the issue for me also. Thanks @LifeCoachRay and @Raq-3773 ..Have a good one!
from project_openai_codex.
@Tanimou @DeaconDuMond
I have made these changes and now it's working you can see in the deployment code-ai-amber.vercel.app
I deleted te .gitignore because for some reason it was not working then I added and it worked
then I change the secret OPEN_API_KEY because they detect when your key have been public so then your websited will not work so I changen and repleace in .env
then I change the response const response = await fetch('http:localhost:5000'
to const response = await fetch('https://codeai-uh8b.onrender.com'
then wirte in the teminal git add .
then git commit -m 'any comment'
then git push origin main
then in vercel you have to wait till everything have been update and then try it
from project_openai_codex.
I used http://localhost:5000 and it fixed it :)
from project_openai_codex.
@MackGrissom @MrKwayisi In renderer site make sure to have OPENAI_API_KEY value in environment variable. Also, you have to have a billing plan set up. I think this will allow server requests to be accepted by OpenAi. Juste like @crocmons said, you'll have a free trial $18. For me, I removed the .env file in the server folder on my repo since it will be placed in the renderer environment variable. I did this because each time I pushed on my repo with the .env file, I got my API key rotated because it's public. Hope it helps
from project_openai_codex.
@Thatsgaurav The best fix is to ensure the .gitignore is in your root folder and changes are saved before pushing anything to GitHub. Please also ensure all other files are saved with Ctrl s before running the git commands. If you don't, in my experience fixing it retrospectively will not work and you will continue to have 401 issues (assuming you had none on your local host before deployment). Also make sure your .env is in your server folder. If all code is correct and files are in the correct folders, what worked for me was starting a new build and ensuring all changes were saved before deployment. This might not be the most efficient method but it worked for me. Here's my running and working site. https://chat-with-codex.vercel.app. Hope it helps.
from project_openai_codex.
@Thatsgaurav if you still getting the 401 error and you follow every step of the video, the issue could be that when he made a cut on the video at 51:59, he starts explaining how to upload to GitHub, so naturally you "git init" and then "git add ." , then at 52:15 he starts the process all over, but before "git init" he tells us to create the ".gitignore", and then "git init" again...
So because of that, Git is tracking ".env" already because of that "git init" and "git add ." at 51:59 of the video... I believe that was an error when he was editing... that could be causing your OpenAPI Key to "Rotate" and not be valid anymore for security reasons (because it's being exposed on GitHub), so if you replace the key and push your changes again the same is going to happen...
So one of the ways you can try to fix it is by running this on the root folder terminal
"git rm .env --cached"
"git commit -m "Stopped tracking .env File"
now delete the ".env" file, and push your changes again, so after that git would be stopping tracking that file, and follow the rules of ".gitignore"...
now you can create the ".env" file again with the new key and push the changes... (don't forget to replace the key on the server too)
I hope it helps!
from project_openai_codex.
It is not very clear, but what you need to do is provide a billing method. Our free usage expired in May, and since then, all the OpenAI features that were available are now cut off until a payment method is added. Once you provide credit card or other method, you will see how much usage and cost you incur. You will notice that there are two colors: used and expired. Whatever was not used has now expired.
from project_openai_codex.
Hey!
Open your client
folder and click the script.js
file then go to line number 87
and replace the API Url with the localhost one or your deploy URL
Example const response = await fetch("http://localhost:5000/", { // the rest of code goes here....
from project_openai_codex.
It works not after changing that line of code.
Thanks a bunch
from project_openai_codex.
Has it work now? @DeaconDuMond
from project_openai_codex.
I got a status code 500 error (internal server error) when I try with my localhost
from project_openai_codex.
I bet this have to do with Api key stuff indeed. So, I delete my env file from my repo and got updated this on renderer in Environment variable as well but still the same problem.
from project_openai_codex.
I am also having issues with this. None of the above advice worked.
I generated a new API key and nothing changed.
from project_openai_codex.
Hello,
I am getting a Status code 429 error when I run the client. Attached is the issue.
I am using a Mac so I used server 5002.
Please advise
It works not after changing that line of code.
Thanks a bunch
@DeaconDuMond I solve the issue of 429 getting an HTTP Error....
you have to sign up for OpenAI with your own email address (not sign up with google) and do phone verification then it will give you the free trial of $18 ..and then the code will perfectly work.
from project_openai_codex.
@DeaconDuMond I solve the issue of 429 getting an HTTP Error....
you have to sign up for OpenAI with your own email address (not sign up with google) and do phone verification then it will give you the free trial of $18 ..and then the code will perfectly work.
from project_openai_codex.
I get the same 429 error. So I asked ChatGPT "when using the OpenAI API I get an error message of 429 - will upgrading resolve this problem?"
This is ChatGPT's response:
"It is possible that upgrading to a higher tier of the OpenAI API could resolve a "429 error" message, which indicates that you have exceeded the rate limits for the API. Rate limits are put in place to ensure that the API is available to all users and to protect against excessive use of the API.
However, there could be other factors that are causing the error message to appear. For example, the error could be caused by an issue with your API key or with the way that you are using the API.
To determine the cause of the error and how to resolve it, you can try the following steps:
Check the documentation for the API to make sure that you are using it correctly and within the limits of your API key.
Check the API usage limits for your API key to see if you have exceeded them. If you have exceeded the limits, you may need to wait for the rate limits to reset before you can use the API again.
If you have not exceeded the rate limits, you may want to try re-generating your API key or contacting the OpenAI API support team for further assistance.
It is also worth noting that the OpenAI API has different tiers with different rate limits and usage limits. If you are consistently hitting the rate limits for your API key, upgrading to a higher tier may be a good option to consider."
from project_openai_codex.
I'm getting a 401, anyone have a suggestion for a fix?
from project_openai_codex.
@crocmons Thanks for responding. I’ve done that already. Site was working perfectly on my local host. Soon as I push to git and deploy I get 401 after three seperate builds.
from project_openai_codex.
@showkathco @DeaconDuMond @MrKwayisi
401 Issue solved/render issue solved:
Make sure that your Server folder has no gitignore file the gitignore file should be on the root folder..
then deploy the server to render.com and add also your environment key in the Environment Variable.
Now Update your fetch URL on the client side by adding your back-end render deploy URL
then open your terminal and do this thing --
git init
git add .
git commit -m "fetch URL or something you want"
git push
That should be updated, your GitHub code .
Now go to the vercel select your GitHub repo
The root directory should be the client
then hit deploy
that's all ..
My code is perfectly working on the live deployment-
from project_openai_codex.
hey!
if this isn't solved make sure you use your own api key and make sure git is updated
from project_openai_codex.
Make sure that your Server folder has no gitignore file the gitignore file should be on the root folder..
from project_openai_codex.
I just had the same problem. It's really easy to fix.
It comes back error 429 but it is really error 500 if you open the dev tools and see that same error.
But anyway, to fix it all you need to do is open the script.js file in the client and change the URL. to localhost:5000
or the same port as your server. this will connect the server to your client.
and make sure the .env file is in the server directory.
you don't need to do anything else.
from project_openai_codex.
My API key is being rotated each time I push to github. Anyone know why that is?
I have the .env in the server folder. Inside the .env is the api key variable.
I will attempt to deploy and see if that changes anything
from project_openai_codex.
@MackGrissom @LifeCoachRay @Raq-3773 @crocmons I've tried everything above and I'm still getting a 401. To clarify, the .env is in the server folder, the.gitignore is in the root and the url in the script.js file is my backend url from render. Giithub is up to date. All changes committed and pushed. Can someone please tell me if I'm missing something? It's my first project and I just would really like to finish it.
from project_openai_codex.
@Tanimou thanks for responding. I think mine may be a more complicated issue. For me even though the .env is in the server folder, when I console log in server.js I am getting underfined when before deployment this is never an issue. Before the git push into the repository everything works fine. After three separate builds, I only get 401's after deployment with none in testing. Is there another way to fix this undefined issue? As by deduction it feels like all this starts when I commit to github and even when I change back to the local host the previously working host then gets 401's too.
from project_openai_codex.
from project_openai_codex.
Glad to see that I am not the only person blocked by this! Simple solution. Do NOT use ports 5000 or 7000 on MacOS boxes. They are used by the system for over a year now. I use 7070, and it works great. Solution found for me.
https://developer.apple.com/forums/thread/682332
from project_openai_codex.
Error: Request failed with status code 429
at createError (C:\Users\user\Desktop\AI_DammyTech\server\node_modules\axios\lib\core\createError.js:16:15)
at settle (C:\Users\user\Desktop\AI_DammyTech\server\node_modules\axios\lib\core\settle.js:17:12)
at IncomingMessage.handleStreamEnd (C:\Users\user\Desktop\AI_DammyTech\server\node_modules\axios\lib\adapters\http.js:322:11)
at IncomingMessage.emit (node:events:525:35)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [Function: httpAdapter],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function:
transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus],
headers: {
Accept: 'application/json, text/plain, /',
'Content-Type': 'application/json',
'User-Agent': 'OpenAI/NodeJS/3.1.0',
Authorization: 'Bearer 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',
'Content-Length': 136
},
method: 'post',
data: '{"model":"text-davinci-003","prompt":"hello\n","temperature":0,"max_tokens":3000,"top_p":1,"frequency_penalty":0.5,"presence_penalty":0}',
url: 'https://api.openai.com/v1/completions'
},
request: <ref *1> ClientRequest {
_events: [Object: null prototype] {
abort: [Function (anonymous)], aborted: [Function (anonymous)],
connect: [Function (anonymous)],
error: [Function (anonymous)], socket: [Function (anonymous)],
timeout: [Function (anonymous)],
prefinish: [Function: requestOnPrefinish]
},
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached:
false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: TLSSocket {
_tlsOptions: [Object],
_secureEstablished: true,
_securePending: false,
_newSessionPending: false,
_controlReleased: true,
secureConnecting: false,
_SNICallback: null,
servername: 'api.openai.com',
alpnProtocol: false,
authorized: true,
authorizationError: null,
encrypted: true,
_events: [Object: null prototype],
_eventsCount: 10,
connecting: false,
_hadError: false,
_parent: null,
_host: 'api.openai.com',
_readableState: [ReadableState],
_maxListeners: undefined,
_writableState: [WritableState],
allowHalfOpen: false,
_sockname: null,
_pendingData: null,
_pendingEncoding: '',
server: undefined,
_server: null,
ssl: [TLSWrap],
_requestCert: true,
_rejectUnauthorized: true,
parser: null,
_httpMessage: [Circular *1],
[Symbol(res)]: [TLSWrap],
[Symbol(verified)]: true,
[Symbol(pendingSession)]: null,
[Symbol(async_id_symbol)]: 39, [Symbol(kHandle)]: [TLSWrap],
[Symbol(lastWriteQueueSize)]:
0,
[Symbol(timeout)]: null,
[Symbol(kBuffer)]: null,
[Symbol(kBufferCb)]: null,
[Symbol(kBufferGen)]: null,
[Symbol(kCapture)]: false,
[Symbol(kSetNoDelay)]: false,
[Symbol(kSetKeepAlive)]: true, [Symbol(kSetKeepAliveInitialDelay)]: 60,
[Symbol(kBytesRead)]: 0,
[Symbol(kBytesWritten)]: 0,
[Symbol(connect-options)]: [Object],
[Symbol(RequestTimeout)]: undefined
},
_header: 'POST /v1/completions HTTP/1.1\r\n' +
'Accept: application/json, text/plain, /\r\n' +
'Content-Type: application/json\r\n' +
'User-Agent: OpenAI/NodeJS/3.1.0\r\n' +
'Authorization: Bearer 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\r\n' +
'Content-Length: 136\r\n' +
'Host: api.openai.com\r\n' +
'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop], agent: Agent {
_events: [Object: null prototype],
_eventsCount: 2,
_maxListeners: undefined,
defaultPort: 443,
protocol: 'https:',
options: [Object: null prototype],
requests: [Object: null prototype] {},
sockets: [Object: null prototype],
freeSockets: [Object: null prototype] {},
keepAliveMsecs: 1000,
keepAlive: false,
maxSockets: Infinity,
maxFreeSockets: 256,
scheduling: 'lifo',
maxTotalSockets: Infinity,
totalSocketCount: 1,
maxCachedSessions: 100,
_sessionCache: [Object],
[Symbol(kCapture)]: false
},
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined,
path: '/v1/completions',
_ended: true,
res: IncomingMessage {
_readableState: [ReadableState],
_events: [Object: null prototype],
_eventsCount: 4,
_maxListeners: undefined,
socket: [TLSSocket],
httpVersionMajor: 1,
httpVersionMinor: 1,
httpVersion: '1.1',
complete: true,
rawHeaders: [Array],
rawTrailers: [],
aborted: false,
upgrade: false,
url: '',
method: null,
statusCode: 429,
statusMessage: 'Too Many Requests',
client: [TLSSocket],
_consuming: false,
_dumped: false,
req: [Circular *1],
responseUrl: 'https://api.openai.com/v1/completions',
redirects: [],
[Symbol(kCapture)]: false,
[Symbol(kHeaders)]: [Object],
[Symbol(kHeadersCount)]: 14,
[Symbol(kTrailers)]: null,
[Symbol(kTrailersCount)]: 0,
[Symbol(RequestTimeout)]: undefined
},
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'api.openai.com',
protocol: 'https:',
_redirectable: Writable {
_writableState: [WritableState],
_events: [Object: null prototype],
_eventsCount: 3,
_maxListeners: undefined,
_options: [Object],
_ended: true,
_ending: true,
_redirectCount: 0,
_redirects: [],
_requestBodyLength: 136,
_requestBodyBuffers: [],
_onNativeResponse: [Function (anonymous)],
_currentRequest: [Circular *1],
_currentUrl: 'https://api.openai.com/v1/completions',
[Symbol(kCapture)]: false
},
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object:
null prototype] {
accept: [Array],
'content-type': [Array],
'user-agent': [Array],
authorization: [Array],
'content-length': [Array],
host: [Array]
},
[Symbol(kUniqueHeaders)]: null
},
response: {
status: 429,
statusText: 'Too Many Requests', headers: {
date: 'Fri, 27 Jan 2023 03:17:56 GMT',
'content-type': 'application/json; charset=utf-8',
'content-length': '206',
connection: 'close',
vary: 'Origin',
'x-request-id': 'b5ae08b35987e7d1677139be7732e200',
'strict-transport-security': 'max-age=15724800; includeSubDomains' },
config: {
transitional: [Object],
adapter: [Function: httpAdapter],
transformRequest: [Array],
transformResponse: [Array],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
validateStatus: [Function: validateStatus],
headers: [Object],
method: 'post',
data: '{"model":"text-davinci-003","prompt":"hello\n","temperature":0,"max_tokens":3000,"top_p":1,"frequency_penalty":0.5,"presence_penalty":0}',
url: 'https://api.openai.com/v1/completions'
},
request: <ref *1> ClientRequest
{
_events: [Object: null prototype],
_eventsCount: 7,
_maxListeners: undefined,
outputData: [],
outputSize: 0,
writable: true,
destroyed: false,
_last: true,
chunkedEncoding: false,
shouldKeepAlive: false,
maxRequestsOnConnectionReached: false,
_defaultKeepAlive: true,
useChunkedEncodingByDefault: true,
sendDate: false,
_removedConnection: false,
_removedContLen: false,
_removedTE: false,
_contentLength: null,
_hasBody: true,
_trailer: '',
finished: true,
_headerSent: true,
_closed: false,
socket: [TLSSocket],
_header: 'POST /v1/completions HTTP/1.1\r\n' +
'Accept: application/json, text/plain, /\r\n' +
'Content-Type: application/json\r\n' +
'User-Agent: OpenAI/NodeJS/3.1.0\r\n' +
'Authorization: Bearer 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\r\n' +
'Content-Length: 136\r\n' +
'Host: api.openai.com\r\n' + 'Connection: close\r\n' +
'\r\n',
_keepAliveTimeout: 0,
_onPendingData: [Function: nop],
agent: [Agent],
socketPath: undefined,
method: 'POST',
maxHeaderSize: undefined,
insecureHTTPParser: undefined, path: '/v1/completions',
_ended: true,
res: [IncomingMessage],
aborted: false,
timeoutCb: null,
upgradeOrConnect: false,
parser: null,
maxHeadersCount: null,
reusedSocket: false,
host: 'api.openai.com',
protocol: 'https:',
_redirectable: [Writable],
[Symbol(kCapture)]: false,
[Symbol(kNeedDrain)]: false,
[Symbol(corked)]: 0,
[Symbol(kOutHeaders)]: [Object: null prototype],
[Symbol(kUniqueHeaders)]: null },
data: { error: [Object] }
},
isAxiosError: true,
toJSON: [Function: toJSON]
}
from project_openai_codex.
please help me out this is what i got on my server side....error 429
thou i have went throu the comments and try out some solution but not yet working
please help me out
from project_openai_codex.
while i noticed if i change my localhost on client and server side from 5000 to maybe 5001 or 7070 i gt undefined while console will direct me to this line const response = await fetch('http://localhost:5000
but if it's LHOST 5000 i will get 401 error
from project_openai_codex.
Hi,
I got the same error, and it seems that the free trial is expired on OpenAI, that's why it is not working.
from project_openai_codex.
@Thatsgaurav最好的解决方法是确保 .gitignore 位于根文件夹中,并且在将任何内容推送到 GitHub 之前保存更改。在运行 git 命令之前,请确保使用 Ctrl s 保存所有其他文件。如果您不这样做,根据我的经验,追溯修复它将不起作用,并且您将继续遇到 401 问题(假设您在部署之前在本地主机上没有问题)。还要确保您的 .env 位于您的服务器文件夹中。如果所有代码都正确且文件位于正确的文件夹中,那么对我有用的就是开始新的构建并确保在部署之前保存所有更改。这可能不是最有效的方法,但它对我有用。这是我的跑步和工作网站。https://chat-with-codex.vercel.app。希望对您有所帮助。
How to configure the server
from project_openai_codex.
@764777472 仍然无法使用此更改:(
from project_openai_codex.
@willgoncdev Don't Know but it's still not working in my System :(
from project_openai_codex.
i got same error any idea how can i resolved
from project_openai_codex.
hey i am getting the same error of 429:
and when i run the server side in my terminal i am getting undefined message though i have put my .env file that has api key inside the server forder.
[nodemon] 2.0.22
[nodemon] to restart at any time, enter rs
[nodemon] watching path(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node server.js
undefined
Server is running on port http://localhost:5000
help me out guys
from project_openai_codex.
hey i am getting the same error of 429: and when i run the server side in my terminal i am getting undefined message though i have put my .env file that has api key inside the server forder.
[nodemon] 2.0.22 [nodemon] to restart at any time, enter
rs
[nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,json [nodemon] startingnode server.js
undefined Server is running on port http://localhost:5000help me out guys
@Haizard ok, sometimes it happens.. please check your openai balance....
from project_openai_codex.
how can i check my openai balance
from project_openai_codex.
just go to this link you can find your openai free usage trial - https://platform.openai.com/account/usage
from project_openai_codex.
i am on the link what next
from project_openai_codex.
from project_openai_codex.
It is not very clear, but what you need to do is provide a billing method. Our free usage expired in May, and since then, all the OpenAI features that were available are now cut off until a payment method is added. Once you provide credit card or other method, you will see how much usage and cost you incur. You will notice that there are two colors: used and expired. Whatever was not used has now expired.
@KevinEverywhere yes, nicely explained kevin...
from project_openai_codex.
from project_openai_codex.
no, Can you give me a ss of your free usage trial in Openai...because if you have no free usage trial in your Openai balance you can't up running your project & it gives you this 429 error @Haizard
from project_openai_codex.
from project_openai_codex.
from project_openai_codex.
screenshot
from project_openai_codex.
Related Issues (20)
- Chat got 4 or 3.5 turbo models not supported
- POST http://localhost:5173/ 404 (Not Found) HOT 1
- Program not working after copying the exact same code as in Github. HOT 1
- Request failed with status code 429 HOT 6
- Chatbot doesn't remember previous chats and also giving answer of the question when i asked about today's date. it gives answer 11th August,2020 but today is 22nd April,2023 HOT 1
- User. Svg expected js
- 404 Error HOT 1
- Why does the client send the POST to 'https://codex-im0y.onrender.com/'? HOT 1
- KeyCode is deprecated
- Conversation Is Not Saved HOT 3
- Urgent Error facing Localhost:5173 says ~~~~~ HOT 4
- API KEY NOT GETTING RECOGNISED
- POST http://localhost:5173/ 404 (Not Found) HOT 1
- Not getting the result,could anyone solve this issue HOT 2
- Error 401
- api is not working and chat gpt tells about this error is your exceeding the api limit HOT 2
- folder is not copying
- 'openai' does not provide an export named 'Configuration' 🥲 HOT 5
- these two error are coming after adding submit and keyup in form
- Break don
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from project_openai_codex.