This project aims to provide a Node.js API for OpenAI's artificial intelligence API to be seamlessly integrated into your projects.
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.
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.
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.
Here is an example of how to use the API with a POST request using Postman:
MIT © Eyup Fidan