0

I'm currently trying langchain, and after the first basic tutorial (this following code), i have a RateLimitError.

from langchain.llms import OpenAI

llm = OpenAI(temperature=0.9)
llm.predict("What would be a good company name for a company that makes colorful socks?")

Here's the error: Retrying langchain.llms.openai.completion_with_retry.<locals>._completion_with_retry in 4.0 seconds as it raised RateLimitError: You exceeded your current quota, please check your plan and billing details..

To your information, i don't have any kind of plan or billing on OpenAI, is it free to use langchain with OpenAI, or is it mandatory to have billing plan ?

solved

To fix this, I just set up billing plan on https://platform.openai.com/account/billing/overview, and i works !

queng
  • 11
  • 2
  • I don't think you have to have a billing plan, but I think you only get some many requests per month for free, as well as the rate limit is how many you can do right after another. I think a paid plan has many more tokens you can use, and the rate limit is increased, but not unlimited if i recall. Read the error though, it says YOUR PLAN has a QUOTA, and if its free, then ya you are out. – easleyfixed Jul 13 '23 at 17:19
  • yeah, but it's the first time is use openAI API, so I don't understand why I'm out of the quota – queng Jul 13 '23 at 17:34
  • You are sending it commands too quickly, try putting in some sort of delay for a few seconds perhaps? RateLimitError is how many in a certain amount of time, not x amount and you are done. – easleyfixed Jul 13 '23 at 18:13
  • OpenAI is not free, check the `OPEN_API_KEY` may be you got that from the tutorial and that exceeded the quota. Open ai does provide $5 free quota(credit) when u register with them. – simpleApp Jul 13 '23 at 19:49

0 Answers0