Is "Make your first API call" API key valid?

Hello, I set up my developer openai account today. I saw table with “my test key” and example code.

I installed OpenAI by pip install openai

Then I ran that code but I saw this error:
Can I ask what could I to do with that?
Thank you for reply

File “C:\Users\david\AppData\Local\Programs\Python\Python310\Lib\site-packages\openai_base_client.py”, line 1017, in request

  • response.raise_for_status()*
    File “C:\Users\david\AppData\Local\Programs\Python\Python310\Lib\site-packages\httpx_models.py”, line 829, in raise_for_status
  • raise HTTPStatusError(message, request=request, response=self)*

httpx.HTTPStatusError: Client error ‘429 Too Many Requests’ for url ‘htt-ps://api.openai.com/v1/chat/completions’
For more information check: ht-tps://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429

During handling of the above exception, another exception occurred:

File “C:\Users\david\chatgptskript.py”, line 7, in

  • completion = client.chat.completions.create(*
    File “C:\Users\david\AppData\Local\Programs\Python\Python310\Lib\site-packages\openai_utils_utils.py”, line 287, in wrapper
  • return func(*args, *kwargs)
    File “C:\Users\david\AppData\Local\Programs\Python\Python310\Lib\site-packages\openai\resources\chat\completions\completions.py”, line 1087, in create
  • return self._post(*
    File “C:\Users\david\AppData\Local\Programs\Python\Python310\Lib\site-packages\openai_base_client.py”, line 1249, in post
  • return cast(ResponseT, self.request(cast_to, opts, stream=stream, stream_cls=stream_cls))*
    File “C:\Users\david\AppData\Local\Programs\Python\Python310\Lib\site-packages\openai_base_client.py”, line 1037, 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: ht-tps://platform.openai.com/docs/guides/error-codes/api-errors.’, ‘type’: ‘insufficient_quota’, ‘param’: None, ‘code’: ‘insufficient_quota’}}

It’s a valid key. You’d get stopped cold with an invalid key error otherwise.

However, the onboarding of some undisclosed trial amount might never arrive and you get no service if you don’t pay for some credits when you are offered that next screen. See some back-and-forth of not getting some free usage on cheap models, what OpenAI says is there:

In the platform site, go to “billing” and check “account balance” to see the amount available to pay for billed usage at API pricing.

Additionally, that initial payment consistently takes between many minutes and several hours to fully activate an account, and then under limits, to switch an account to “tier 1” showing at the top and bottom of the page.

429: …check your plan and billing - the error you get with no funds available and an unactivated organization.

So:

  • wait
  • try
  • pay
  • wait
  • try

Hello, thank you for reply. So I need to pay for that.
Do you think this problem could also be related to mine? https://status.openai.com/

Don’t prepay for services by adding some account balance, a purchase of API credits that expire in a year == no ability to pay for services.

That is expected.

That you’d ever be able to use the API without paying is only written by one OpenAI staffer in that one thread. It seems it didn’t work for you like it didn’t work for me, and the only thing to be done is keep trying one of the mini models…or give up and just pay.

I did double check with staff that it’s expected that there should be free API usage for some models models with very low rate limits, like three RPM.

Unfortunately, just like @_j , I wasn’t able to confirm this and have forwarded the feedback to staff.

In your specific case I suggest to get 5$ of credits and start building. I hope that’s a reasonable solution for you.