Anyone know why this is erroring in code 400? Im trying to use the api in a discord bot.
const ai = new OpenAIApi(config);
const prompt = interaction.options.getString("query", true);
const completion = await ai.createCompletion({
engine: "text-davinci-002",
n: 1,
prompt: `Write a response to the message: ${prompt}`,
});
const response = completion.choices[0].text;
await interaction.reply(response);```