BlogsVercelAI Gateway and AI SDK Integration

AI Gateway and AI SDK Integration

AI Gateway and AI SDK Integration

69
posts
2023–2026

Vercel's AI Gateway and AI SDK enable rapid iteration and deployment of AI-powered features. AI SDK 7 introduces production depth for agent work, including reasoning control, tool and runtime context, provider file and skill uploads, MCP Apps, and a terminal UI for development. For running agents, it adds tool approvals, durability with WorkflowAgent, timeouts, and sandbox support. It also supports integrating with various agent harnesses, provides enhanced observability through telemetry and tr. Agent Plugins 1.0.0 provides an open, vendor-neutral standard for packaging Agent Skills and MCP servers into distributable plugins, enabling compatibility across various AI agent clients.

2026

Introducing Agent Plugins

8/6/2026

Introduced Agent Plugins 1.0.0, an open, vendor-neutral standard for packaging Agent Skills and MCP servers into distributable plugins. The format includes a `plugin.json` manifest and a defined directory structure for skills and MCP configurations, allowing for a common package for portable components. Clients can discover and load these components independently. The specification includes a namespaced extension mechanism for client-specific data and files. The project is a multi-vendor effort with initial support from major AI players.

How Searchable ships customer-requested features in 30 minutes on Vercel | Customers | Vercel

7/21/2026

This post details how Searchable leverages Vercel's AI SDK and AI Gateway to achieve a 5x increase in development velocity, process over 100 billion tokens, and ship customer-requested features in as little as 30 minutes. It highlights the elimination of model SDK implementation and API key rotation by using AI Gateway, enabling faster testing of new models and improving overall development speed.

Open-weight models surge to 29% of volume, price per token flattens

7/13/2026

This post provides a monthly production index for Vercel's AI Gateway, detailing token volume, spend, and price per token trends. It highlights the increasing adoption of open-weight models (29% of volume), the flattening of average token prices, and the performance of specific models and modalities (e.g., DeepSeek, GLM 5.2, Anthropic, OpenAI, Google Nano Banana, xAI's Grok Imagine). It also discusses the strategic balancing of spend across different model types based on use cases.

Build realtime voice agents on AI Gateway

6/29/2026

This post introduces and details the integration of audio/voice capabilities into Vercel's AI Gateway and AI SDK. It covers the implementation of real-time voice agents, text-to-speech, and speech-to-text functionalities. Technical details include the use of the `useRealtime` hook in the browser for managing WebSocket connections, microphone capture, and audio playback, along with server-side token generation for authentication. It also explains the underlying mechanics of real-time sessions, including turn detection and tool integration. For text-to-speech, it demonstrates the `generateSpeech` function for creating audio files. For speech-to-text, it showcases the `transcribe` function for converting audio to text. The post highlights how these new audio modalities leverage existing AI Gateway features like provider routing, observability, and spend controls.

AI SDK 7 is now available

6/25/2026

AI SDK 7 introduces production depth for agent work with features like reasoning control, tool and runtime context, provider file and skill uploads, MCP Apps, and a terminal UI. It enhances agent execution with tool approvals, WorkflowAgent for durability, timeouts, and sandbox support. It also improves agent harness integration, observability via telemetry and tracing, and adds real-time voice and video support.

How Okara runs CMO agents for 120,000 companies on Vercel | Customers | Vercel

6/11/2026

Okara utilizes Vercel AI Gateway to integrate multiple AI model providers with a single API key, abstracting away individual provider SDKs, key management, and edge cases. This allows for immediate availability of new models upon shipping and centralizes retry logic, fallback handling, and provider health monitoring within Vercel's routing layer. The post also highlights the use of Vercel Sandboxes for running agent workflows, enabling automated detection, analysis, and code generation for fixes, with human review before deployment.

DeepSeek enters the fight for token volume, Anthropic continues to dominate spend

6/8/2026

This post details May 2026 AI Gateway production data, showing a 20% MoM growth in tokens and 43% MoM growth in spend. It highlights DeepSeek's rapid adoption, capturing 17% of token volume with minimal cost share, and Anthropic's continued dominance in spend (65%) and high-stakes use cases. The analysis points to increased cost-consciousness and smarter model routing strategies, with low-cost models entering production and frontier models driving increased overall spend.

Protecting against token theft

5/29/2026

Introduces Vercel BotID as a mechanism to protect AI endpoints from inference theft. Details the problem of inference theft, its architecture of abuse, and why traditional web defenses are insufficient. Explains that verification must run on every AI request, not just per session. Demonstrates implementation of request verification using BotID deep analysis within route handlers and client-side instrumentation. Highlights the cost asymmetry between inference and verification as a defense strategy.

