Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

    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


Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: