This example shows how to implement a simple chat bot using Next.js and OpenAI API.
Online Demo: https://next-openai-chatgpt.vercel.app
- rename
.env.example
to.env.local
:
cp .env.example .env.local
- update
OPENAI_API_KEY
with your OpenAI secret key.
OPENAI_API_KEY = xxxxx;
npm install
npm run dev
# or
yarn
yarn dev
View the app at http://localhost:3000