Locked out of API with rate limit error, I am no where close to hitting rate limit

Hi,
I am running the following code with the API, which is taken directly from the documentation:
import openai

openai.api_key = 'sk-'
response = openai.ChatCompletion.create(
    model="gpt-3.5-turbo",
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Who won the world series in 2020?"},
        {"role": "assistant", "content": "The Los Angeles Dodgers won the World Series in 2020."},
        {"role": "user", "content": "Where was it played?"}
    ]
)

I get the following erorr when running:

  File "/home/azureuser/test.py", line 3, in <module>
    response = openai.ChatCompletion.create(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/miniconda3/lib/python3.11/site-packages/openai/api_resources/chat_completion.py", line 25, in create
    return super().create(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/miniconda3/lib/python3.11/site-packages/openai/api_resources/abstract/engine_api_resource.py", line 153, in create
    response, _, api_key = requestor.request(
                           ^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/miniconda3/lib/python3.11/site-packages/openai/api_requestor.py", line 298, in request
    resp, got_stream = self._interpret_response(result, stream)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/azureuser/miniconda3/lib/python3.11/site-packages/openai/api_requestor.py", line 700, in _interpret_response
    self._interpret_response_line(
  File "/home/azureuser/miniconda3/lib/python3.11/site-packages/openai/api_requestor.py", line 763, in _interpret_response_line
    raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.

I know my account is not hitting any limits:

I am using exactly the same API key as that used in the September API calls. I also tried generating a new key and using that, but I get the same error.

I do have a valid credit card submitted to the payments methods of thebilling section.

What could be causing this?

Hey champ

And welcome to the community forum!

It’s the rate limit you’re hitting, not the usage limit :laughing:

You can find more information on the rate limits here:

You used $20. Did you only pay $20 for credits?

“please check your plan and billing details” should be the hint.

Hi, sorry the screenshot cuts off above, but my balance does have credits remaining:

Hi @pa1994

What are your rate limits for gpt-3.5-turbo?

Also, are your org’s API key(s) being used somewhere/by someone else? Do you have other members in your org that could be making API calls?

You might double-check if you’ve forgotten usage limits you set yourself - it’s not mentioned anywhere in this topic.

Hard limit stops monthly usage at what you set it for.