A demo repo based on OpenAI GPT-3.5 Turbo API.
More powerful than diu8081/chatgpt-demo
Demo: https://vercel-chatgpt-github.vercel.app
-
Setup & Install dependencies
First, you need Node.js (v18+) installed.
pnpm i
-
Make a copy of
.env.example
, then rename it to.env
-
Add your OpenAI API key to
.env
OPENAI_API_KEY=sk-xxx... // also you can set muiltiple keys OPENAI_API_KEY=sk-xxx|sk-yyy
-
Run the app
pnpm dev
-
Deploy to Vercel
vercel deploy --prod
await fetch("/api", {
method: "POST",
body: JSON.stringify({
message: "xxx",
key: "xxxx"
})
})
MIT