AI agents built on Vercel's agent stack

Global · UAE · India

Locked to one model provider? When the AI SDK pays off, and what version 7 asks of you

By Shivanath DevinarayananPublished 9 min read
Written forCTO, CXO, or VP or director of engineering who owns the agent stack and the model bill“Which model should run which step, and what does each step cost?”

The short answer

When does the Vercel AI SDK pay off for an agent, and when should a team call one model provider's SDK directly?

It pays off when you expect to change models, stream chat into a TypeScript front end, or want tool approvals in the same call. Skip it for one provider you will never leave, or wait if your backend is Python, where its SDK is beta. Version 7 needs Node.js 22 and ESM. At Mindcat, we decide per step.

A glowing laptop with abstract code and one gold line, two model cartridges beside it, one slid out to swap

Takeaways

  1. 01The AI SDK is a free Apache-2.0 library, not a hosted service. Your model bill and data path follow where you run it.
  2. 02Pay for the abstraction where a model swap is likely. A step that will stay on one provider can call that provider directly.
  3. 03Version 7 needs Node.js 22 and ESM imports. CommonJS require() is not supported, so check old services first.
  4. 04Tool approvals, WorkflowAgent and OpenTelemetry arrived in version 7. Realtime voice and video generation are still experimental.

If your agent is wired to one model provider and someone has asked what it would take to try another, this is for you. The short answer: the Vercel AI SDK makes the swap cheap for the steps you write in TypeScript, and it costs you a Node.js 22 and ESM upgrade to adopt version 7. It is not for a team that will stay on one provider for good: call that provider's own SDK.

What does the AI SDK solve, and what is it not?

Each model provider ships its own request shape, its own streaming format and its own way to declare tools. Wire a product to one of them and every later switch means rewriting the stream handling, the tool loop and the parsing. The AI SDK puts one TypeScript API in front of many providers. Vercel's product page says "Switch providers with one line of code". That is true of the code and, as the next section shows, not of the work.

The docs describe three parts. AI SDK Core generates text and structured objects, calls tools and runs agents. AI SDK UI is a set of hooks that stream chat into React, Vue or Svelte. AI SDK Harnesses run established agent harnesses such as Claude Code and Codex through one HarnessAgent interface.

What it is not matters as much. It is a library, ai on npm, open source under Apache-2.0, at version 7.0.142 on 16 October 2026. It is not a hosted service, so there is no SLA and no price. Your model bill comes from the provider or from AI Gateway, and your data goes wherever you run the code and whichever model endpoint you call.

We set the AI SDK up inside an agent build, with the approval and the logs around it: see the AI SDK page.

When does it pay off, and when should you skip it?

It pays off where a model swap is likely, and it is overhead where it is not. Our rule is per step, not per vendor: an agent has steps that sort, steps that write and steps that act, and each one can sit on a different model.

Your situationWhat we would do
You expect to test or change models on a step in the next yearUse the AI SDK on that step
You stream chat into a React, Vue or Svelte front endUse AI SDK UI rather than hand-parsing streams
You want a person to approve a tool call before it runsUse the version 7 tool approvals
One step will stay on one provider for goodCall that provider's own SDK; skip the layer
Your backend is Python onlyWait: the AI SDK for Python is still beta
Use the AI SDK if you will swap models or stream chat; skip it for one provider forever; wait if Python only
Our rule of thumb, per step, not per vendor.

The import line is the cheap part of a swap. The expensive part is knowing the new model is as good on your step: tool calls fire differently, structured output fails in new ways, and prompts tuned for one model drift on another. So the SDK does not remove the need for an eval set; it makes running one cheap. On a swap we run both models on the same real inputs in shadow mode, compare the answers and the cost per step, and switch only the steps where the new model holds. Provider-only settings, such as caching or reasoning options, go through each call's providerOptions, so they are visible in the code rather than hidden in the abstraction.

One more case pays off, and few guides mention it. Not every hop in an agent should be a writing model. A step that answers "which queue?" or "is this done?" is a decision, and a small decision model answers it faster than a model that writes. On 7 October 2026 Vercel put a decisions endpoint on AI Gateway, and its changelog shows the AI SDK calling it with experimental_decide. Jev, TypeSafe's decision model, is one of the models it names. So one SDK can hold the writing model and the gate model, which keeps a mixed stack in one codebase.

