Hello there,
I am new to programming. I was struggling to develp a simple Python script to test communicating with ChatGPT. I got a lot of errors but after trying multiple variations, I managed to develop this code;
import os
from openai import OpenAI
client = OpenAI(
# This is the default and can be omitted
api_key=“MY_API_KEY”
)
completion = client.chat.completions.create(
messages=[
{
“role”: “user”,
“content”: “Say this is a test”,
}
],
model=“gpt-3.5-turbo”,
)
response = completion.choices[0].text
print(response)
But now I am getting this:
…/.local/lib/python3.8/site-packages/openai/_base_client.py", line 1020, in _request
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’}}
I have a free account and from HERE, I learnt the rate limit for the model that I am using i.e., gpt-3.5-turbo is , 40,000 TPM or 3 RPM, 200 RPD or 200,000 TPD
How may RateLimimt be reached when this is my the very first attempt?
Best Regards