For a complete demo and GitHub repo, you can check this out directly.

Next JS

With Next JS, Vercel AI, a simple chat with avatar experience.

Setup

Clone and try out the repo demo!

npx degit avatechgg/avatars-nextjs-demo avatars-nextjs-demo

Install and run the dependencies.

cd avatars-nextjs-demo
pnpm install
pnpm dev

The demo request for OpenAI API key and Eleven Labs API key. You can get the API key from the respective website.

OPENAI_API_KEY=""
NEXT_PUBLIC_ELEVEN_LABS_API_KEY=""

Explaination

This demo shows how to integrate with Vercel AI SDK, visit this get started with Vercel AI SDK https://sdk.vercel.ai/docs/guides/openai#guide-chat-bot

Below is step by step explaination on how to integrate with Vercel AI SDK.