A simple Next.js chatbot app to demonstrate the use of the Vercel AI Gateway with the AI SDK.
- Clone this repository with the Deploy button above
- Install the Vercel CLI if you don't already have it
- Clone the repository you created above:
git clone <repo-url>
- Link it to a Vercel project:
vc link
orvc deploy
- Install packages with
pnpm i
(ornpm i
oryarn i
) and run the development server withvc dev
- Open http://localhost:3000 to try the chatbot
- If you prefer running your local development server directly rather than using
vc dev
, you'll need to runvc env pull
to fetch the project's OIDC authentication token locally- the token expires every 12h, so you'll need to re-run this command periodically.
- if you use
vc dev
it will auto-refresh the token for you, so you don't need to fetch it manually
- If you're linking to an existing, older project, you may need to enable the OIDC token feature in your project settings.
- visit the project settings page (rightmost tab in your project's dashboard)
- search for 'OIDC' in settings
- toggle the button under "Secure Backend Access with OIDC Federation" to Enabled and click the "Save" button
This repository is maintained by the Vercel team and community contributors.
Contributions are welcome! Feel free to open issues or submit pull requests to enhance functionality or fix bugs.