AI Gateway production index

5/12/2026

This post provides a data-driven analysis of AI Gateway production workloads over seven months, detailing trends in AI model spend and token volume. It categorizes usage by AI provider (Anthropic, Google, OpenAI, xAI), use case (personal assistants, coding agents, etc.), and B2B/B2C classification. Key findings include Anthropic's lead in spend, Google's lead in volume, the rise of OSS models, and the increasing importance of agentic workloads. The post also illustrates how the perceived cost of errors influences per-token economics and provider choice.

How Superset built the IDE for AI agents on Vercel | Customers | Vercel

5/10/2026

This post details how Superset built an IDE for AI agents on Vercel, highlighting their use of Vercel's AI Gateway and AI SDK for orchestration and model routing. It emphasizes the need for parallel infrastructure to support parallel agents and how Vercel's platform, including Next.js projects, preview deployments, Vercel Blob, Fluid Compute with Active CPU pricing, Cron Jobs, and BotID, enables this. The post also touches on scaling through a Hacker News spike and the benefits of instant rollbacks.

How Zo Computer improved AI reliability 20x on Vercel | Customers | Vercel

4/17/2026

This post details how Zo Computer leveraged Vercel's AI SDK and AI Gateway to achieve a 20x reduction in their AI model retry rate (from 7.5% to 0.34%) and improve chat success rate to 99.93%. It highlights the replacement of custom adapter code with the AI SDK for unified model integration and the offloading of retry, fallback routing, and provider health monitoring to the AI Gateway. The post quantifies the reliability and latency improvements through A/B testing, showing a P99 latency reduction from 131s to 81s and demonstrating the ability to add new models in under a minute.

Zero Data Retention on AI Gateway

4/8/2026

Introduced team-wide Zero Data Retention (ZDR) for AI Gateway, enabling enforcement of data policies across an entire team without code changes. Added per-request ZDR for specific sensitive workflows and explicit controls to disallow prompt training. Enhanced audit trail with response metadata showing routing decisions and provider filtering based on ZDR policies. Provided code examples for implementing request-level ZDR and disallowing prompt training using the AI SDK.

Unified reporting for all AI Gateway usage

3/25/2026

Introduces the Custom Reporting API for AI Gateway, allowing programmatic access to cost, token usage, and request volume. Enables detailed breakdown of spend by model, provider, user ID, custom tag, or credential type. Supports tagging requests with 'user' and 'tags' for cost attribution. Provides an example of querying the API and the structure of the returned data.

SERHANT.'s playbook for rapid AI iteration | Customers | Vercel

3/23/2026

This post details how SERHANT. leverages Vercel's AI SDK and AI Gateway for rapid AI iteration and scaling. It highlights the use of the AI SDK for abstracting model provider complexity, enabling SERHANT. to orchestrate multiple LLMs (Claude Sonnet, Claude Haiku, OpenAI, Gemini) for different tasks to balance cost, speed, and complexity. The post also showcases how AI Gateway provides consolidated visibility into usage and cost, and how Vercel's Fluid compute enabled seamless scaling from an internal pilot to over 900 users without replatforming. It further discusses the evolution from linear workflows to conversational AI agents and the importance of flexibility in the rapidly changing AI landscape.

Build knowledge agents without embeddings

3/19/2026

Introduces a file-system-based approach for knowledge agents, leveraging Vercel Sandbox, bash commands (`grep`, `find`, `cat`), and AI SDK tools instead of traditional vector databases and embedding models. This method aims for deterministic, explainable, and faster results, with improved debugging by inspecting actual files. It also highlights the integration of Chat SDK for multi-platform deployment and the AI SDK's `savoir` tools for connecting agents to this file-system-based knowledge base. The post also details built-in admin tools and an AI-powered admin agent for debugging.

Chat SDK brings agents to your users

3/19/2026

Introduces the Chat SDK, a TypeScript library that enables developers to build bots that work across multiple messaging platforms (Slack, Microsoft Teams, Google Chat, Discord, Telegram, GitHub, and Linear) from a single codebase. It abstracts platform-specific integration logic and inconsistencies through adapters, allowing for a 'write once, deploy everywhere' approach. The SDK handles streaming, formatting, table rendering, cards, modals, and buttons, with pluggable state adapters for Redis and PostgreSQL. It also adds support for WhatsApp. The Chat SDK integrates directly with AI SDK text streams for piping LLM responses to chat platforms.

360 billion tokens, 3 million customers, 6 engineers | Customers | Vercel

3/18/2026

