#help

1 messages · Page 1 of 1 (latest)

tired pumice
#

Heya, I'm trying to get into including GPT in some of my open source projects and I'm struggling to get started with it

My issue is that it believes that my monthly quota has been used up, although I do not believe this is the case

from openai import OpenAI

client = OpenAI(api_key="censored")

stream = client.chat.completions.create(
    model="gpt-3.5-turbo",
    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="")

Here is the program I'm working with, I took it from the API documentation and basically just tried to paste it in with my API key

However I recieve the error:

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'}}
sudden pikeBOT
#

Hi @tired pumice. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

I understand that you're encountering an issue with the OpenAI API, specifically receiving a 429 - insufficient_quota error. This error typically indicates that you've exceeded the usage limits associated with your account. However, you've mentioned that you believe this isn't the case.

There are a few possible reasons for this issue:

  1. Rate Limits: OpenAI imposes certain rate limits on API usage. If you're on the free tier, you might have hit these limits. You can check the rate limits guide (https://platform.openai.com/docs/guides/rate-limits?context=tier-free) for more information.

  2. Billing Issues: If you're on a paid tier, you might have exhausted your quota for the current billing period. Even if you have a positive balance, you might still encounter this issue if you've hit your usage limit for the current period.

  3. API Key Issues: Ensure that your API key is correctly set and valid. If you're using environment variables to store your API key, make sure it's correctly set in your environment.

  4. Bug or Glitch: There have been instances where users faced this issue due to a bug or glitch. In such cases, the issue was resolved by the OpenAI team[^1^].

If you've checked all these possibilities and the issue persists, I recommend reaching out to OpenAI support for further assistance.

^1^]: [Forum Post: Assistance AI Playground - I am getting an error:- Run failed - You exceeded your current quota, please check your plan and billing details > Official Answer (https://community.openai.com/t/528639)

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: