I’m working on a project and decided to use the openai API alongside (FREE version), but on working with it on the backend of my code (NODEJS). I discovered that on requesting the API, it keeps telling me that, I’ve exceeded my current quota. but my usage doesn’t even read at all, I haven’t made any successful call to the API, my first API call threw that error and also subsequent ones as well.
here’s are the relevant code, maybe if someone could help out with what’s wrong
there’s also a route file that on making a request to that API, calls this function, I personally don’t think I implemented anything wrong, but maybe I’m wrong.
Please I’d be glad if anyone could help suggest a fix to this as soon as possible, I do want to upgrade but I can’t now because I keep getting that error message.
but the issue is I don’t know if upgrading I’d still come across this same issue.
I mean I haven’t even made any request to the API successfully and keep getting that error message. Isn’t it supposed to be when someone makes 3 consecutive requests per minute that the error is supposed to be shown?
I also attached my usage screenshot. still reads 0
import openai
API_KEY = "sk-OJGpZ4...4zLcPtrB"
client = openai.OpenAI(api_key=API_KEY)
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)
Make sure to adjust the API key.
I don’t exactly follow how you could build a script like the one you originally posted, if you never were able to contact the API in the first place.
Let’s find out what’s going on.
From what I can tell: there have been other free tier users with the rate limiting problem who then went ahead and got better rate limits after purchasing credits. But this means that you should be able to make API calls without buying credits and it’s your implementation that is causing the issue.
But I can’t tell for sure since I don’t have the possibility to create a free tier account and confirm this.
I can confirm that after purchasing a minimum amount of credit ($5 worth) API starts working. Note, however, that a new token must be created after the purchase, otherwise the same quota error will be returned.
To me this looks like either a bug or a documentation defect: Settings/Limits shown non-zero figures both before and after a purchase