A simple Nodejs function to call the ChatGTP endpoint
install axios: npm i axios
install dotenv: npm i dotenv
To avoid exposing your API key create a .gitignore and .env file
Store your OpenAi api key in the named variable OPENAI_API_KEY
Add .env to the gitignore file
change the input variable to anything you liken and run: node index.js
in the console and see your repsonse from ChatGTP