# Vercel AI SDK
URL: /integrations/ai-sdk

---
title: Vercel AI SDK
sidebarTitle: Vercel AI SDK
description: Build typed browser agents with streaming across any model provider, in TypeScript.
llm: true
---

The Vercel AI SDK is a TypeScript toolkit for building AI applications with typed tools, streaming, and a unified provider model. The Steel integration runs each tool against a Steel cloud session (open, navigate, snapshot, extract, return typed results), so you can stand up a typed browser agent in a few hundred lines.

Pair the agent with a Next.js chat UI and embed Steel's Live View iframe alongside the chat to watch the browser as the agent runs.

### Requirements

*   **Steel API Key**: Active Steel subscription
*   **Node.js**: v20+
*   **Packages**: `ai`, a provider package (e.g., `@ai-sdk/anthropic`), `steel-sdk`, `playwright`, `zod`
*   **Model provider key**: Anthropic, OpenAI, or any AI SDK-supported provider

### Connect Steel to the Vercel AI SDK

Open a Steel session inside a typed AI SDK `tool()`:

```typescript Typescript -wc
import { tool } from "ai";
import { chromium } from "playwright";
import Steel from "steel-sdk";
import { z } from "zod";

const steel = new Steel({ steelAPIKey: process.env.STEEL_API_KEY! });

const openSession = tool({
  description: "Open a Steel cloud browser session.",
  inputSchema: z.object({}),
  execute: async () => {
    const session = await steel.sessions.create({});
    const browser = await chromium.connectOverCDP(
      `${session.websocketUrl}&apiKey=${process.env.STEEL_API_KEY}`,
    );
    return { sessionId: session.id, liveViewUrl: session.sessionViewerUrl };
  },
});
```

Full runnable starters:

*   Server-only typed agent: [Steel + Vercel AI SDK recipe →](/cookbook/vercel-ai-sdk)
*   Next.js chat UI with embedded Steel Live View: [Steel + Vercel AI SDK + Next.js recipe →](/cookbook/vercel-ai-sdk-nextjs)

### FAQ

### Do I need to change my existing Vercel AI SDK code to use Steel?

No — Steel slots in as a typed `tool()` from the `ai` package. The tool's `execute` opens a Steel session and connects Playwright over CDP; your streaming, provider setup, and the rest of the agent stay the same.

### How do I connect the Vercel AI SDK to a Steel browser session?

Inside a `tool()`'s `execute`, call `steel.sessions.create()` and connect with `chromium.connectOverCDP()` using the session's `websocketUrl` plus your `apiKey`. Subsequent tools (navigate, snapshot, extract) drive that browser and return typed results.

### Does the Vercel AI SDK work with Steel's proxies, stealth mode, and CAPTCHA solving?

Yes — pass them to `sessions.create()` (e.g. `useProxy`, `solveCaptcha`, `stealthConfig`). They're session-creation options and don't touch the AI SDK's tool or streaming layers.

### Can users watch the browser while the agent runs in a chat UI?

Yes — the tool returns `liveViewUrl` (`session.sessionViewerUrl`), and the Next.js recipe embeds Steel's Live View iframe alongside the chat so users watch the browser as the agent works.

### Which model providers can I use?

Any AI SDK-supported provider — install a provider package like `@ai-sdk/anthropic` and bring an Anthropic, OpenAI, or other provider key. Steel only needs the CDP connection, so the model choice is independent. For current model recommendations, see the [Steel leaderboard](https://leaderboard.steel.dev/).


### Resources

*   [Vercel AI SDK documentation](https://ai-sdk.dev/) – Tools, agents, streaming, and providers
*   [Steel Sessions API reference](/api-reference) – Programmatic session control for Steel browsers
*   [Steel Discord](https://discord.gg/steel-dev) – Get help and share what you build
