You can now access Kimi K2 0905, a new model from Moonshot AI focused on agentic coding with a 256K context window, using Vercel AI Gateway with no other provider accounts required.
AI Gateway lets you call the model with a consistent unified API and just a single string update, track usage and cost, and configure performance optimizations, retries, and failover for higher than provider-average uptime.
To use it with the AI SDK v5, start by installing the package:
pnpm i aiThen set the model to moonshotai/kimi-k2-0905:
import { streamText } from 'ai'const result = streamText({ model: 'moonshotai/kimi-k2-0905', prompt: 'How is a trillion parameter oss model possible?'})Includes built-in observability, Bring Your Own Key support, and intelligent provider routing with automatic retries.
To deliver high performance to Kimi K2, AI Gateway leverages multiple model providers under the hood, including direct to Moonshot AI, Groq, and Fireworks AI.
Learn more about AI Gateway.
Reference Architecture
Choose a stack and work through the decisions behind it, with curated documentation, guides, templates, and courses to help you build.
- Agent stack: Build and operate agents with models, tools, and durable workflows.
- Web applications: Choose rendering, data, authentication, and caching approaches.
- Backends: Choose a runtime, connect services, and run background work.
Build with prompts
Build an app, extend an agent, or improve your project with ready-to-use prompts for your coding agent.