This post details how Durable, a customer of Vercel, migrated their entire stack to Vercel to manage multi-tenant AI workloads. They leveraged Vercel's AI Gateway, AI SDK, and Workflows to handle model orchestration, tenant isolation, and per-customer AI economics. The migration resulted in a 3-4x reduction in infrastructure costs compared to self-hosting and enabled them to ship new agents to customers in a single day. The post highlights the challenges of multi-tenant infrastructure and AI product development, and how Vercel's platform addressed these issues for Durable.

Gamma builds design-first agents with Vercel | Customers | Vercel

2/28/2026

This post details how Gamma evolved its complex agent architectures by building on the Vercel AI SDK, enabling finer control and persistence over conversation state, passing context between agents, managing message history across sessions, and orchestrating multi-step interactions. It also highlights Gamma's use of the AI SDK for image generation, allowing new models to be added with minimal code and benefiting from shared middleware for tracing, cost tracking, and preprocessing. The post further describes Gamma's integration of AI infographics, where per-model strategies are managed in feature code. Finally, it explains Gamma's use of Vercel Functions for its AI content pipeline, specifically for a translation layer that converts LLM HTML output into structured editor content and resolves async assets.

Skills Night: 69,000+ ways agents are getting smarter

2/20/2026

This post details the growth and evolution of the 'skills.sh' ecosystem, which acts as a package manager for agent context. It highlights the rapid increase in skills and CLI installs, the security challenges introduced by this growth, and the partnerships formed to address them (Gen, Socket, Snyk). Demos illustrate how skills are used to bridge training data gaps, enable agents to drive full application stacks, and are becoming a fundamental infrastructure component for distributing knowledge to AI agents.

Video Generation with AI Gateway

2/19/2026

Introduces video generation capabilities to the AI Gateway and AI SDK. Details integration with four new video models (xAI Grok Imagine, Alibaba Wan, Kling, Google Veo) and their respective generation types (text-to-video, image-to-video, first/last frame, reference-to-video, video editing). Provides code examples for programmatic video generation using AI SDK 6 and highlights the AI Gateway Playground for experimentation. Explains prompt structures for video generation, including motion cues and provider-specific options.

How Stably ships AI testing agents in hours, not weeks | Customers | Vercel

2/17/2026

This post details how Stably, a 6-person startup, leveraged Vercel's AI Gateway and Sandbox to build and deploy AI testing agents in hours instead of weeks. It highlights the reduction in infrastructure anxiety and the acceleration of product development and deployment cycles. The post emphasizes the use of AI Gateway for scalability and Sandbox for agentic code execution as key enablers for Stably's rapid iteration.

Use Perplexity Web Search with Vercel AI Gateway

1/14/2026

Introduces provider-agnostic web search functionality to Vercel AI Gateway using Perplexity, allowing any model to search the web in real-time. Demonstrates integration with the AI SDK via `gateway.tools.perplexitySearch()`. Highlights use cases for models without native search, developer tooling, CI assistants, provider-agnostic chatbots, and operational/market-aware agents. Mentions provider-specific tools from Anthropic, OpenAI, and Google as alternatives. Details pricing for Perplexity web search requests ($5 per 1,000 requests) and provides links to documentation.

How to build agents with filesystems and bash

1/9/2026

Introduces a new pattern for agent context management by leveraging filesystems and bash tools. This approach allows agents to use native LLM capabilities for exploring and retrieving information, reducing the need for custom retrieval pipelines and improving cost-efficiency and output quality. It highlights the use of `bash-tool` for sandboxed filesystem access and demonstrates the pattern with a sales call summarization agent.

2025

Building AI-Generated Pixel Trading Cards with Vercel AI Gateway

12/23/2025

This post details the technical implementation of an AI-powered photobooth and a v0 template for generating pixel trading cards. It describes the use of the `flux-kontext-lora` model with a custom LoRA for pixel art generation, BRIA's RMBG 2.0 for background removal, the Canvas API for compositing, and the sharp image library for gradient mapping. The v0 template leverages the Vercel AI Gateway and Fal integration, including a detailed prompt for GPT Image 1.5 Edit to enforce pixel art constraints and a method for loading style reference images. The post also outlines the physical production workflow for on-site cards.

AI SDK 6

12/22/2025

AI SDK 6 introduces the `Agent` abstraction for building reusable agents, including the `ToolLoopAgent` for handling tool execution loops. It adds `callOptionsSchema` and `prepareCall` for passing type-safe arguments to agents. The release also enhances tool capabilities with `needsApproval` for human-in-the-loop control, strict mode for input generation, input examples for better alignment, and `toModelOutput` for flexible tool outputs. The `Agent` interface is now more flexible, allowing custom implementations like `DurableAgent` from Workflow DevKit. New features include MCP support, tool calling with structured output, DevTools, reranking, standard JSON schema, image editing, raw finish reason & extended usage, LangChain adapter rewrite, and new provider tools.

