Vercel AI SDK vs Claude Agent SDK is less "which is better" and more "which job are you hiring for." Pick the Vercel AI SDK when you are shipping a TypeScript web or Node app that needs streaming chat UI, tools you define yourself, and the freedom to switch model providers. Pick the Claude Agent SDK when you want Claude Code's agent loop (files, shell, permissions, sessions, skills, MCP) as a library inside your own process, and you are fine staying on Claude. They can also work together: AI SDK 7's experimental HarnessAgent can drive Claude Code through @ai-sdk/harness-claude-code while your UI still uses useChat.

We checked the Agent SDK overview, the AI SDK agents overview, the AI SDK 7 announcement and the AI SDK harnesses docs on November 5, 2026, and ran the small tests listed in the front matter.

Vercel AI SDK vs Claude Agent SDK at a glance

ItemVercel AI SDKClaude Agent SDK
Made byVercelAnthropic
Packageai (npm)@anthropic-ai/claude-agent-sdk (npm), claude-agent-sdk (PyPI)
Latest we checkedai 7.0.163 (November 5, 2026)TypeScript 0.3.318; Python 0.2.178
LanguagesTypeScript and JavaScript onlyTypeScript and Python
ModelsMany providers (OpenAI, Anthropic, Google, xAI and others)Claude only (API key, plus Bedrock, Vertex and Foundry paths Anthropic documents)
Core agent APIToolLoopAgent (custom model and tools loop)query() (runs the Claude Code loop)
Built in coding toolsNone by default; you write toolsRead, Edit, Write, Bash, Glob, Grep, web tools and more
UI streamingFirst class (useChat and related hooks)You build or wire your own UI
MCPcreateMCPClient in @ai-sdk/mcpFirst class mcpServers in options
LicenseApache 2.0Anthropic Commercial Terms of Service (per Agent SDK docs)
Best fitProduct chat, copilots and custom agents in a TS appUnattended coding and OS level agents on Claude

What each SDK actually is

The Vercel AI SDK is a general purpose TypeScript toolkit. AI SDK Core covers generateText, streamText, structured output and ToolLoopAgent. AI SDK UI covers hooks that stream tokens and tool calls into React, Vue, Svelte and Angular. AI SDK Harnesses (experimental in AI SDK 7) wraps established coding runtimes such as Claude Code, Codex and Pi behind HarnessAgent. You do not have to host on Vercel. Our Vercel AI SDK guide walks through a tested ToolLoopAgent with approvals and MCP.

The Claude Agent SDK is different in kind. Anthropic's docs describe it as Claude Code as a library: the same agent loop, built in tools, hooks, subagents, permissions, sessions, skills and MCP that power the Claude Code CLI, callable from Python or TypeScript. You are not implementing the tool loop yourself. You call query(), stream messages, and Claude decides which tools to run under the permission mode you set. It sits beside the Messages API (you write the loop) and Claude Managed Agents (Anthropic hosts the loop and sandbox). That is the same "harness" idea we cover in what an agent harness is.

What we tested

On the AI SDK side we installed ai 7.0.163 and ran a ToolLoopAgent with MockLanguageModelV4 from ai/test. The scripted model first requested order_status for order A17, then answered from the tool result. The agent returned Order A17 shipped Nov 3 in two steps. That confirms the loop, tool execution and stop behavior without an API key. The package declares Node 22 or newer; our box ran Node 20.19.2 and the mock still completed.

import { ToolLoopAgent, tool, isStepCount } from 'ai';
import { MockLanguageModelV4 } from 'ai/test';
import { z } from 'zod';

const agent = new ToolLoopAgent({
  model, // MockLanguageModelV4 that tool-calls then answers
  instructions: 'Answer with the order_status tool.',
  tools: {
    order_status: tool({
      description: 'Get shipping status of an order',
      inputSchema: z.object({ order_id: z.string() }),
      execute: async ({ order_id }) => ({ order_id, status: 'shipped Nov 3' }),
    }),
  },
  stopWhen: isStepCount(5),
});

