add-provider-package
Adding a New Provider Package
This guide covers the process of creating a new @ai-sdk/<provider> package to integrate an AI service into the AI SDK.
First-Party vs Third-Party Providers
- Third-party packages: Any provider can create a third-party package. We're happy to link to it from our documentation.
- First-party
@ai-sdk/<provider>packages: If you prefer a first-party package, please create an issue first to discuss.
Reference Example
See https://github.com/vercel/ai/pull/8136/files for a complete example of adding a new provider.
Provider Architecture
The AI SDK uses a layered provider architecture following the adapter pattern:
- Specifications (
@ai-sdk/provider): Defines interfaces likeLanguageModelV4,EmbeddingModelV4, etc. - Utilities (
@ai-sdk/provider-utils): Shared code for implementing providers
More from vercel/ai
ai-sdk
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
25.8Kdevelop-ai-functions-example
Develop examples for AI SDK functions. Use when creating, running, or modifying examples under examples/ai-functions/src to validate provider support, demonstrate features, or create test fixtures.
860capture-api-response-test-fixture
Capture API response test fixture.
735list-npm-package-content
List the contents of an npm package tarball before publishing. Use when the user wants to see what files are included in an npm bundle, verify package contents, or debug npm publish issues.
693adr-skill
Create and maintain Architecture Decision Records (ADRs) optimized for agentic coding workflows. Use when you need to propose, write, update, accept/reject, deprecate, or supersede an ADR; bootstrap an adr folder and index; consult existing ADRs before implementing changes; or enforce ADR conventions. This skill uses Socratic questioning to capture intent before drafting, and validates output against an agent-readiness checklist.
454update-provider-models
Add new or remove obsolete model IDs for existing AI SDK providers. Use when adding a model to a provider, removing an obsolete model, or processing a list of model changes from an issue. Triggers on "add model", "remove model", "new model ID", "obsolete model", "update model IDs".
126