Cline now runs on Vercel AI Gateway

12/16/2025

This post details Cline's integration with Vercel AI Gateway, highlighting the performance improvements achieved. It quantifies gains in P99 streaming latency (10-14%) and API error rates (43.8%) across various models like Grok Code Fast 1 and Minimax M2. The post also emphasizes the benefits of Vercel's global network for low-latency routing and the transparent pricing model of the AI Gateway.

Vercel collaborates with Google for Gemini 3 Pro Preview launch

11/18/2025

This post details the integration and performance evaluation of Gemini 3 Pro Preview through the Vercel AI Gateway and AI SDK. It provides performance metrics comparing Gemini 3 Pro Preview against other models on Next.js evals, highlighting its strengths in instruction following, response consistency, frontend generation, and multi-turn agent flows. It also includes code examples for using the AI SDK with Gemini 3 Pro Preview and directs users to the AI Gateway Playground and v0.app for testing.

How AI Gateway runs on Fluid compute

11/6/2025

This post details how Vercel's AI Gateway leverages Fluid compute and Active CPU Pricing for scalable and cost-efficient operation. It explains the architecture, including the use of Vercel's global delivery network for low-latency routing and in-region Redis for state management and caching. The post highlights Fluid's in-function concurrency model, which allows for server-like efficiency by reusing instances and persisting state across invocations, reducing network overhead and costs. It also describes the monitoring system that combines health checks with in-memory statistics from Fluid instances for self-correction and automatic adjustments.

Vercel Ship AI 2025 recap

10/27/2025

AI SDK 6 introduces an agent abstraction for reusable agents, tool execution approval with `needsApproval: true` for human-in-the-loop review, and end-to-end type safety. The Vercel Marketplace now features agents and AI services. The Workflow Development Kit (`use workflow`) provides durability, retries, persistence, and observability for long-running functions. Vercel Agent beta offers AI code reviews and automated anomaly investigations. Zero-configuration Python support with the Vercel Python SDK is now in beta. Open-source templates for a lead agent and a data analyst agent are released.

AI agents and services on the Vercel Marketplace

10/23/2025

Introduces the AI agents and services category to the Vercel Marketplace, enabling native Vercel integrations for AI-powered workflows with unified billing, observability, and installation. Lists initial AI agents (CodeRabbit, Corridor, Sourcery) and AI services (Autonoma, Braintrust, BrowserUse, Chatbase, Descope, Kernel, Kubiks, Mixedbread) available through the marketplace.

You can just ship agents

10/23/2025

This post introduces the Workflow Development Kit (WDK) as a new component of Vercel AI Cloud, enabling developers to express durability directly in TypeScript for long-running agents. It highlights how WDK allows workflows to persist progress at each step, resume after crashes or deploys, and provides traces for observability. The post also reiterates the roles of AI SDK for agent logic, AI Gateway for model routing, Fluid compute for elastic scaling, and Sandbox for isolated execution within the Vercel AI Cloud ecosystem.

Running Next.js in ChatGPT: How to Build ChatGPT Apps

10/15/2025

This post details the technical challenges and solutions for running a Next.js application within ChatGPT's nested iframe architecture. It addresses issues with asset loading by using `assetPrefix`, relative URL resolution by implementing a `<base>` HTML element, browser history leaks by patching `history.pushState` and `history.replaceState`, fetch request rewriting for client-side navigation by patching `window.fetch`, and CORS issues by implementing middleware to handle OPTIONS preflight requests and add CORS headers. It also covers patching parent frame modifications and ensuring external links navigate correctly.

Towards the AI Cloud: Our Series F

9/30/2025

This post announces a Series F funding round and positions Vercel as the 'AI Cloud'. It highlights the significant growth of the AI SDK, positioning it as a key component for building AI applications and agents. It also mentions the open-sourcing of a ChatGPT Enterprise-like template and a vibe coding platform with v0. The post emphasizes the continued importance of Next.js for AI product frontends and introduces Vercel Agent for AI-powered code reviews, which validates fixes in Vercel Sandboxes. The upcoming release of the v0 iOS app is also noted.

Collaborating with Anthropic on Claude Sonnet 4.5 to power intelligent coding agents

9/29/2025

Introduces Claude Sonnet 4.5 on Vercel AI Gateway and AI SDK, highlighting its improved performance in Next.js builds, linting, and v0 UI generation. Details the new Coding Agent Platform template, which leverages Vercel Sandbox, Fluid compute, and AI Gateway to enable autonomous coding agents that can plan, execute, and commit code changes within isolated environments. The platform uses Postgres for state persistence and is open-sourced.

