Vercel AI SDK Can Move Agent Spend to Existing Plans

Vercel AI SDK can use supported agent subscriptions. Check which credentials win, which allowance pays, and what sandbox costs remain.

Tuesday, September 15, 2026Omid Saffari
Vercel AI SDK Can Move Agent Spend to Existing Plans

Vercel changed which account can pay for an embedded coding agent on September 14, 2026. AI SDK can now use a supported agent subscription already signed in on the host, making the next eligible model run a $0 incremental charge until that plan allowance runs out. Sandbox compute still has its own bill.

This changes the payer, not the agent

AI SDK has a layer for running complete coding agents behind one HarnessAgent interface. Vercel calls each adapter a harness because it wraps more than a model call: the agent brings its own tools, workspace behavior, session state, permissions, and compaction.

That distinction matters. This release does not make Claude Code, Codex, Cursor, or another agent better at coding. It gives the adapter a new place to find credentials: a native subscription session stored on the machine running your application.

Before this change, an embedded run needed an explicit provider credential or an AI Gateway credential. Now an eligible adapter can fall back to the subscription already authenticated on the host. No application-code change or new setting is required for discovery.

The release names nine adapters: Claude Code, Cline, Codex, Cursor, fx, GitHub Copilot, Grok Build, OpenCode, and Pi. That is not a blanket promise for every account. The underlying agent still has to support subscription login, and its own plan rules still decide what the login can spend.

The useful business consequence is simple: the same agent.generate() call can land on three different budget lines depending on the credentials around it.

The credential order decides the bill

There are three authentication modes. The default is auto. For direct adapters such as Claude Code and Codex, the practical order is:

ModeCredential orderWhat receives the model charge
autoAI Gateway first, then provider credentials, then a native subscriptionGateway credits or invoice if VERCEL_OIDC_TOKEN or AI_GATEWAY_API_KEY exists; otherwise the provider API account; otherwise the plan allowance
directProvider credentials first, then a native subscriptionThe provider API account if its key exists; otherwise the plan allowance
ai-gatewayAI Gateway onlyGateway credits or the Vercel invoice; native subscriptions are never read

This is where a quiet environment variable changes the accounting. A Claude Code run in direct mode will use ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN before the Claude subscription. A Codex run will use OPENAI_API_KEY or CODEX_API_KEY before the ChatGPT entitlement.

auto adds one more level above those. If it sees a Gateway credential, Gateway wins before either the provider key or the subscription.

Network route and billing source are not identical for every adapter. fx still sends model requests through AI Gateway in direct and ai-gateway, but it can now resolve a supported native subscription when no applicable environment credential is set and ai-gateway was not selected. Check the adapter page before treating this table as a universal transport map.

Architectural routing model showing Auto, Direct, and Gateway entrances leading to subscription allowance, provider API, or AI Gateway billing
The authentication mode chooses the route, but credentials within that route still decide which account pays.

The security boundary is better than copying a raw OAuth token into an isolated machine. Vercel resolves credentials on the host and refreshes OAuth there. When the sandbox supports request transformation, the agent sees a placeholder and the host injects the real credential only into the matching outbound request.

That protects the secret from the sandbox. It does not turn a personal subscription into pooled company capacity.

What the cost math looks like

The model charge can move to an allowance. The runtime charge does not move with it.

Subscription allowance

Take Claude Code as the cleanest current example. Claude Pro costs $20 when paid monthly or $200 for a year, and Claude Max costs $100 or $200 per month for 5x or 20x Pro usage. If you already pay for one of those plans, an eligible native-auth run adds no separate model charge until the shared allowance is exhausted.

The word shared is doing real work. Anthropic currently says Claude Agent SDK, claude -p, and third-party Agent SDK apps still draw from subscription limits. It also says claude.ai, Claude Code, and Claude Desktop count against the same usage limit. The Vercel Claude Code adapter uses Anthropic's Agent SDK, so the practical reading is that embedded work competes with the subscriber's other Claude work.

OpenAI has the same budgeting shape, with different meters. ChatGPT Plus costs $20 per month, Codex is included across ChatGPT plans, and limits vary by plan. Codex shares an agentic allowance with ChatGPT Work, ChatGPT for Excel, and Workspace Agents where those products are available. Eligible Plus and Pro users can buy credits after included usage, but those are not API credits.

So the subscription path is not free inference. It is prepaid capacity with a variable ceiling. Moving background jobs into the adapter may save API charges today and shorten the person's interactive session tomorrow.

Direct provider API

If a provider key wins, the provider's metered account pays. Claude Sonnet 4.6 currently costs $3 per million input tokens and $15 per million output tokens at standard API rates. OpenAI's GPT-5.6 Luna costs $0.20 per million input tokens, $0.02 per million cached input tokens, and $1.20 per million output tokens.

