-1

Why did I get RateLimitError: You exceeded your current quota, please check your plan and billing details.? I was subscribed, and this is my first request. I paid for my subscription.

Here is my code:

import openai
KEY = "mykeyhere it is checked over 10 times" //i tries to create new keys, not working, all times RATELIMITERROR
openai.api_key = KEY
def generate_response(text):
    response = openai.Completion.create(
        prompt=text,
        engine='text-davinci-003',
        max_tokens=100,
        temperature=0.7,
        n=1,
        stop=None,
        timeout=15
    )
    if response and response.choices:
        return response.choices[0].text.strip()
    else:
        return None

res = generate_response("Hello, how are you?")

print(res)

What did I do wrong, and why did my first request give this error?

Rok Benko
  • 14,265
  • 2
  • 24
  • 49
Your Death
  • 11
  • 2
  • Does this answer your question? [OpenAI ChatGPT (GPT-3.5) API error 429: "You exceeded your current quota, please check your plan and billing details"](https://stackoverflow.com/questions/75898276/openai-chatgpt-gpt-3-5-api-error-429-you-exceeded-your-current-quota-please) – Rok Benko Jul 02 '23 at 17:11

1 Answers1

0

Generate a new API key if your old API key was generated before you upgraded to the paid plan.

Rok Benko
  • 14,265
  • 2
  • 24
  • 49