AI SDK
An AI SDK is the official client library a vendor ships for calling their model APIs — Anthropic SDK, OpenAI SDK, Google GenAI SDK, Mistral SDK, Vercel AI SDK (multi-vendor wrapper). Handles auth, retries, streaming, types.
Calling HTTP APIs directly works but loses ergonomics: each vendor's quirks (auth header naming, streaming format, error retry policy) become app code. AI SDKs abstract this: official client libraries handle auth, automatic retries with backoff, streaming responses, type safety, tool use round-trips. 2026 landscape: vendor-official SDKs (Anthropic SDK, OpenAI SDK, Google GenAI SDK, Mistral SDK, Cohere SDK), multi-vendor wrappers (Vercel AI SDK, LiteLLM, Vellum), language-specific (TypeScript / Python first-class, Go / Rust / Java second). Production tips: pin SDK version (breaking changes happen), use multi-vendor wrappers if you need portability, monitor SDK changelog for new features (prompt caching, computer use, MCP arrived through SDK updates).
When to use ai sdk
- Any production LLM integration.
Common mistakes
- Hand-rolling HTTP calls — miss retries, streaming, type safety.
- Pinning to ancient SDK — miss new features for months.
FAQ
What is ai sdk?
An AI SDK is the official client library a vendor ships for calling their model APIs — Anthropic SDK, OpenAI SDK, Google GenAI SDK, Mistral SDK, Vercel AI SDK (multi-vendor wrapper). Handles auth, retries, streaming, types.
When should I use ai sdk?
Any production LLM integration.
What are the most common mistakes with ai sdk?
Hand-rolling HTTP calls — miss retries, streaming, type safety. Pinning to ancient SDK — miss new features for months.
Related terms
- LLM gateway — An LLM gateway is the proxy layer between your app and one-or-many LLM providers — handles routing, fallback, caching, cost tracking, rate limiting, and observability. OpenRouter, LiteLLM, Portkey, Helicone, Cloudflare AI Gateway are 2026 leaders.
- Model name portability — Model name portability is the principle of writing app code that survives swapping the underlying LLM provider (Claude → GPT → Gemini → local) without rewriting prompts, tool definitions, or response parsing.
Last updated: 2026-06-01. Raw markdown: https://promtable.com/glossary/ai-sdk.md.