Those prices make the API path easy to attribute. They do not make a coding-agent task easy to forecast. Repository size, conversation history, reasoning effort, retries, and tool loops all change token use. Measure completed tasks, not prompts.

AI Gateway

If a Gateway credential wins, usage lands in AI Gateway. Vercel charges the upstream list price with no token markup or platform fee. The usual payment source is prepaid Gateway credit, while Enterprise customers can use a consolidated Vercel invoice.

This path gives a team one spend surface. It also lets the team use Gateway budgets. Those controls do not follow a run that bypasses Gateway for a native subscription, so choose between marginal savings and central budget enforcement on purpose.

Sandbox compute

Every AI SDK agent runtime still operates in a sandbox. In Vercel's default iad1 region, Sandbox costs $0.128 per Active CPU hour and $0.0212 per provisioned GB-hour. CPU pauses while the process waits on model or network I/O, but memory continues for the wall-clock runtime.

Vercel's own AI code-validation example runs for five minutes with two vCPUs and four GB of memory. It costs about $0.03 at 100% CPU use. If the full $20 Pro credit were available only for that exact workload, the arithmetic gives a rough ceiling of 666 runs before paid Sandbox usage. Real capacity will differ because other Vercel services can consume the credit, tasks use different resources, and transfer or storage can add cost.

That is the whole budget:

  • Subscription route: existing plan price, shared allowance, plus Sandbox.
  • Provider route: metered provider tokens, plus Sandbox.
  • Gateway route: provider list-price tokens on the Gateway balance or invoice, plus Sandbox.

Who should use each route

A solo founder running an internal repository helper

A founder who already pays for Claude Pro or ChatGPT Plus can put a low-volume test-fix or repository-summary tool behind HarnessAgent, select direct, and let the native plan cover eligible model work. The payoff is avoiding another model balance during the pilot.

Keep the scope internal and watch the provider's usage page. The subscription is also paying for the founder's terminal and app work, so a background job can consume the capacity needed later that day.

An agency technical lead standardizing operator jobs

An agency can give each named operator a contained repository task and use that operator's eligible subscription on the host. The important control is not the adapter choice. It is checking that provider API variables are absent before the run starts.

That gives finance a clean rule: plan allowance first for bounded internal work, provider API only when a key was deliberately mounted. It also avoids sharing one person's login across the whole agency.

A developer-platform team running shared automation

A platform team should usually pin unattended or shared jobs to ai-gateway. That sacrifices the $0 incremental subscription window, but it gives the team one billing owner, one credit pool or invoice, and spend controls that match the service rather than a person.

The older fx adapter explainer still gets an important detail right: both fx modes send model requests through AI Gateway. What changed on September 14 is the credential fallback. Its setup and cost sections now need to account for a supported native subscription when no higher-priority credential takes over.

A SaaS founder selling agent work to customers

A customer-facing coding feature should not make one employee's subscription the capacity plan. Customer traffic is shared, variable, and expected to survive staff changes. Use AI Gateway or a provider API account with an explicit owner, then include Sandbox in the unit economics.

The standalone subscription-agent roundup answers which local or open-source client one developer should use with a plan they already own. This release is about embedding a supported runtime inside an AI SDK application. The login may be similar. The operating model is not.

Run one Claude Code job against the plan allowance

This path is for a contained internal job on a host where the named user has already signed in to Claude Code. It deliberately selects direct using the documented Claude Code adapter setting, so the Vercel OIDC token can authenticate Sandbox without routing model work to Gateway.

  1. Install the documented packages

    Inside an existing Node project, add the core agent package, the Claude Code adapter, and the Vercel Sandbox adapter.

    Bash
    pnpm add @ai-sdk/harness @ai-sdk/harness-claude-code @ai-sdk/sandbox-vercel
  2. Sign in on the host

    Run Claude Code on the same host and choose the Claude account with the eligible subscription.

    Bash
    claude

    Keep VERCEL_OIDC_TOKEN available for Sandbox. Check the process environment and remove ANTHROPIC_API_KEY and ANTHROPIC_AUTH_TOKEN from this run if the subscription should pay. Either provider variable wins before the native login.

  3. Force the direct route

    Save this as agent.mjs. The code uses the documented direct selector, the current node24 Sandbox runtime, and exposed port 4000 required by the bridge.

    JavaScript
    import { HarnessAgent } from '@ai-sdk/harness/agent';
    import { createClaudeCode } from '@ai-sdk/harness-claude-code';
    import { createVercelSandbox } from '@ai-sdk/sandbox-vercel';
    
    const agent = new HarnessAgent({
      harness: createClaudeCode({ auth: 'direct' }),
      model: 'claude-sonnet-4-6',
      sandbox: createVercelSandbox({
        runtime: 'node24',
        ports: [4000],
      }),
    });
    
    const session = await agent.createSession();
    
    let exitCode = 0;
    try {
      const result = await agent.generate({
        session,
        prompt: 'Create a short TODO.md for this repository.',
      });
    
      console.log(result.text);
    } catch (err) {
      exitCode = 1;
      console.error(err);
    } finally {
      await session.destroy();
      process.exit(exitCode);
    }
  4. Verify both receipts

    Run one harmless task. Confirm the provider usage page shows the plan allowance moving and no new API charge. Then check Vercel Usage for the Sandbox line.

    If AI Gateway records the model request, a Gateway credential won. If the provider API dashboard records a charge, a provider credential won. Stop and fix the environment before scaling the pilot.

