I got this error tried many things to resolve it but can’t please help me
I checked API key its working in python code
this is the code:
const { Configuration, OpenAIApi } = require("openai");
const configuration = () =>{ return Configuration (
{
organization: "",
apikey:"API_key"
}
);
};
const openai = () =>{ return OpenAIApi(configuration);};
async function callApi() {
const response = await openai.createChatCompletion({
model: "gpt-3.5-turbo",
prompt: "Say this is a test.",
max_tokens: 7,
temperature: 0,
});
console.log(response.data.choices[0].text)
}
callApi();