Addressing security & quality issues with MCP tools - Vercel

9/17/2025

Introduced `mcp-to-ai-sdk`, a CLI tool that generates static AI SDK tool definitions from MCP servers. This addresses security risks (prompt injection, unexpected capability introduction), cost issues (unneeded context usage), and quality problems (low tool-call accuracy due to upstream drift and generic descriptions) associated with dynamic MCP tool definitions in production agents. The tool allows for local customization, version control, and selective loading of tools, enhancing security, performance, and reliability.

AI agents at scale: Rox’s Vercel-powered revenue operating system | Customers | Vercel

9/16/2025

This post details how Rox uses the Vercel AI SDK to build their chat-driven interface (Rox Command), enabling streaming responses from LLMs for conversational AI. It also highlights Rox's use of Vercel Serverless Functions to scale AI agent workflows by batching and streaming results, overcoming browser concurrency limitations and improving performance for real-time prospect analysis.

Introducing x402-mcp: Open protocol payments for MCP tools

9/12/2025

Introduced the x402 open protocol for programmatic payments in AI applications, enabling agents to autonomously discover and interact with paid external services via HTTP requests using the 402 Payment Required status code. Developed `x402-mcp` to integrate x402 payments with Model Context Protocol (MCP) servers and the Vercel AI SDK, including `paymentMiddleware` for API routes and `withPayment` wrappers for MCP clients. The protocol is payment-network agnostic, with current implementations using USDC on the Base blockchain. A starter template demonstrates x402 integration with Next.js, AI SDK, AI Elements, and AI Gateway.

The second wave of MCP: Building for LLMs, not developers

9/9/2025

This post introduces the concept of intention-based tools for LLMs, contrasting them with API-shaped tools. It emphasizes designing tools around complete user goals rather than exposing individual API operations, leading to improved reliability and efficiency for LLM-driven workflows. The MCP handler and Next.js MCP template are provided as resources for implementing these workflow-based tools.

AI Gateway: Production-ready reliability for your AI apps

8/21/2025

This post announces the general availability of Vercel AI Gateway, highlighting its role in providing production-ready reliability for AI applications. It emphasizes the flexibility to switch between models, manage API keys, rate limits, and provider accounts through a single API. The AI Gateway is built on AI SDK 5 and leverages Vercel's CDN for low latency. It offers zero markup by allowing users to bring their own keys and contracts.

How Coxwave delivers GenAI value faster with Vercel | Customers | Vercel

8/13/2025

This post details how Coxwave uses Vercel's platform, including Next.js and the AI SDK, to accelerate the development and deployment of GenAI products. It highlights improvements in deployment times (85% reduction), deploy frequency (from weekly to twice daily), and reduced recovery time (52% decrease with Instant Rollback). The use of Preview Deployments for testing and the AI SDK for building conversational interfaces like Exploration Copilot are emphasized as key enablers for rapid iteration and value delivery in the GenAI space.

Vercel collaborates with OpenAI for GPT-5 launch

8/7/2025

This post details the integration of GPT-5 models (main, mini, nano) into Vercel's AI Gateway and AI SDK. It showcases their application in v0.dev for UI generation and introduces the open-source Vibe Coding Platform. The platform utilizes AI Gateway for model access, AI SDK for prompt handling and streaming responses, Vercel Functions with Fluid compute for optimized backend processing, Vercel Sandbox for secure code execution, and Vercel BotID for bot detection and mitigation. The post highlights the benefits of GPT-5 for agent-based workflows, long-context reasoning, and parallel tool handling, as well as its performance in code quality and frontend sensibilities. It also details the technical implementation of the Vibe Coding Platform, including Next.js frontend, backend API calls, and real-time updates streamed from the sandbox.

AI SDK 5

7/31/2025

AI SDK 5 introduces a redesigned chat with separate UI and model messages, enabling easier persistence. It adds customizable UI messages via generics for full-stack type safety. 'Data parts' allow streaming type-safe, arbitrary data from server to client, with support for transient parts. Tool invocations are now type-safe with specific part identifiers for tools, automatic input streaming, and explicit error states. Message metadata can be attached to messages for additional context. Experimental speech generation and transcription are also introduced, along with V2 specifications for AI models, a global provider, and access to raw responses. Zod 4 support is also included.

Model Context Protocol (MCP) explained: An FAQ

7/25/2025

