Giter Club home page Giter Club logo

Comments (20)

tedjames avatar tedjames commented on May 16, 2024 8

I'm now getting ONLY 429 responses :(

Everything seems to be implemented as expected. I'm able to get valid tokens and log into my account for them manually. My app was even working fine all day morning.

When I called getConversation(), I am seeing that the conversationID and message ID are undefined. Not sure if that's an issue or not...

from chatgpt-api.

MarvynSTAR avatar MarvynSTAR commented on May 16, 2024 6

Same thing here, still no solution! @transitive-bullshit is this a known issue?
The first request seems to work fine, but as soon as I send the second message in a conversation I get this error. I wasn't running into this problem a few a days ago. I've tried waiting between messages a few minutes, but it doesn't seem to fix anything.

Maybe it's a limit of time for each answer to be completed that has been set by OpenAI, because the error (to me) only occurs when the answer is taking time (~more than a minute) to be concluded. Given this, I’m not sure there’s a solution to this problem on our side.

Hmm interesting. I seem to be getting the error immediately upon sending my second request, so it doesn't seem to be a time limit issue for me.

Is your second request "complex" (requires a long reply) or the error occurs regardless of the question asked? Personally just a few minutes ago I asked several questions to the AI through the library without incurring any error.
I've just seen the edit to the comment. Maybe I'm not understanding well, but are you using AI from the site and library at the same time with the same account? @chadsarrouf

Right thanks for pointing that out! I had some tabs open, I made sure to close all instances of the site and tried running the request again through the library, but alas same issue! 429 message after one message. I will try to send two messages not part of a conversation see what that yields.

Oh ok! Keep us updated, any information can be useful to solve this problem.

To add my personal experience to @transitive-bullshit’s statement, I struggle to find a scheme for the "appearance" of the errors 429. A few minutes ago I've encountered one and now, even by changing conversation, they continue to occur. Instead before after finding one I just had to change conversation to solve everything and be able to ask other questions.
It's worth mentioning that if with the same account and IP I manually go to the site of the AI, everything works fine and I can ask questions without any error appearing.

from chatgpt-api.

alex12058 avatar alex12058 commented on May 16, 2024 4

I got this eror when I provided a conversationId but not a parentMessageId to the sendMessage function. I found including the parentMessageId fixed this.

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 16, 2024 4

To be clear, this is not something that this package can fix easily. It is intentional on the part of OpenAI and/or Cloudflare, and we just need to try and reverse-engineer what is going on and circumvent it.

Super frustrating, but until the official API comes out, these sorts of issues will unfortunately take place.

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 16, 2024 4

https://github.com/transitive-bullshit/chatgpt-api/releases/tag/v2.4.0 introduces a now fully browser-based solution, ChatGPTAPIBrowser that should resolve a lot of people's 403 / 429 errors — unless your account of IP address has been banned.

Please give the new version a try and let me know how it goes in a new issue.

Thanks, and sorry for all the headaches that Cloudflare has caused.

from chatgpt-api.

ThomasAlbrt avatar ThomasAlbrt commented on May 16, 2024 3

I got this eror when I provided a conversationId but not a parentMessageId to the sendMessage function. I found including the parentMessageId fixed this.

You've saved my sanity sir.

from chatgpt-api.

chadsarrouf avatar chadsarrouf commented on May 16, 2024 2

Same thing here, still no solution! @transitive-bullshit is this a known issue?

The first request seems to work fine, but as soon as I send the second message in a conversation I get this error. I wasn't running into this problem a few a days ago. I've tried waiting between messages a few minutes, but it doesn't seem to fix anything.

from chatgpt-api.

sinhaab avatar sinhaab commented on May 16, 2024 2

Hello,

Was able to install and use it for simple requests, but when it takes a bit to formulate a response I get the error

[ERROR] Error: ChatGPTAPI error 429

I was facing the same issue. I used new email address and password and it worked

from chatgpt-api.

