Skip to content

Latest commit

 

History

History
22 lines (18 loc) · 520 Bytes

openai_gtp4o.md

File metadata and controls

22 lines (18 loc) · 520 Bytes

<openai_docs> Node.js:

import OpenAI from "openai"; const openai = new OpenAI();

const completion = await openai.chat.completions.create({ model: "gpt-4o-mini", messages: [ { role: "system", content: "Your System Instructions" }, { role: "user", content: "Your Prompt", }, ], });

console.log(completion.choices[0].message);

Ensure you have your OpenAI API key in the .env file Example: OPENAI_API_KEY=your_api_key_here </openai_docs>