AI application SDK

AI SDK

An open-source TypeScript toolkit for model access, streaming, structured output, tools, embeddings, and supported provider adapters, with Vercel AI Gateway as its current default global provider.

Editorial verdict

Choose AI SDK when a TypeScript product benefits from shared application primitives and its supported provider adapters. Deliberately choose between the current default Vercel AI Gateway path and direct provider packages; prefer a provider SDK when native capability fidelity matters more than portability.12

Best for

  • TypeScript products that expect to evaluate or switch among supported model providers
  • Teams that want shared application primitives for streaming, tools, and structured model output
  • Products willing to test abstraction behavior whenever providers or model capabilities change
12

Not ideal for

  • Teams that require provider-specific APIs immediately when they are released
  • Non-TypeScript systems that would add a separate service only to use the library
  • Products treating an SDK abstraction as a substitute for model evaluation and operational controls
12
Main trade-off

A shared TypeScript interface and application primitives reduce repeated integration work while adding adapter, release, abstraction, and default-gateway dependencies that must be tested against each exact provider and model.12

Product boundary

Whether a provider-neutral TypeScript application layer is worth adding between the product and model APIs.

AI SDK is an application library and provider abstraction. It does not supply models, model evaluation, provider contracts, safety policy, or production observability. String model references currently use Vercel AI Gateway by default; dedicated provider packages can call providers directly, and AI Gateway remains a separate Tool and commercial boundary.12

For: TypeScript teams building model-backed application features across one or more supported providers

  • A required provider capability is not represented faithfully by an adapter.
  • The application is not primarily TypeScript.
  • A single provider and its newest native APIs are an intentional product boundary.
  • The current default gateway route does not fit data, routing, pricing, or operational requirements.

Why teams consider AI SDK

  • Provider abstractionSupported providers implement a shared language-model specification, which can reduce application-level switching work.1
  • Application primitivesCore APIs cover model interaction patterns including text generation, streaming, tools, structured output, and embeddings.2
  • Open-source package boundaryThe SDK can be inspected and adopted as application code without purchasing inference from the SDK itself.3

Pricing

The open-source library has no separate software fee. Model providers, the selected gateway route, hosting, tools, storage, telemetry, and application operations create total cost; gateway and direct-provider billing must not be merged.3

Library and provider route

Open-source library with direct provider or gateway usage

Verified 2026-07-27: AI SDK has no separate inference fee; model and optional gateway usage are billed under the selected provider or gateway terms.3

Library
No separate open-source SDK inference charge3
Default path
String model references currently use Vercel AI Gateway3
Total cost
Provider or gateway usage plus hosting, tools, storage, telemetry, and operations3
Pricing checked View official pricing

AI SDK vs alternatives

OpenAI official SDK

Choose when
OpenAI is the intentional provider and direct access to current OpenAI APIs matters more than portability.
Avoid when
The application needs one interface across several providers.
Compared with AI SDK
First-party fidelity increases provider-specific code and migration work.9

Anthropic official SDK

Choose when
Claude is the intentional provider and native Messages, streaming, and tool semantics should remain explicit.
Avoid when
The application needs a shared provider abstraction.
Compared with AI SDK
Claude fidelity increases provider-specific integration and lifecycle dependence.10

Google Gen AI SDK

Choose when
Gemini is the selected platform and its current first-party SDK and backend boundary are deliberate.
Avoid when
The product expects frequent cross-provider switching.
Compared with AI SDK
First-party access improves Gemini fidelity while SDK and model lifecycle remain Google-specific.11

Resources and sources

Official product, architecture, and pricing

  • AI SDK providers and models
    Open
  • AI SDK Core reference
    Open
  • AI SDK license
    Open

Current provider and gateway boundary

  • AI SDK choosing a provider
    Open
  • AI SDK Gateway provider
    Open
  • OpenAI SDKs and CLI
    Open
  • Anthropic TypeScript SDK
    Open
  • Gemini API libraries
    Open
  1. 1
    AI SDK providers and models

    Vercel · Accessed Official

  2. 2
    AI SDK Core reference

    Vercel · Accessed Official

  3. 3
    AI SDK license

    Vercel · Accessed Official

  4. 4
    AI SDK choosing a provider

    Vercel · Accessed Official

  5. 5
    AI SDK Gateway provider

    Vercel · Accessed Official

  6. 6
    OpenAI SDKs and CLI

    OpenAI · Accessed Official

  7. 7
    Anthropic TypeScript SDK

    Anthropic · Accessed Official

  8. 8
    Gemini API libraries

    Google · Accessed Official

  9. 9
    OpenAI JavaScript and TypeScript library

    OpenAI · Accessed Official

  10. 10
    LangChain overview

    LangChain · Accessed Official

  11. 11
    OpenAI API reference

    OpenAI · Accessed Official