Our model-mix rule, from putting 200+ agents into production: a step whose answer is one of a fixed set (a queue, yes or no, a score) goes to a decision model. A step that fills a short, well-specified draft goes to a small writing model. A step that plans, reads long context or writes to a customer in their own words goes to a frontier model, with a person on the write. Own the routing rules, the eval set and the record of what was decided; rent the inference and the plumbing. The function is marked experimental, so pin the version. We set up Jev for clients (Jev page), so weigh that line with that in mind.

What does version 7 ask of your stack?

Version 7 shipped on 25 June 2026, and it asks for two things before anything else. Node.js 22 is the minimum, because the SDK relies on runtime APIs that were not backported. Imports must be ESM: Vercel's changelog says CommonJS require() is not supported. An older Express service that still uses require has to move first.

What you get for the upgrade is the agent plumbing many teams wrote by hand:

  • Tool approvals. A call or an agent can mark a tool as needing user approval, auto-approve, auto-deny, or hand the choice to your own typed function.
  • Durable runs. WorkflowAgent keeps an agent's state between steps, so it survives a deploy, a restart or an approval that waits.
  • Telemetry. @ai-sdk/otel emits OpenTelemetry spans for model calls, steps and tools.
  • Sandbox support. A tool can run commands in a sandbox, including Vercel Sandbox.

Realtime voice and video generation are marked experimental in the same changelog. Do not plan a production voice line on them yet.

Five checks before AI SDK 7: Node.js 22, ESM only, run the codemods, test approvals, experimental items flagged
What version 7 asks of your stack, from Vercel's changelog.

Vercel ships codemods and a migration guide for most import and rename changes. Run them on a branch, then read the semantic items yourself. A codemod changes names; it does not tell you whether an approval now fires where it used to.

What does it cost to run, and where does the data go?

The library costs nothing. The cost is the model tokens and the place you run it, and both decide where your data goes.

  • Tokens. Through the provider's own key, you pay that provider. Through AI Gateway, Vercel says it adds no markup to provider token prices; team-wide zero data retention and provider allowlists cost $0.10 per 1,000 requests each on Pro and Enterprise. Our post on AI Gateway costs has the full fee table.
  • Hosting. It runs anywhere Node.js 22 runs. On Vercel Functions, Vercel lists 19 compute regions and none is in the UAE or Saudi Arabia. Mumbai (bom1) is the nearest, and the default is Washington, D.C. (iad1).
  • Inference region. If you route models through AI Gateway, the inference region can be pinned to the US or the EU only. Left unset, it is "global" and may run outside your users' jurisdiction.

To say which step costs what, measure it per step. Version 7's @ai-sdk/otel package emits spans and metrics in the OpenTelemetry GenAI conventions for each model call, step and tool, so your collector can attribute token use to the step that spent it. Price those tokens per model and you have cost per step; add the outcome from the record and you have cost per outcome. If you route through AI Gateway, its logs add provider, tokens and cost per request, and per-request zero data retention is free on Pro and Enterprise. Neither Vercel page we read gives a latency figure for the layer or the gateway hop, and we will not guess one: we measure p50 and p95 per step in shadow mode, on your traffic, before go-live.

So a Dubai or Riyadh team that needs prompts to stay in-country cannot get that from a hosted Vercel setup today. We confirm the data path per project, in writing, before you sign. That may mean the AI SDK on your own Gulf server, calling a model endpoint you have checked.

What does it look like on a Dubai brokerage's lead replies?

Here is a sample plan, labelled as one, for a brokerage where portal leads arrive on WhatsApp and wait until morning. It is the shape we would write in the assessment, not a client deployment.

  1. 01A portal lead arrives on WhatsApp. A small decision model sorts it: buyer, tenant, landlord or spam.
  2. 02A writing model drafts a reply in the lead's language, with the listing they asked about.
  3. 03The agent proposes a new lead record in Salesforce. A tool approval holds the write for a broker.
  4. 04The broker approves on their phone. The record is written with the broker as owner, and the trace keeps who approved.
Sample plan: a portal lead on WhatsApp is sorted, a reply is drafted, a person approves the CRM write
A sample plan for a brokerage, not a client deployment.

