Complete beginner can't make simple API program work due to "RateLimitError"

Here is my code: (I filled in my OpenAI API key). The error message starts like this > "RateLimitError Traceback (most recent call last)

Cell In[13], line 22
20 if name == “main”:
21 question = “Who won the 1970 World Cup?”
—> 22 answer = ask_chatgpt(question)
23 print(f"ChatGPT says: {answer}")
Here is my code:

import os
from openai import OpenAI

Set the API key using the os.environ method

os.environ[“OPENAI_API_KEY”] = “sk-…”

Initialize the OpenAI client

client = OpenAI()

def ask_chatgpt(prompt, model_name=“gpt-3.5-turbo”):
“”“Sends a prompt to ChatGPT and returns the response.”“”
completion = client.chat.completions.create(
model=model_name,
messages=[
{“role”: “user”, “content”: prompt}
]
)
return completion.choices[0].message.content

if name == “main”:
question = “Who won the 1970 World Cup?”
answer = ask_chatgpt(question)
print(f"ChatGPT says: {answer}")