Kimi K3 laesst sich mit nur zwei Zeilen Code in das Vercel AI SDK integrieren
Moonshots Open-Weight-Modell Kimi K3 mit einem Kontextfenster von einer Million Tokens fehlte bislang im Modellkatalog des Vercel AI SDK. Ein neues npm-Paket namens wallaby-ai-provider schliesst diese Luecke.

Posted on Oct 14 • Originally published at wallabytoken.com
The Vercel AI SDK is the fastest way to ship a serious AI feature in TypeScript. And Kimi K3, Moonshot's open-weight model with a 1M-token context window, is not in its model catalog. So we wrote the missing piece: wallaby-ai-provider, a thin package that puts Kimi K3 anywhere the AI SDK runs. Install is one command:
npm install wallaby-ai-provider ai Enter fullscreen mode Exit fullscreen mode export WALLABY_API_KEY = sk-your-wallaby-key Enter fullscreen mode Exit fullscreen mode import { generateText } from ' ai '; import { wallaby } from ' wallaby-ai-provider '; const { text } = await generateText ({ model: wallaby ( ' kimi-k3 ' ), prompt: ' Hello, world ' }); Enter fullscreen mode Exit fullscreen mode That is all of it: the kimi-k3 model (1,048,576-token context, 131,072 max output) as a first-class AI SDK provider. generateText, streamText, agents, structured output, all of it. Pay per token, no subscription. Disclosure: Wallaby Token sells API access to Kimi K3, and the endpoint this package points at is ours.
The hello-world script from above, run for real against the live gateway:
92 input tokens, 117 output tokens, one round-trip. Not a screenshot of our README — a real key, a real model, seconds ago. The usage object comes back on every call, so your own code can meter itself the same way.
Same model, streamText this time, asked what a 1M-token context buys a coding agent. The stream printed as it generated; the last line is the cost, computed at list rates from the usage object:
103 input tokens, 1,859 output tokens, $0.0254. The math: (103 × $2.70 + 1,859 × $13.50) ÷ 1,000,000. No estimate, no "starting at": that run, that bill.
import { streamText } from ' ai '; import { wallaby } from ' wallaby-ai-provider '; const result = streamText ({ model: wallaby ( ' kimi-k3 ' ), prompt: ' In three sentences: what does a 1M-token context window buy a coding agent? ', }); for await ( const delta of result. textStream ) process. stdout. write ( delta ); // wait for the stream to finish, then read token usage const usage = await result. usage; Enter fullscreen mode Exit fullscreen mode In a Next.js app Same provider, server side. Drop this in app/api/chat/route.ts:
import { streamText } from ' ai '; import { wallaby } from ' wallaby-ai-provider '; export async function POST ( req: Request ) { const { messages } = await req. json (); const result = streamText ({ model: wallaby ( ' kimi-k3 ' ), messages }); return result. toUIMessageStreamResponse (); } Enter fullscreen mode Exit fullscreen mode One difference from the terminal: put the key in.env.local as WALLABY_API_KEY=sk-..., not in a shell export. Next.js loads it into process.env on the server, and the provider picks it up from there. It never ships to the browser — the key only exists inside this route handler.
WALLABY_API_KEY is not set where the process can read it. In a terminal script, that means the export never ran or ran in another window. In Next.js, it means the key is missing from.env.local, or the dev server was started before you added it; restart next dev after editing env files.
The model ID is exactly kimi-k3. Not moonshotai/kimi-k3, not kimi-k3-turbo, not the display name. The provider passes the string through to the endpoint unchanged, and the endpoint only accepts the canonical ID.
Per 1M tokens, our rates as of October 2026 (current rates always on the pricing page ):
The $0.50 trial credit covers this entire guide about 20 times over.
You now have Kimi K3 as a first-class provider in the Vercel AI SDK: one npm package, two lines of code, streaming included, billing itemized per token in your own console.