I am trying to use the OpenAI API for the first time, and have the following python script in MS Visual Studio:
import openai
import os
openai.api_key = os.getenv('OPENAI_API_KEY')
response = openai.chat.completions.create(
model='gpt-4o-mini',
messages=[{"role": "user", "content": "Give me two flavors of pie"}],
max_tokens = 300)
print(response)```
The code runs, but I get the following error:
```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'}}```
This does not make sense because I have $15 of credit available. I have verified that the api key is correct, and restarting Visual Studio does not resolve the issue.
The account has Tier-1 limits - this is my first request on this account.