skip to Main Content

API Key Undefined in Axios – Reactjs

So I literally tried fetch and switch to axios to see what was wrong and still says my API key is undefined `import axios from "axios"; const apiKey = process.env.OPENAI_API_KEY; console.log(apiKey); axios .post( "https://api.openai.com/v1/chat/completions", { model: "gpt-3.5-turbo", messages: [{ role:…

VIEW QUESTION
Back To Top
Search