An example of building an AI chat app using the Vercel AI SDK and Next.js
- Clone the repo:
git clone https://github.com/komzweb/vercel-ai-sdk-nextjs.git
- Add your OpenAI API key:
cd vercel-ai-sdk-nextjs
cp .env.local.example .env.local
Set your secret API key to OPENAI_API_KEY
in the .env.local
file.
- Install dependencies:
npm install
- Run the server:
npm run dev
Open http://localhost:3000 with your browser to see the result.