AI
AI SDKs
Choose a provider-native SDK or application abstraction by provider commitment, native capability fidelity, runtime, UI needs, and portability limits.
Recommendation
Choose native fidelity or an application abstraction first.
Use an official SDK when one provider is deliberate and native capabilities matter. Use AI SDK when a TypeScript application gains meaningful value from shared provider, streaming, or UI primitives.12
For: TypeScript and JavaScript application teams integrating generative-model APIs after defining the underlying provider and workload requirements
Choose the product and operating model first
Start from workload, integration, quality, policy, data, lifecycle, and ownership requirements before comparing product breadth.
Runtime and UI needs
Separate basic server API access from shared streaming, frontend state, provider registry, framework, and generative UI requirements.4
Production ownership
Keep credentials, authorization, message conversion, tool execution, validation, retry, telemetry, evaluation, policy, and migration explicit.1
Decision routes
Each route addresses a distinct workload or ownership boundary and retains an explicit verification condition.
OpenAI official SDK
Choose OpenAI official SDK
Choose the official OpenAI SDK when OpenAI is deliberate and current OpenAI API fidelity matters more than provider portability.
Verify: Verify the exact API, model, tools, state, storage, retention, runtime, lifecycle, limits, and current pricing.1
Anthropic official SDK
Choose Anthropic official SDK
Choose Anthropic's official SDK when native Messages, streaming, tool-use, and Claude-specific semantics are deliberate.
Verify: The application still owns client tools, credentials, validation, state, failure handling, beta-feature risk, data terms, limits, and cost.2
Google official SDK
Choose Google official SDK
Choose the current Google Gen AI SDK when Gemini-native capabilities or a Google delivery path are material.
Verify: Use the current @google/genai family, distinguish Gemini Developer API from other Google routes, and verify package, auth, API lifecycle, region, policy, limits, and pricing.3
TypeScript provider abstraction
Choose TypeScript provider abstraction
Choose AI SDK when a common provider surface, provider registry, streaming, or generative UI primitives remove meaningful TypeScript application work.
Verify: Portability is partial; verify adapter coverage, provider-defined tools and options, escape hatches, runtime support, telemetry, and abstraction migration.4
Boundary: AI SDKs own provider-native versus provider-normalizing code integration and tool abstractions. LLM APIs own model selection, AI Agents own model-directed workflow control, and AI Gateways own centralized request-path policy.
Differences that change the choice
Compare the workload, product boundary, policy, lifecycle, data path, cost shape, and operating ownership rather than feature volume.
- Fidelity
- Native SDKs expose provider behavior directly; an application abstraction may normalize or trail new capabilities.12
- Portability
- A common interface reduces some switching work but does not equalize prompts, tools, policies, state, outputs, or operations.14
Official resources
Verify current model, API, SDK, product, pricing, policy, data, region, lifecycle, and operating boundaries in first-party material.
Starter stacks
Sources
Official documentation supports current product boundaries and verification points; route selection remains a bounded editorial judgment.
- 1OpenAI SDK official documentation
OpenAI · Accessed Official
- 2Anthropic SDK official documentation
Anthropic · Accessed Official
- 3Google Gen AI SDK official documentation
Google Gen AI · Accessed Official
- 4AI SDK official documentation
AI · Accessed Official
- 5Gemini API libraries and legacy migration
Google · Accessed Official
- 6AI SDK tools and tool calling
Vercel AI SDK · Accessed Official