I have installed the environment to use the API but even the first script fails saying "Error code: 429 - {'error': {'message': 'You exceeded your current quota, ..."
or "openai.BadRequestError: Error code: 400 - {'error': {'code': 'billing_hard_limit_reached', "
Note: in my usage menu, the balance says “$5.00 / $5.00”
This happens even with the demo example contained in https://platform.openai.com/docs/quickstart?context=python:
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)
I cannot have exceeded the quota because I haven’t successfully run even a single script since I created the API key.
I created a new API without success: first execution ==> quota exceeded error
What I am doing wrong?
Note: in my usage menu the balance is $5.00 / $5.00
So I haven’t consumed any credit.
Thank you for the clarification, I misunderstood the meaning of $5/$5. However I am curious to understand how and when I used these credits. Although I am using chatgpt since one year, I started using the API today for the first time, and I have created the API key today. I got this error since the first time I run a script.
Yeah, credits expire. I think the initial 5 dollars expire after a month. Some credit grants have weird expiration dates, and even pre purchased credits seem to expire after a year.
The free credits were created when an OpenAI account was created in April. Then they expired three months later.
The system worked fine when there was only the API and the only way to use it was by trial credits or then adding a card to receive a monthly bill.
Then OpenAI added ChatGPT, used the same account system, so people signed up for ChatGPT, and got credits in the API system they had never heard of. Which then expire. (this has been somewhat fixed, the credits now being granted when a new account makes their first API key, but OpenAI won’t go back and gift the credits again if expired)
Now a large number of accounts have been migrated from monthly billing to prepay-only. You are cut off from API services if you don’t pay up front.