I am getting an error for a freshly top upped account. This is first time. I top upped with $15 and I am getting an rate limit error.
const apiKey = "my api key"
const generateResponseFromAI = async () => {
const requestBody = {
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "You are a helpful assistant."
},
{
"role": "user",
"content": "Write a haiku that explains the concept of recursion."
}
],
};
try {
const response = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${apiKey}`,
},
body: JSON.stringify(requestBody),
})
const data = await response.json();
console.log(data)
} catch (error) {
console.log(error)
}
};
const value = generateResponseFromAI()
How many of you have got this error when top upped freshly. I also want to know about how you fixed this.