chadsarrouf avatar chadsarrouf commented on May 16, 2024 1

I'm seeing this as well. It seems to be happening pretty randomly, and once an account starts 429'ing, there's not much you can do to escape it.

Will continue investigating.

To be clear, this is not something that this package can fix easily. It is intentional on the part of OpenAI and/or Cloudflare, and we just need to try and reverse-engineer what is going on and circumvent it.

Super frustrating, but until the official API comes out, these sorts of issues will unfortunately take place.

@transitive-bullshit Yea that is understandable, will report back with any findings I come across. Built a really cool chose-your-own-adventure-app using your library just want to get it working again :)

from chatgpt-api.

saltcute avatar saltcute commented on May 16, 2024

My experiment showed that OpenAI now cuts your connection once it has been made for about 60s, and every request after that would return error 429. You need to reset (i.e. get a new) conversation.

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 16, 2024

Hmmm, yes I'm seeing this randomly as well.

Though my twitter bot seems to be chugging along just fine. It's been running for the last few hours now without any 429s or other errors. So it could be account or IP-related as well.

We'll be investigating more in the coming days.. please post if you figure anything out.

from chatgpt-api.

tedjames avatar tedjames commented on May 16, 2024

Experiencing this as well on my end :/

from chatgpt-api.

solserer-labs avatar solserer-labs commented on May 16, 2024

This was also happening for me using the GPT frontend for me when it had to return long code snippets.

from chatgpt-api.

MarvynSTAR avatar MarvynSTAR commented on May 16, 2024

Same thing here, still no solution! @transitive-bullshit is this a known issue?

The first request seems to work fine, but as soon as I send the second message in a conversation I get this error. I wasn't running into this problem a few a days ago. I've tried waiting between messages a few minutes, but it doesn't seem to fix anything.

Maybe it's a limit of time for each answer to be completed that has been set by OpenAI, because the error (to me) only occurs when the answer is taking time (~more than a minute) to be concluded.
Given this, I’m not sure there’s a solution to this problem on our side.

from chatgpt-api.

chadsarrouf avatar chadsarrouf commented on May 16, 2024

Same thing here, still no solution! @transitive-bullshit is this a known issue?
The first request seems to work fine, but as soon as I send the second message in a conversation I get this error. I wasn't running into this problem a few a days ago. I've tried waiting between messages a few minutes, but it doesn't seem to fix anything.

Maybe it's a limit of time for each answer to be completed that has been set by OpenAI, because the error (to me) only occurs when the answer is taking time (~more than a minute) to be concluded. Given this, I’m not sure there’s a solution to this problem on our side.

Hmm interesting. I seem to be getting the error immediately upon sending my second request, so it doesn't seem to be a time limit issue for me.

I am still able to make requests on the openai chatgpt playground, and starting new conversations seems to work with chatgpt-api too for the first message, but as soon as I send my second message I get blocked with 429

from chatgpt-api.

MarvynSTAR avatar MarvynSTAR commented on May 16, 2024

Same thing here, still no solution! @transitive-bullshit is this a known issue?
The first request seems to work fine, but as soon as I send the second message in a conversation I get this error. I wasn't running into this problem a few a days ago. I've tried waiting between messages a few minutes, but it doesn't seem to fix anything.

Maybe it's a limit of time for each answer to be completed that has been set by OpenAI, because the error (to me) only occurs when the answer is taking time (~more than a minute) to be concluded. Given this, I’m not sure there’s a solution to this problem on our side.

Hmm interesting. I seem to be getting the error immediately upon sending my second request, so it doesn't seem to be a time limit issue for me.

Is your second request "complex" (requires a long reply) or the error occurs regardless of the question asked?
Personally just a few minutes ago I asked several questions to the AI through the library without incurring any error.

I've just seen the edit to the comment. Maybe I'm not understanding well, but are you using AI from the site and library at the same time with the same account? @chadsarrouf

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 16, 2024