const result = await agent.generate({ prompt: 'Where is order A17?' });
// result.text === 'Order A17 shipped Nov 3', result.steps.length === 2

On the Claude Agent SDK side we installed @anthropic-ai/claude-agent-sdk 0.3.318. The install pulled the matching @anthropic-ai/claude-agent-sdk-linux-x64 optional binary (same 0.3.318 patch). Calling query({ prompt: 'Say hi in one word', options: { maxTurns: 1, ... } }) without credentials streamed a system init message (cwd, session id, tools list), an assistant message and a result message, then failed with Not logged in · Please run /login. That is enough to confirm the package loads the bundled Claude Code binary and starts a session; it is not a successful agent run. We also installed Python claude-agent-sdk 0.2.178 and imported query and ClaudeAgentOptions (fields include allowed_tools, permission_mode, mcp_servers, max_turns, max_budget_usd and cwd).

What this does not show: model quality, token cost, HarnessAgent against a live Claude Code session, or Managed Agents.

Models and languages

This is the first hard split. The Vercel AI SDK is provider agnostic. You pass a model from @ai-sdk/openai, @ai-sdk/anthropic, @ai-sdk/google, @ai-sdk/fireworks and many others, or through Vercel's optional AI Gateway. Switching providers is usually a one line change. The Claude Agent SDK talks to Claude. Anthropic's docs also cover provider routed Claude access (Bedrock, Vertex, Foundry), but you are still on Claude models, not GPT or Gemini.

Language split is almost as sharp. The Vercel AI SDK is TypeScript and JavaScript only. The Claude Agent SDK ships first class Python and TypeScript packages. If your agent logic lives in Python, Claude Agent SDK (or LangGraph, LlamaIndex, CrewAI and friends) is the realistic path; the AI SDK will not run there. If your team is a Next.js shop, the AI SDK is the shorter path to a streaming UI.

Built in tools vs tools you write

ToolLoopAgent starts empty of tools. You define each tool with tool(), a Zod schema and an execute function. That is flexible for product features (CRM lookups, billing APIs, internal search), and it forces you to decide every capability. Human approval is explicit through toolApproval or a tool's needsApproval.

The Claude Agent SDK starts with Claude Code's toolset. Read, Edit, Bash, Glob, Grep and web tools are already there. You narrow them with allowedTools / disallowedTools and a permissionMode such as default, acceptEdits, plan, dontAsk, auto or bypassPermissions (the last needs allowDangerouslySkipPermissions). Hooks (PreToolUse, PostToolUse and others), subagents and skills loaded from .claude/ give you the same extension points as the interactive CLI. For coding agents that must touch a real repo, that default toolbox is the point of the product. For a SaaS chat feature that must never see a shell, writing a short allowlist of tools in the AI SDK is usually safer and clearer.

Both support MCP. The AI SDK connects through @ai-sdk/mcp. The Agent SDK takes mcpServers in options and can host in process servers with createSdkMcpServer().

UI, streaming and product shape

If the user facing surface is a chat panel in a web app, the Vercel AI SDK wins on day one. useChat and the UI message stream protocol are built for that. ToolLoopAgent.stream() and HarnessAgent.stream() both produce AI SDK compatible results, so the same React components can render a custom tool loop or a harness session.

The Claude Agent SDK streams typed messages (system, assistant, result and others) for you to render. That is fine for CLIs, worker services and custom UIs, but there is no first party React hook. Teams that want Claude Code's loop behind a polished chat UI often put the Agent SDK (or Claude Code via HarnessAgent) on the server and keep AI SDK UI on the client.

Cost, license and operations

