Vercel AI SDK

Use Kyma with the
Vercel AI SDK

Official Kyma provider, active open models, streaming support, and a working Next.js starter.

Official Kyma provider

Use `@kyma-api/ai-sdk` with the Vercel AI SDK. No custom wrapper code needed.

Streaming-ready starter

The repo includes a Next.js chatbot starter using `streamText` and `useChat`.

One API, active models

Use Kyma aliases or active model IDs through one endpoint with Kyma routing and failover.

Quick path

npm install @kyma-api/ai-sdk ai

import { generateText } from "ai";
import { kyma } from "@kyma-api/ai-sdk";

const { text } = await generateText({
  model: kyma("best"),
  prompt: "Explain retrieval-augmented generation in one paragraph.",
});

What to use

Best default: best → qwen-3.6-plus

Code-focused: code → qwen-3-coder

Fast path: fast → gemini-3.5-flash-lite

Agent/tool use: agent → kimi-k2.6

Long context: long-context → gemini-3-flash

Build on a working path

Start with the official guide, validate with the Next.js starter, then adapt for your app.

Explore more