Moderations endpoint returns insufficient_quota

I’ve been trying to use the moderations endpoint for the first time, with no success.

I have a credit balance, and I’m able to successfully create chat completions. However every time I hit the moderations endpoint, using the instructions provided in the API docs, either via curl or the python library, I get “You exceeded your current quota, please check your plan and billing details.”

Any idea why this might be happening?

2 Likes

I have this problem too. The API doesn’t work. The tutorials make it seem simple. The error messages are wrong. This is a bug for two reasons: 429 is the wrong code. insufficient_quota is not true.

completion = client.chat.completions.create(
model=“gpt-4”,
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)

stream = client.chat.completions.create(
model=“gpt-4”,
messages=[{“role”: “user”, “content”: “Say this is a test”}],
stream=True,
)
for chunk in stream:
if chunk.choices[0].delta.content is not None:
print(chunk.choices[0].delta.content, end=“”)

openai.RateLimitError: Error code: 429 - {‘error’: {‘message’: ‘You exceeded your current quota, please check your plan and billing details.’, ‘type’: ‘insufficient_quota’, ‘param’: None, ‘code’: ‘insufficient_quota’}}

1 Like

Similarly, I am continuing to receive insufficient_quota error like you. There is another thread open right now where an OpenAI Dev Relations team member explains that the issue is still ongoing for some folks.

1 Like

I don’t have this issue.

I also have not just recently activated my account and made my first payment, which was who was affected by payment system issues earlier today, which apparently still needs attention.

What is peculiar is that the moderations API should be without cost and doesn’t consume credits. If a completions endpoint works for you, yet moderations gives a “please check your plan and billing details”, that certainly seems like some part of your recent credit purchase still has not taken effect or been repaired across all systems.

There’s a few things you can do (short of paying in another $5) to see if you can get a clear account status:

  • in the account “limits” page there are monthly limits. Glitches before this one were occasionally cleared by altering those values.
  • you can generate a new API key and see that it works in both code for chatcompletions and then moderations.
  • visit the billing settings and see that your personal preferences are filled out and re-save.

If using Python, and you’ve placed your OPENAI_API_KEY as an environment variable, the last code box in this post will give you a bit of immediate feedback to know it’s not your method:

Thanks @_j , a lot of helpful tips. I think some people continued to experience the issue besides having addressed each of the points you mentioned. No matter now, because the issue seems to have resolved automatically for me. Maybe it will have resolved for the others in this thread?

Did you resolve this issue, and did you find out how?
I am facing the same issue, with similar circumstances.