/node-chatgpt-api

A Node integration with OpenAI api for text completions

Primary LanguageJavaScript

👨‍🚀 Repo for the purpose of personal study

GitHub top language GitHub language count Repository size

⚔️ Proposed Challenge

Create a api integration with openIA text completion (ChatGPT) with Node.

# Routes
POST     /api/prompt      sending prompt to text completion

🚀 Technologies

This code source was developed with the following technologies:

⚛️ Main Techs

📚 Libs & Dependencys

  • 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

🥷 Techniques

ℹ️ How To Use

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