The honest limits

Native login is host-bound. It is not a ready-made OAuth flow for every customer in your application, and it does not pool individual allowances across a team.

Plan capacity also moves. OpenAI says Codex limits vary by plan and task. Anthropic says Claude use depends on model, task complexity, context, and effort. Neither gives this Vercel path a fixed number of production jobs.

The AI SDK agent packages remain experimental, with breaking changes possible between releases. That is acceptable for a measured internal pilot. It is a reason to pin dependencies, test credential selection, and keep a Gateway or provider path ready before putting this into a customer promise.

The Monday move

Pick one internal repository task and one eligible user. Set the adapter to direct, inventory the provider variables on that host, run the task once, and record which billing dashboard moved, whether the subscription allowance changed, the Sandbox charge, and whether the task completed.

Act this week if you already own a supported plan and have a bounded internal workflow. Wait if the underlying agent cannot log in by subscription or the package's experimental status is outside your dependency policy. Stay on ai-gateway if central budgets and shared production ownership matter more than the marginal model saving. You are unaffected if you call ordinary AI SDK model providers and never use HarnessAgent.

For more operator-grade explanations of the AI tools changing real budgets and workflows, join the newsletter.

Last Updated
Sep 15, 2026
Category
Explained

Prefer this site in Google

Add omidsaffari.com as a preferred source in Google Search

Mark omidsaffari.com as preferred and Google lifts it in Top Stories, AI Overviews and AI Mode for you.

Cloudflare Browser Run Keeps Client Jobs on Approved Hosts

Cloudflare Browser Run Keeps Client Jobs on Approved Hosts

Limit client browser jobs to approved hosts, budget for required CDNs, and let reviewers watch through read-only Live View.Sep 14, 2026Explained
GPT-Live-1 Changes the Budget for AI Phone Calls

GPT-Live-1 Changes the Budget for AI Phone Calls

Understand GPT-Live-1 phone-agent costs: the voice layer, backend reasoning, telephony, and the interruption handling worth testing.Sep 14, 2026Explained
ChatGPT Appshots Cut Context Copying on Windows

ChatGPT Appshots Cut Context Copying on Windows

Use ChatGPT Appshots on Windows to share an app window, reduce context copying, and check what text and images enter the chat.Sep 14, 2026Explained
Vercel FastAPI Cuts Function Use for Static Files

Vercel FastAPI Cuts Function Use for Static Files

Vercel now serves eligible FastAPI assets from its CDN. See which requests stop using Functions and which protected paths still need them.Sep 13, 2026Explained
OpenAI API Key Expiry Needs a Rotation Plan

OpenAI API Key Expiry Needs a Rotation Plan

OpenAI now lets teams expire project API keys. Plan replacement and verification before scheduled agents lose access.Sep 13, 2026Explained
Vercel Connect Gives Shared Credentials a Clear Owner

Vercel Connect Gives Shared Credentials a Clear Owner

Vercel Connect lets Pro and Enterprise teams restrict connector management. See how to assign owners and keep agent setup moving.Sep 13, 2026Explained
Cloudflare AI Search Can Index R2 Files Without Renaming

Cloudflare AI Search Can Index R2 Files Without Renaming

Cloudflare AI Search now indexes extensionless R2 files with valid Content-Type metadata. See which ingestion steps you can remove.Sep 12, 2026Explained
Vercel Sandbox Gives Larger Agent Jobs More Disk Room

Vercel Sandbox Gives Larger Agent Jobs More Disk Room

See which repository, build, and data jobs fit Vercel Sandbox’s larger disk, plus what to measure before retrying a storage-heavy agent run.Sep 12, 2026Explained
Newsletter

One letter, every Sunday.Working systems, not hot takes.

Weekly. No spam. Unsubscribe anytime.