I following all the steps from the Quickstart tutorial. When I ran the python code for my first API request, i got error openai.RateLimitError: Error code: 429.
My usage limit shows, i haven’t made any API request before. I am from India (a country which is supported by openAI for API requests).
Thanks for your response. I am in first tier. I added $10 dollars to my account to start experimenting with the APIs. In the first sample in the documentation, gpt 3.5 model is used. I tried with that and getting this error.
I think I should be eligible for using gpt-4 model also but if I change it to 4 it gives error 404, indicating that I do not have access.
Please guide as I am stuck and cannot proceed.
Hi, I copied as is from the official openai documentation. I am running the code below as is. With 3.5 I am getting error code 429. With GPT-4 I am using model “gpt-4-0125-preview” and getting error 404.
from openai import OpenAI
client = OpenAI()
completion = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "You are a poetic assistant, skilled in explaining complex programming concepts with creative flair."},
{"role": "user", "content": "Compose a poem that explains the concept of recursion in programming."}
]
)
print(completion.choices[0].message)
Hi, I created another api key and tried. Getting the same error. sharing more details from execution:
Traceback (most recent call last):
File " /env/openai-test.py", line 4, in
completion = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_utils/_utils.py", line 275, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/resources/chat/completions.py", line 663, in create
return self._post(
^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_base_client.py", line 1200, in post
return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_base_client.py", line 889, in request
return self._request(
^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_base_client.py", line 965, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_base_client.py", line 1013, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_base_client.py", line 965, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_base_client.py", line 1013, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File " /env/lib/python3.12/site-packages/openai/_base_client.py", line 980, in _request
raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.’, ‘type’: ‘insufficient_quota’, ‘param’: None, ‘code’: ‘insufficient_quota’}}
I ran a sequence using the make tool and it shows 268 token usage from that run.
I have $120 usage limit for my company. Currently I have $9.83 in my account and used $0.17. This usage is from make tool this and last week.
Sorry, I don’t know how to further help you without taking a look at your account. It’s possible that this is just a transient issue and will go away in a day or two, it’s possible that you may need to talk to help.openai.com, it’s possible that we’re miscommunicating something. Perhaps someone else on this forum has some ideas.
I appreciate all your help. I am able to run script through curl command and external tools like Make. When I create a python script file and trying to execute then it is throwing error. I have also flagged it to OpenAI help but did not receive any response as yet. Will continue to resolve this. Again thanks for your time.
Seeing as I’m facing the same issue as nn5jds8fqf, has there been any new solutions to the aforementioned problem?
A reminder of the problem: I get the following error when trying to make my first API-request:
raise self._make_status_error_from_response(err.response) from None
openai.RateLimitError: Error code: 429 - {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details. For more information on this error, read the docs: https://platform.openai.com/docs/guides/error-codes/api-errors.’, ‘type’: ‘insufficient_quota’, ‘param’: None, ‘code’: ‘insufficient_quota’}}
I know I still have tokens left, the $5 you get when opening an account. As I have not yet put additional money, I cannot change any rate limits. The used API-key was made earlier today and has been set as an environment variable. I can confirm it is correct, because when it is changed slightly, the error changes to tell me the key is incorrect.
Haha same here my company told us to do a deeplearning.ai tutorial pasted the first tutorial in to try & gives 429 I will see if adding credits helps not an amazing experience so far. But I guess devs are used to getting stuck on licensing issues