The AI SDK earns its place on steps 1 and 2. Those are the two models you are most likely to change as prices and languages move, and changing one is a model string, not a rewrite. Step 3 is where the risk sits: the write. The approval is in the SDK, but who approves, and on which fields, is your process to name. For the brokerage side of this, see Mindcat for real estate brokers and our WhatsApp page.

What should you check before you commit?

Five checks, in this order, before the AI SDK goes into a production agent:

  1. Runtime. Every service that will import it runs Node.js 22 or later, and uses ESM.
  2. The swap you expect. Name the step and the model you would try next. If you cannot name one, call the provider directly.
  3. The write. Each tool that writes to a system of record has an approval policy, tested with a rejected approval as well as an approved one.
  4. The data path. Write down where the code runs and which model endpoint each step calls. For the Gulf, that line decides more than the SDK does.
  5. Experimental labels. List every experimental function you use, pin the version, and re-test on each upgrade.

How do we start?

We call the method Spec, shadow, gate: we write the steps and the data path down, run the agent beside your team without writing anything, then put a person on the write. The written assessment is free and says which steps need the AI SDK and which do not. The first build week is a fixed AED/SAR 14,900, credited in full if you sign the build within 60 days, and our Run plans are on one page. See how we build on Vercel for the rest.

We are not a Vercel partner; we use the product's own names, and mindcat.ai itself runs on Netlify. If you have no agent step with a model you would change and no front end to stream into, you do not need this layer yet: call your provider directly and come back when a second model is on the table.

Filed under

AI agents built on Vercel's agent stackai sdk 7ai sdk vs openai sdkswitch llm provider typescriptai sdk tool approval
Useful to someone on your team?

FAQ

Questions teams ask next

Is the Vercel AI SDK free?
Yes. The npm package ai is open source under the Apache-2.0 licence, and version 7.0.142 was the latest on 16 October 2026. There is no price or SLA for the library itself. You pay for the model tokens, through the provider or through AI Gateway, and for wherever you run the code.
Does the AI SDK only work on Vercel?
No. It is a TypeScript library for React, Next.js, Vue, Svelte and Node.js, so it runs wherever Node.js 22 runs. Vercel hosting and AI Gateway are separate choices. If you host on Vercel, no compute region is in the UAE or Saudi Arabia; Mumbai (bom1) is the nearest.
What breaks when we upgrade to AI SDK 7?
Vercel's changelog lists two hard requirements: Node.js 22 or later, and ESM imports, because CommonJS require() is not supported. It also renames several APIs. Vercel ships codemods and a migration guide for most import and rename changes, then you review the semantic items by hand.
Can the AI SDK call a small decision model as well as a writing model?
Yes, as an experimental API. Vercel's 7 October 2026 changelog shows experimental_decide calling decision models through AI Gateway, which lists Jev among them. Treat the experimental label as real: pin the version and test before you put it on a production gate.

Sources

  1. 01Vercel: AI SDK product pageAccessed 16 Oct 2026
  2. 02AI SDK docs: introduction (AI SDK Core, UI and Harnesses)Accessed 16 Oct 2026
  3. 03Vercel changelog: AI SDK 7 is now available (25 June 2026)Accessed 16 Oct 2026
  4. 04npm registry: ai (version, licence, engines)Accessed 16 Oct 2026
  5. 05Vercel changelog: OpenAI Decisions API on AI Gateway (7 October 2026)Accessed 16 Oct 2026
  6. 06Vercel docs: AI Gateway pricingAccessed 16 Oct 2026
  7. 07Vercel docs: regionsAccessed 16 Oct 2026
  8. 08Vercel docs: AI Gateway regional inferenceAccessed 16 Oct 2026
Shivanath Devinarayanan, founder of Mindcat

Written by

Shivanath Devinarayanan

Founder, Mindcat Consulting · Salesforce MVP Hall of Fame

Runs 200+ agents in production. Reads every brief that comes in and signs the work that goes out.

About Shivanath

First Agent in Production · the written assessment

We work in real estate and right now, the AI pilot never left the sandbox.

Industry
Problem

Brief: Real estate. Leads from portals and WhatsApp. Follow-up has no owner. Stalled AI or Salesforce pilot. Need a finish, cut, or rebuild call. From: /blog/vercel-ai-sdk-when-it-pays.