👨🚀 Repo for the purpose of personal study
Create a api integration with openIA text completion (ChatGPT) with Node.
# Routes
POST /api/prompt sending prompt to text completion
This code source was developed with the following technologies:
- openAI - To integrate with openAI Algorhitms
- express - For create rest apis with more
- cors - Control access to api requests/resources
- dotenv - Configuration custom file
- nodemon - Node monitoring server for development
To clone and run this application, you'll need Git, Node.js v14.16 or higher + NPM v8 or higher installed on your computer. From your command line:
# Clone this repository
$ git clone https://github.com/felipeAguiarCode/node-chatgpt-api
# Go into the repository
$ cd node-chatgpt-api
# Install dependencies
$ npm install
# Run (development ambient)
$ npm run dev
- to use openai lib
The library needs to be configured with your account's secret key, which is available on the website. Setting API key as an environment variable in .env. before run