icy-address-63961
07/10/2023, 5:07 PMjs
const apiKey = '<YOUR API KEY HERE>'
const {data} = await axios.post("https://api.openai.com/v1/chat/completions", {
"model": "gpt-4",
"messages": [{"role": "user", "content": event.preview}]
}, { headers: {'Authorization': `Bearer ${apiKey}`}});
workflow.gptResponse = data.choices[0].message.content;