Help for consume api - apikey token problem

I have a problem for using my api tokens:

{
“error”: {
“message”: “You exceeded your current quota, please check your plan and billing details.”,
“type”: “insufficient_quota”,
“param”: null,
“code”: “insufficient_quota”
}
}

i have $0 / $120.00 limit

1 Like

Remove the current key and create a new one, test it and tell us if it works.

3 Likes

That is your limit / amount used not your current credit balance.

Sounds like you need to add at least $5 to your account.

Cause: You have run out of credits or hit your maximum monthly spend.
Solution: Buy more credits or learn how to increase your limits.

Good luck!

1 Like

The problem still persists,.
I just tested it but it was the first thing I did previously, I deleted about 4 api keys

I understand.
the problem is that I never used the openai api, so I was confused about this consumption. I thought that paying for the plus would give me access to some type of content.

You could try to make a new org to not use default one and create an api key inside, maybe it works.
Or send a message to support with your problem persist https://help.openai.com


Try this code:

import openai

# Set up your OpenAI API key
openai.api_key = 'your_api_key'

# Initialize the OpenAI API client (this step might be needed for certain advanced configurations)
client = openai.Client(api_key=openai.api_key)

# Create a chat completion using the correct method
response = client.chat.completions.create(
    model="gpt-4o-mini", 
    messages=[
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Tell me about OpenAI's API."}
    ],
    max_tokens=1000,
    temperature=0.7  # Adjust creativity level as needed
)

# Print the assistant's response
print(response.choices[0].message.content)