Hi, I am running a python script using openai to connect to my icloud inbox. I am trying to class email as SPAM
def classify_with_ai(text):
try:
resp = client.chat.completions.create(
model=“gpt-4o-mini”,
messages=\[
{
“role”: “user”,
“content”: (
“You are a spam filter.\\n”
“Classify this email as ‘spam’ or ‘not spam’. "
“Reply with exactly one word: spam or not spam.\\n\\n”
f"Email text:\\n{text\[:2000\]}”
),
}
\],
max_tokens=5,
)
label = resp.choices\[0\].message.content.strip().lower()
return “spam” if “spam” in label else “not spam”
except Exception as e:
print(f"AI error: {e}")
return “error”
I am on the free tier. The script connects and finds the emails but as soon as the code above runs I get a 429 with insufficient_quota
I am very new to this. Can’t I perform that task with the free tier?