Struggling with the API Migration and Quota Errors

I stepped away for a couple of months and I am getting back to devving on the API but now I am getting these migration warnings - I can’t follow the migration instructions apparently, I’m getting insufficient quota errors (with no quota used), and I need some help.

Can I just uninstall everything and reinstall with the new 1.x interface?

Any help would be appreciated - Ive been banging my head on this wall for hours. Thanks in advance!

I cant even get a hello world to work!

We’d love to help, but we need more info.

What libraries are you using? Code? Models?

Billing up to date? Credit card attached? Credits purchased in advance?

Open AI Library: Version: 1.13.3
Python 3.11

This code I found at the API Documentaion:

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)


Just paid my bill - all up to date

Still not working? Can you show the error it returns?

Sure - thanks for your help- I wrote a full gpt app that interfaced with a database and everything back at the end of December, then took a break for the holidays and when I came back I cant get anything to work.


C:\Users\frank>C:/Users/frank/AppData/Local/Programs/Python/Python311/python.exe “c:/Users/frank/Documents/My-Python/test lab/hello chat world.py”
Traceback (most recent call last):
File “c:\Users\frank\Documents\My-Python\test lab\hello chat world.py”, line 4, in
completion = client.chat.completions.create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai_utils_utils.py”, line 275, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai\resources\chat\completions.py”, line 663, in create
return self._post(
^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\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 “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai_base_client.py”, line 889, in request
return self._request(
^^^^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai_base_client.py”, line 965, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai_base_client.py”, line 1013, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai_base_client.py”, line 965, in _request
return self._retry_request(
^^^^^^^^^^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\site-packages\openai_base_client.py”, line 1013, in _retry_request
return self._request(
^^^^^^^^^^^^^^
File “C:\Users\frank\AppData\Local\Programs\Python\Python311\Lib\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’}}

image

That’s your limit, not how much money/credits you have in your account.

The error is 429 - check your plan or billing details.

You haven’t prepurchased credits in order to fund services.

Click here: https://platform.openai.com/account/billing/overview

Press “buy credits” – or go all the way through add payment method and then the credit purchase that comes after if you’ve already been switched.

1 Like

I’m confused - I have a $40 quota but then I have to add credits? what the point of having a limit?

hmm- I dont remember tunring this off
image
that could be the problem

I added $10 to the credit - How long does it usually take to register?

The problem is accounts that were previously on a monthly bill plan are being switched by OpenAI, or perhaps you never paid but were using a three-month trial credit that expired.

The error says you have no way of paying for your call. Feed the machine money… might take minutes or hours to be able to call API again.

i thought I was on a plan where they charge me for usage up to my defined limit but looks like something else is going on - been on this for almost 6-8 months.

ok its working now - thanks everybody!
The problem was I guess I didn’t pre-pay credits

1 Like