AI SDK Gateway Demo (Svelte)
A simple Svelte chatbot app to demonstrate the use of the Vercel AI Gateway with the AI SDK.
Getting Started
One-time setup

- 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 under your account:
vc link
- Visit the linked Vercel project to enable an authentication token for use with AI Gateway (we're working on automating this):
- 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
Usage
- Fetch the project's OIDC authentication token locally via
vc env pull
. The token expiry is 12h. You'll need to re-run this command to fetch a new token when it expires (we're working on automating this).
pnpm i
(or npm i
or yarn i
) and vc dev
- Open http://localhost:5173 to try the chatbot.
Authors
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.