Introduces the Model Context Protocol (MCP) as a new specification for standardizing how LLMs access data and systems, enabling safe and predictable interactions by exposing data sources, tools, and context to models and agents. MCP servers act as universal connectors between AI and applications, allowing developers to create integrations once and use them everywhere. The AI SDK and mcp-handler provide abstractions for easily creating MCP servers, supporting various transports like StreamableHTTP and stdio. MCP servers are distinct from AI agents, with the agent planning actions and the MCP server defining what actions are possible. Use cases include e-commerce, finance, and marketing, enabling models to interact with real systems safely and predictably.

Grep a million GitHub repositories via MCP

7/17/2025

This post introduces Grep's support for the Model Context Protocol (MCP), enabling AI applications to query a million public GitHub repositories via a standard HTTP interface. It details how Grep's MCP server allows AI agents to search for code snippets, filtered by language, repository, and file path, with results typically returning in under a second. Configuration examples for AI clients like Cursor and Claude Code are provided, along with a practical example of an AI agent using Grep's MCP server to find code related to error handling in MCP tools. The post also highlights the ease of building an MCP server using Vercel's `mcp-handler` package.

The AI Cloud: A unified platform for AI workloads

7/10/2025

This post introduces the AI Cloud, a unified platform for AI workloads, building upon existing Vercel infrastructure. It highlights the integration of AI SDK and AI Gateway for model interaction and management, Fluid compute with Active CPU pricing for cost-efficient AI execution, tool support, MCP servers, and Vercel Queues for background tasks. It emphasizes the framework-defined infrastructure principle applied to AI applications and details how these components work together to enable developers and agents to build AI features without managing low-level infrastructure.

Building efficient MCP servers

6/12/2025

This post details the evolution of the Model Context Protocol (MCP) specification, introducing Streamable HTTP as a more efficient transport protocol to replace Server-Sent Events (SSE). It explains how the Vercel MCP adapter supports both Streamable HTTP and SSE, and how the `mcp-remote` package can be used to proxy Streamable HTTP over stdio for backward compatibility. It highlights a case study where migrating to Streamable HTTP reduced CPU consumption by over 50%.

The no-nonsense approach to AI agent development

6/4/2025

This post outlines a practical, step-by-step methodology for developing AI agents, focusing on a 'no-nonsense' approach. It advocates for starting with manual simulation of the agent's task to identify repetitive steps, followed by automating the core loop using a combination of plain code for deterministic operations and LLMs for tasks requiring judgment. The post emphasizes refining prompts, making tool calls precise, and replacing model calls with deterministic functions where possible to optimize for reliability. It also introduces the concept of using a second model to critique the output of the first for further refinement. The core message is that building effective AI agents leverages fundamental software engineering principles.

Introducing the AI Gateway

5/20/2025

Introduces the Vercel AI Gateway for alpha testing, built on AI SDK 5 alpha. The Gateway abstracts away API keys, rate limits, and provider accounts, handling authentication and usage tracking. It enables load balancing across providers, failover, and cost optimization. The post highlights integration with AI SDK features and outlines future plans including billing, BYOK, and unified observability.

Introducing Chatbot Template

4/9/2025

Introduces the Chatbot template, a production-ready application built on Next.js App Router and the AI SDK, designed for building conversational AI applications. Highlights features like message persistence, authentication, multimodal support, shareable chats, generative UI, customizable artifacts, and in-browser code execution (WASM/Pyodide).

AI SDK 4.2

3/21/2025

AI SDK 4.2 introduces support for reasoning models with dedicated `reasoning` tokens and a `extractReasoningMiddleware`. It adds Model Context Protocol (MCP) client support for integrating external tools via stdio or SSE. The `useChat` hook now supports `message.parts` to handle diverse LLM outputs like text, sources, reasoning, tool invocations, and files. Image generation is supported via the `file` message part for models like Gemini 2.0 Flash. URL sources are standardized for models supporting grounding. Day-one support for OpenAI's Responses API is included, allowing easy migration from Completions API and enabling web search tools. Svelte 5 and middleware updates are also included.

xAI and Vercel partner to bring zero-friction AI to developers

3/20/2025

This post announces the integration of xAI's Grok models into the Vercel Marketplace, AI SDK, and v0. It highlights the availability of a free tier for xAI models through Vercel for prototyping, simplified authentication via environment variables, and integrated billing. The Next.js AI Chatbot template is updated to use xAI models, and the AI SDK now supports xAI as a default provider with example code for integration. Future integration with v0 is also mentioned.

Using the AI SDK to build Sitecore Stream's AI-powered brand aware assistant | Customers | Vercel

3/3/2025