The ai package is Apache 2.0 and free. You pay model providers (or AI Gateway at list price with no token markup, per Vercel's docs). Long loops need your own stop conditions, timeouts and host limits.

The Claude Agent SDK is governed by Anthropic's Commercial Terms of Service, as the Agent SDK docs state. You pay Claude API usage. Options such as maxBudgetUsd and maxTurns help cap spend. Anthropic also asks third party products not to offer claude.ai login or consumer rate limits through the SDK; use API key auth. Branding rules forbid calling your product "Claude Code."

Operationally, the Agent SDK bundles a native Claude Code binary per platform as an optional dependency. Our Linux install pulled claude-agent-sdk-linux-x64 at the same 0.3.318 patch. The AI SDK is a normal npm library with no native binary.

When they work together

AI SDK 7 added HarnessAgent so you can drive Claude Code, Codex, Pi and other runtimes through one API and still stream into AI SDK UI. The Claude Code adapter lives in @ai-sdk/harness-claude-code. Harness packages are marked experimental and can break between releases. In that setup you are not picking one SDK over the other: the AI SDK owns the app surface, and Claude Code (the same engine the Agent SDK exposes) owns the coding loop. See what an agent harness is for why that split matters.

If you only need Claude models inside a custom tool loop, you can also keep ToolLoopAgent and pass an Anthropic model provider. That uses Claude as a model, not as Claude Code. You do not get Read/Bash/skills unless you rebuild them.

When to choose which

Choose the Vercel AI SDK when:

  • You are building a TypeScript or JavaScript product with a streaming chat UI.
  • You need more than one model vendor, or you want to switch vendors later.
  • Tools are product specific APIs you own, not a full coding workstation.
  • You already compared Mastra and LangGraph.js in our best TypeScript agent frameworks roundup and want the lighter library.

Choose the Claude Agent SDK when:

  • The agent must edit files, run commands and use Claude Code's permission and session model.
  • You want Python or TypeScript access to that same loop.
  • You are standardizing on Claude and accept Anthropic's commercial terms.
  • Managed Agents is too hosted, and a DIY loop on the Messages API is too much work (see Claude Managed Agents).

Choose both (AI SDK UI plus HarnessAgent or Agent SDK on the server) when you want a product chat surface and Claude Code's coding runtime underneath.

For graph style workflows with checkpoints, look at LangGraph rather than either SDK alone. For role based Python crews, CrewAI is a different shape again. For index and retrieve heavy apps, LlamaIndex may fit better than a coding harness.

FAQ

Is the Vercel AI SDK the same as the Claude Agent SDK?

No. The Vercel AI SDK is a provider agnostic TypeScript toolkit for model calls, custom tools and streaming UI. The Claude Agent SDK is Anthropic's library that runs the Claude Code agent loop with built in coding tools. Overlap exists only when you use Claude as a model in the AI SDK, or when HarnessAgent wraps Claude Code.

Can I use the Claude Agent SDK with OpenAI models?

Not as a first class path. The Agent SDK is built around Claude. For multi provider agents, use the Vercel AI SDK, LangGraph, LlamaIndex or another framework, and keep the Agent SDK for Claude Code style work.

Does the Vercel AI SDK replace Claude Code?

No. ToolLoopAgent is a custom loop you equip with tools. Claude Code (and the Agent SDK) is a full coding harness. AI SDK 7 can drive Claude Code through experimental HarnessAgent, which is integration, not replacement.

Which is better for a Next.js chatbot?

The Vercel AI SDK, in almost every case. You get useChat, provider choice and ToolLoopAgent in one stack. Reach for the Claude Agent SDK only if that chatbot must act like Claude Code on a filesystem.

Is the Claude Agent SDK free?

The libraries are installable from npm and PyPI, but use is under Anthropic's Commercial Terms, and every real run burns Claude API credits. There is no separate "Agent SDK subscription"; you pay model usage, and you can set maxBudgetUsd to stop a runaway session.

Can I use both SDKs in one app?

Yes. A common pattern is AI SDK UI in the browser, and either ToolLoopAgent, HarnessAgent (Claude Code adapter) or the Claude Agent SDK on the server. Keep clear which process is allowed to run shell and file tools.