Skip to content

Instantly share code, notes, and snippets.

/**
* @customfunction
*/
async function completion(content: string) {
const response = await fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer <OPENAI_API_KEY>"
},