This post details how Sitecore utilized the Vercel AI SDK to build an AI-powered brand assistant. It highlights the SDK's strengths in integrating AI with frontend user experience, specifically mentioning the `useChat` hook and object generation capabilities for building interactive UIs. The post emphasizes real-time streaming for fast responses and the SDK's role in managing data streaming between Azure-hosted backends and Next.js frontends. It also touches upon the future vision of modular and scalable AI experiences.

AI SDK 4.1

1/20/2025

Introduced image generation via `experimental_generateImage` function supporting multiple providers (Replicate, OpenAI, Google Vertex AI, Fireworks). Added `smoothStream` for transforming and smoothing stream output, and `createDataStreamResponse` for non-blocking data streaming. Enhanced `useChat` for simplified persistence. Improved tool calling context with `toolCallId`, `messages`, and `abortSignal`. Added new and updated providers.

2024

AI SDK 4.0

11/18/2024

AI SDK 4.0 introduces PDF support for Anthropic and Google Generative AI providers, enabling document analysis. It adds computer use support with Anthropic's Claude 3.5 Sonnet, allowing interaction with system tools like mouse, keyboard, and screenshots. Continuation support is added for generating long text beyond model limits using `experimental_continueSteps`. A new xAI Grok provider is introduced. Provider updates include v2 support and tool calling for Cohere, predicted output and prompt caching for OpenAI, file inputs and embedding models for Google Generative AI, Vertex AI, and Amazon Bedrock, and support for Groq.

How Chatbase scaled rapidly with Vercel's developer experience and AI SDK | Customers | Vercel

10/9/2024

This post details how Chatbase utilized Vercel's AI SDK to build their AI playground, specifically highlighting the implementation of LLM Compare Mode. It also mentions the use of Vercel Firewall for security and Skew Protection for development workflows.

Leveraging Vercel and the AI SDK to deliver a seamless, AI-powered experience as a solo founder | Customers | Vercel

10/9/2024

This post details how ChatPRD, a solo-founder project, leveraged the Vercel AI SDK to implement streaming responses and generative UI components, significantly improving user experience and accelerating time to market. It emphasizes the SDK's role in abstracting the complexity of AI model integration, latency management, and streaming, allowing the founder to focus on core product development. The success of ChatPRD with 20,000 users in nine months is presented as a testament to the effectiveness of this approach.

AI SDK 3.4

9/20/2024

AI SDK 3.4 introduces language model middleware for intercepting and modifying LLM calls (e.g., for RAG, logging, caching, guardrails), a data stream protocol to use AI SDK UI with any backend, structured output modes (object, array, enum) for better control over LLM responses, multi-step calls for automatic tool use, improved tracing for telemetry, mock models for testing, and provider updates.

Using the AI SDK to fix edge-case errors in our code

8/15/2024

This post details the specific application of the Vercel AI SDK to solve an encoding issue with internationalized domain names (IDNs). The problem involved correctly identifying the language code required for Punycode domains when interacting with the OpenSRS registrar. The solution involved using the `generateText` method of the AI SDK with OpenAI's GPT-4o model to accurately determine the language code, which was previously not reliably detected by shorter text analysis methods. This resulted in a 100% success rate for previously failing domain purchases.

How to build scalable AI applications

8/12/2024

This post details best practices for building scalable AI applications, focusing on choosing and implementing AI models, managing data, and developing future-proof infrastructure. It highlights the Vercel AI SDK's flexibility in working with multiple AI providers (OpenAI, Anthropic, Google) and its support for generative UI and multi-modal AI. The post also discusses data cleansing, management, and advanced RAG techniques (multi-modal, dynamic, personalized, explainable RAG). For infrastructure, it emphasizes latency, caching, streaming, scalability, and developer experience, positioning Vercel's Edge Network and streaming serverless functions as solutions for AI workloads.

How to integrate AI into your business

8/6/2024

This post introduces a strategic guide and framework (VIA-AI) for businesses to identify, evaluate, and integrate AI use cases. It details key performance indicators (KPIs) for AI initiatives, outlines team roles and responsibilities for AI development, and emphasizes how Vercel's platform and AI SDK can lower barriers to AI development through rapid prototyping, iteration, and easy integration with AI providers. It also mentions the use of Vercel's observability suite for tracking performance and preview deployments for stakeholder feedback.

Vercel AI SDK 3.3

8/6/2024

This post introduces experimental tracing with OpenTelemetry for the Vercel AI SDK, enabling detailed observability of AI function calls. It also adds experimental support for multi-modal file attachments in the `useChat` hook and introduces the `useObject` hook for streaming structured object generation to the client. Additional LLM settings and new model providers (AWS Bedrock, Chrome AI) are also included.

Introducing Vercel AI SDK 3.2

