openai-php / client

⚡️ OpenAI PHP is a supercharged community-maintained PHP API client that allows you to interact with OpenAI API.
MIT License
4.7k stars 483 forks source link

$ npm install openai #191

Closed Beeloo0011 closed 1 year ago

Beeloo0011 commented 1 year ago

const { Configuration, OpenAIApi } = require("openai"); const configuration = new Configuration({ apiKey: process.env.OPENAI_API_KEY, }); const openai = new OpenAIApi(configuration); const chat_completion = await openai.createChatCompletion({ model: "gpt-3.5-turbo", messages: [{ role: "user", content: "Hello world" }], });