Vercel AI SDK
Using OpenRouter with Vercel AI SDK
Vercel AI SDK
You can use the Vercel AI SDK to integrate OpenRouter with your Next.js app. To get started, install @openrouter/ai-sdk-provider:
And then you can use streamText() API to stream text from OpenRouter.
TypeScript