6/18/2024

AI SDK 3.2 introduces support for multi-step agentic workflows by extending `generateText` and `streamText` to handle tool calls for sequential tasks. It adds new providers (Azure OpenAI, Google Vertex, Cohere, Ollama) and expands image input capabilities for Anthropic and Google models. Embeddings generation is now supported for OpenAI, Mistral, Azure OpenAI, and Ollama providers, along with a `cosineSimilarity` helper function. DX improvements include an `onFinish` callback for observability and token usage tracking, and the ability to access the final typed object from `streamObject` as a promise. Client-side tool execution is enabled via `useChat` and `streamText` in React, with `onToolCall` and `addToolResult` for handling tool invocations and user interactions.

7 AI features you can add to your app today

5/9/2024

This post introduces seven AI features that can be added to applications today: semantic search, natural chatbots, nuanced personalization, instant localization, automatic content generation, developer efficiency tools (like v0), and private data analysis. It highlights how LLMs simplify AI integration due to pre-trained mastery, adaptability, creative output, and understanding beyond keywords. The post emphasizes Vercel's role in speeding up this process with its native AI support, managed scaling, streaming, and caching infrastructure, enabling developers to build AI features by connecting to external AI providers or leveraging Vercel's platform. It also mentions specific templates and tools like Morphic AI Answer Engine, Next.js AI Chatbot, and OpenAI GPT Slackbot for quick deployment.

Vercel AI SDK 3.1: ModelFusion joins the team

5/2/2024

AI SDK 3.1 introduces AI SDK Core, a unified API for LLM interactions supporting text generation, structured object generation (with Zod schema validation), and tool calls. It defines a Language Model Specification for provider integrations and includes new functions like `generateText`, `generateObject`, and `streamUI`. AI SDK UI offers framework-agnostic hooks (`useChat`, `useCompletion`, `useAssistant`) for building chat interfaces. AI SDK RSC's `streamUI` function enables generative UI with React Server Components, allowing LLMs to render custom components and use tools.

Composable AI for ecommerce: Hands-on with Vercel’s AI SDK

4/9/2024

This post details the practical application of Vercel's AI SDK within a Next.js application for building an AI-powered review summarizer. It demonstrates how to use Server Components with the AI SDK to interact with LLMs, including prompt engineering and model selection via Vercel's AI Playground. The post also shows how to integrate Next.js caching for prompt responses and mentions the use of v0 for UI prototyping. It further explores potential AI features for e-commerce, such as enhanced search and customer support.

Introducing AI SDK 3.0 with Generative UI support

3/1/2024

Introduced AI SDK 3.0 with Generative UI support, enabling LLMs to stream React Server Components (RSC) for richer user experiences. This leverages RSC and React Server Actions, requiring frameworks like Next.js App Router. The `render` method is introduced to map LLM tool/function calls to RSC, supporting OpenAI-compatible Function Calling. Examples demonstrate streaming plain text and integrating with weather APIs via tools. The post also highlights integration possibilities with LangChain and LlamaIndex using `createStreamableUI` and `createStreamableValue`.

Introducing AI Integrations on Vercel

2/8/2024

This post announces the launch of nine new AI integrations from industry-leading providers and a new model playground. It highlights the Vercel AI SDK's ability to connect to these providers and use models for text, image, and audio generation, providing a code example for streaming responses with the Perplexity API using Next.js. It also mentions the expansion of AI capabilities to include chatbots, recommendation systems with semantic search, and Retrieval Augmented Generation (RAG).

2023

Introducing the Vercel AI SDK: npm i ai

6/15/2023

Introduced the Vercel AI SDK, an open-source library for building conversational, streaming, and chat UIs in JavaScript and TypeScript. The SDK supports React/Next.js and Svelte/SvelteKit, with built-in LLM adapters for OpenAI, LangChain, and Hugging Face. It provides streaming-first UI helpers (`useChat`, `useCompletion`) and stream helpers with callbacks for database persistence. The SDK is designed to work with Vercel Functions and Fluid compute.

Deploy AI-driven apps on Vercel

1/25/2023

This post introduces Vercel's capabilities for deploying AI-driven applications, focusing on tooling, templates, and infrastructure. It highlights the integration with OpenAI models (ChatGPT, GPT-3, Whisper, DALL·E 2) and third-party services like Replicate. The post recommends Next.js and SvelteKit for building AI stacks, emphasizing their API routes, code splitting, TypeScript integration, and Hot Module Replacement. It also points to Vercel Functions with Fluid compute and streaming responses for handling AI workloads and showcases various one-click deploy AI templates. Collaboration features like comments on Preview Deployments are also mentioned.