Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

eyupfidan/openai-node

Repository files navigation

Openai Node.js Rest Api

This project aims to provide a Node.js API for OpenAI's artificial intelligence API to be seamlessly integrated into your projects.

Installation

Manual Install

To manually install the project, run the following command:

npm install

Then update the env.example file with your OpenAI API key and rename it to .env.

Docker Installation

Alternatively, you can use Docker to install the project. Run the following commands:

docker build . -t openai-node-project
docker run -p 8080:8080 openai-node-project

You can also find the Docker image on -> DockerHub

Before running the project, make sure you have signed up for an OpenAI API key and stored it in your environment.

Usage

To use the OpenAI Node.js API, run the following command:

npm start

Then, you can make a POST request to the /fetchQuestion route with the requestText value in the body to receive the response.

Screenshot

Here is an example of how to use the API with a POST request using Postman:

Usage

License

MIT © Eyup Fidan