◈
Editorial verdict
多供应商、结构化输出或 AI UI 是产品核心时优先评估。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不适合
- 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
12Main trade-off应用层抽象减少重复代码,但会引入与供应商原生 API 的能力差与调试层。12
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
适用范围: 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.
- 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
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
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
Official product, architecture, and pricing
- AI SDK providers and models
- AI SDK Core reference
- AI SDK license
Current provider and gateway boundary
- AI SDK choosing a provider
- AI SDK Gateway provider
- OpenAI SDKs and CLI
- Anthropic TypeScript SDK
- Gemini API libraries