https://discord.gg/botpress logo
Open Ai API call error
# 🤝help
w
hi ! maybe you can share your code ?
or use this one from the doc
Copy code
const apiKey = '<OpenAI's APIKey>';
const {data} = await axios.post("https://api.openai.com/v1/chat/completions", {
  "model": "gpt-3.5-turbo-0301",
  "messages": [{"role": "user", "content": event.preview}]
}, { headers: {'Authorization': `Bearer ${apiKey}`}});

workflow.variableName = data.choices[0].message.content;
w
so it must come from openAI side
or maybe an deprecated model