I'm seeing this as well. It seems to be happening pretty randomly, and once an account starts 429'ing, there's not much you can do to escape it.

Will continue investigating.

from chatgpt-api.

chadsarrouf avatar chadsarrouf commented on May 16, 2024

Same thing here, still no solution! @transitive-bullshit is this a known issue?
The first request seems to work fine, but as soon as I send the second message in a conversation I get this error. I wasn't running into this problem a few a days ago. I've tried waiting between messages a few minutes, but it doesn't seem to fix anything.

Maybe it's a limit of time for each answer to be completed that has been set by OpenAI, because the error (to me) only occurs when the answer is taking time (~more than a minute) to be concluded. Given this, I’m not sure there’s a solution to this problem on our side.

Hmm interesting. I seem to be getting the error immediately upon sending my second request, so it doesn't seem to be a time limit issue for me.

Is your second request "complex" (requires a long reply) or the error occurs regardless of the question asked? Personally just a few minutes ago I asked several questions to the AI through the library without incurring any error.

I've just seen the edit to the comment. Maybe I'm not understanding well, but are you using AI from the site and library at the same time with the same account? @chadsarrouf

Right thanks for pointing that out! I had some tabs open, I made sure to close all instances of the site and tried running the request again through the library, but alas same issue! 429 message after one message. I will try to send two messages not part of a conversation see what that yields.

Update: I tried testing multiple single api messages vs conversation messages, same result, 429 after first request

from chatgpt-api.

transitive-bullshit avatar transitive-bullshit commented on May 16, 2024

This should be significantly improved using the new fully-browser-based solution available in https://github.com/transitive-bullshit/chatgpt-api/releases/tag/v2.4.0

from chatgpt-api.

alex12058 avatar alex12058 commented on May 16, 2024

This is my current setup to initialise the api. I'm using the old solution because I'm using onConversationResponse to stream the message as it is generated through a websocket to my frontend.

// Load the api (declared as a const at the top of the file)
const initApi = (async () => {
	// Use puppeteer to bypass cloudflare (headful because of captchas)
	const openAIAuth = await getOpenAIAuth({
		browser: await getBrowser({ executablePath: "/usr/bin/chromium" }),
		email: process.env.OPENAI_EMAIL,
		password: process.env.OPENAI_PASSWORD,
	});

	return new ChatGPTAPI({ ...openAIAuth });
})();


// Usage (within a function within a websocket server)

// Wait for the api to init
const api = awiat initAPi;

// Check if the tokens are still valid
try {
	await api.ensureAuth();
}
catch (e) {
	console.log(e);
	return ws.send(JSON.stringify({ error: e.toString() }));
}

// Send a message through the api and stream the response to the websocket client
await api.sendMessage(
	message,
	{
		conversationId,
		parentMessageId,
		timeoutMs,
		onConversationResponse: response => {
			// Stream response to client
		},
	}
);,

When I do my first request without a conversationId or parentMessageId it works. However, when I send the next message in the conversation with the conversationId and parentMessageId I get this error. This happens even if I wait some random amount of time between 1 and 20 second before sending the next message.

{
  statusCode: 429,
  statusText: 'Too Many Requests',
  response: Response {
    [Symbol(realm)]: null,
    [Symbol(state)]: {
      aborted: false,
      rangeRequested: false,
      timingAllowPassed: true,
      requestIncludesCredentials: true,
      type: 'default',
      status: 429,
      timingInfo: [Object],
      cacheState: '',
      statusText: 'Too Many Requests',
      headersList: [HeadersList],
      urlList: [Array],
      body: [Object]
    },
    [Symbol(headers)]: HeadersList {
      [Symbol(headers map)]: [Map],
      [Symbol(headers map sorted)]: null
    }
  }
}

Edit: The ChatGPTAPIBrowser solution works for me and I no longer get 429 errors. Though in order to use this I had to manually edit the .js file so defaultChromeExecutablePath() would return the path to my chromium. The path issue is fixed by #152.

from chatgpt-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.