https://github.com/doemser/next-openai-integration
OpenAI API Starter - Real-time chatbot with OpenAI.
https://github.com/doemser/next-openai-integration
javascript next nextjs openai-api react starter-project
Last synced: about 1 year ago
JSON representation
OpenAI API Starter - Real-time chatbot with OpenAI.
- Host: GitHub
- URL: https://github.com/doemser/next-openai-integration
- Owner: doemser
- Created: 2023-04-03T23:17:05.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-10T10:49:08.000Z (about 3 years ago)
- Last Synced: 2025-03-28T14:11:09.404Z (over 1 year ago)
- Topics: javascript, next, nextjs, openai-api, react, starter-project
- Language: JavaScript
- Homepage:
- Size: 205 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Talk to anyone you like

This repository provides an isolated entrypoint into the world of fetching results from OpenAI's API. It's designed for simplicity and ease of use, perfect for beginners who want to start exploring the powerful capabilities of OpenAI's GPT engines.
The app allows users to input a persona and a question, and uses OpenAI's API to generate a response to the question from the perspective of the specified persona. The app is built using React and the generated response is displayed in real-time on the webpage.
## Getting Started
### Add your API key
Create an account at https://platform.openai.com/signup and obtain your API key.
Copy the `.env.local.example` file to `.env.local`:
```shell
cp .env.local.example .env.local
```
Open the `.env` file and add your OpenAI API key:
```shell
OPENAI_API_KEY=your_api_key_here
```
> If you do not have a paid openai api key, you will need to adjust the model to use something lower than gpt3.5-turbo.
### Run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```