Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 428 Bytes

README.md

File metadata and controls

21 lines (12 loc) · 428 Bytes

ChatGTP-NODE-JS-API-CALL

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