#Getting error 401

4 messages · Page 1 of 1 (latest)

blazing iron
#

Hi, im getting error 401 every time i try to run my script, i checked the key multiple times

#

this is the code ```js
const { OpenAIApi } = require("openai");

const apiKey = "the key";
const openai = new OpenAIApi(apiKey);

openai.createCompletion({
model: "text-davinci-003",
prompt: "what is an atom made of",
temperature: 0.5,
max_tokens: 60,
top_p: 1.0,
frequency_penalty: 0.5,
presence_penalty: 0.0,
})
.then(response => {
console.log(response.choices[0].text.trim());
})
.catch(error => {
console.error('Error:', error.message);
});```

quasi bramble
#

What does the error actually say

#

What is the error message