I use R to interface with the chatGPT API (mainly 3.5). I ran a script with no problems, but noticed throttling two days ago. I checked and found a warning in R (which appeared nowhere on the platform) that I was over quota.
I am nowhere near the financial limit set for my tier 1 account. I see there are daily request limits. It has now been two days with no use and I am still getting “over quota” blockage. I created a new API key. Same error.
Any idea why I am being incorrectly blocked from accessing my account?
Welcome to the Forum!
Do you have sufficient funds on your OpenAI developer account?
As OpenAI now largely operates pre-paid billing, you need to pre-fund your API use. The limit does not imply that you have funds available.
1 Like
Yes, that’s what is bizarre. I’m looking at my “usage” showing plenty of money/credit, but my API (via R) says “over quota”. I thought it likely refers to the daily pull limits, so I waited two days to try it again. When that didn’t work, I drew a new API token to be sure it was not an old error tied to a token. No luck.
Please provide your request code and the exact error message received.
With my token set as chatGPT_API, I use:
chatGPT_response <- POST(
url = "[API LINK HERE]",
add_headers(Authorization = paste("Bearer", chatGPT_API)),
content_type_json(),
encode = "json",
body = list(
model = "gpt-3.5-turbo-0301",
messages = list(list(role = "user", content = "Why is the sky blue?"))
)
)
content(chatGPT_response)
The link provided is generic and does not personalize (e.g., your calls are over, your spend is set low, etc.)
> content(chatGPT_response)
$error
$error$message
[1] “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.”
$error$type
[1] “insufficient_quota”
$error$param
NULL
$error$code
[1] “insufficient_quota”
Is this a project key or a user key?
Projects have their own limits, so it is possible you have a monthly spend limit set on a project that you’re not seeing in the default account view.
There are Organization limits and Project limits,
So if you check your account settings at https://platform.openai.com/settings/organization/general and look at the limits for the organization and for whichever project the API key belongs to, you might see something there which helps.
2 Likes
Thanks for this. I found two issues.
My balance on that page was “$0”, which I did not think should happen because I set a high limit under Project “Usage” and “Cost” tab that had not been exceeded. I added an “auto-pay” so my personal would not reach $0, but I do not love that there was no absolute limit (e.g., auto-load could spend $1,000 and I find out after).
I am still a bit confused because the API I was using was a project key, not a personal key (even generated a new one to be sure). I’m going to try to keep a close eye on the costs this week and don’t know that I recommend this as a long-term solution.
I’ll try to remember to update if the project key pulls from the intended “pot” of funds in the future. Thank you for the look!
1 Like
Always happy to help out fellow R users!
1 Like