Dont get correct output for the first api code?

i insert the API key in secrets but code is not run, output of code show like
Traceback (most recent call last):
File “/home/runner/AICode/”, line 23, in
response = openai.ChatCompletion.create(
File “/home/runner/AICode/venv/lib/python3.10/site-packages/openai/api_resources/”, line 25, in create
return super().create(*args, **kwargs)
File “/home/runner/AICode/venv/lib/python3.10/site-packages/openai/api_resources/abstract/”, line 153, in create
response, _, api_key = requestor.request(
File “/home/runner/AICode/venv/lib/python3.10/site-packages/openai/”, line 226, in request
resp, got_stream = self._interpret_response(result, stream)
File “/home/runner/AICode/venv/lib/python3.10/site-packages/openai/”, line 619, in _interpret_response
File “/home/runner/AICode/venv/lib/python3.10/site-packages/openai/”, line 679, in _interpret_response_line
raise self.handle_error_response(
openai.error.RateLimitError: You exceeded your current quota, please check your plan and billing details.
exit status 1

Hi @bondarvikramaditya24,

We are looking into this issue. It would be really helpful if you could attach a screenshot of the Open AI page.
go to ---- go to API ---- click on personal ---- go to view API Keys ---- on the left hand side, click on Usage.
After clicking on Usage, send me the screenshot of the whole window.

Hi @bondarvikramaditya24,

Regarding the API issue, many users may encounter an error if they do not have sufficient credits to access the OpenAI API keys.
If you are facing this problem, it is crucial to verify the usage of your API key, particularly if it has a balance of $0 or if it has expired.
In such cases, it is recommended to create a new account using a different phone number and a different email ID.
By doing so, you will receive $5 worth of credits, which will remain valid for three months.

You should try by creating new account

I am facing the same problem
I have tried everything and have just created a new account, its not working

Hi @raks.ranjan

Can you please share screenshots of the code and the error you are facing?

@raks.ranjan You have to create a new account with a combination of new email id and different phone number each time to get the free credits. Please follow this step and create the account to get the free credits and generate your API key.

If the issue is not resolved let us know.

It might be because of either of the following two reasons:

  1. You have used and exhausted all the credits provided to you.
    In that case, you can upgrade your account by paying bills.
  2. You have not actually used the credits, but the credits have expired. This happened to me a few days back.
    If this is the case, try signing up with another email and phone number. Make sure that you are using a different mobile number that was not already registered.

PS: You can try the 2nd approach for the 1st problem, too.
Hope it helps!