chatgpt-api: ChatGPTAPI 429 Error on second message sent
Verify latest release
- I verified that the issue exists in the latest
chatgptrelease
Verify webapp is working
- I verify that the ChatGPT webapp is working properly for this account.
Environment details
- Node.js version : 19.0.0
- Ubuntu : 22.0.4.1 LTS
- Chromium 108.0.5359.124
Describe the Bug
I’m running a simple web-app (conversationnal chat) on a VPS. The app has no problem running on my local environment (windows 11 - Chrome) but whenever I run it on my VPS (environment detailed), I have the following error :

The first message sent (ie. the first call to the API) doesn’t trigger the error and the response is correctly send back. This error ALWAYS happens on the second message send. This second message contains a conversationID as well as a parentMessageId. The browser is still open between the 2 messages, no new sessions are initialized. This errors appears instantly when the second message is sent. There is no relation between the complexity or length of the message and the error (and the first message is never sending back an error regardless of the prompt’s complexity). I did try to add a delay but it didn’t change anything. I’m using ChatGPTAPIBrowser with this configuration :
const api = new ChatGPTAPIBrowser({
email: process.env.OPENAI_EMAIL,
password: process.env.OPENAI_PASSWORD,
isGoogleLogin: true,
debug: false,
minimize: true
})
my .env file contains email, password and the path to the browser used by Pupeteer (PUPPETEER_EXECUTABLE_PATH)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 10
- Comments: 23 (8 by maintainers)
@michaelbecker-d
demo-conversation.tsuses the API version and will definitely run into 429s quite quickly. You should be usingdemo-conversation-browser.tsordemo.tssince they both use the browser-based version. (I know this is confusing; I left the API-version in there for now, but am considering removing it since it’s essentially broken until the official API is released or we figure out a better way to avoid Cloudflare’s TLS fingerprinting).Another thing to watch out for: you should only ever have a max of one
sendMessagerequest at a time per browser instance and OpenAI account.If you try to have multiple
sendMessagerequests overlapping each other, you will get a 429 immediately.Guys, I was with the same error, when I added the parentMessageId for second message, everything worked.
I can confirm that switching proxies helps
I agree that OpenAI seems to have made their rate limits stricter, but if you’re using the browser-based version without overlapping
sendMessagerequests, it should work fairly consistently. This is what I’m using to power my twitter bot, which I had to shut off during holiday travel, but aside from that it’s been working pretty well.