|
|
|
|
|
by css_apologist
181 days ago
|
|
const body = JSON.stringify({
model: "gpt-4.1-mini",
messages: [{ role: "user", content: "hii" }]
});
const r = t.fetch("https://api.openai.com/v1/chat/completions", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${API_KEY}`
},
body
});
const json = JSON.parse(r.body);
.. no async? i wonder how they are doing this & how they plan on more js interop |
|