Choosing a Provider
The AI SDK supports dozens of model providers through first-party, OpenAI-compatible, and community packages.
AI Gateway
The Vercel AI Gateway is the fastest way to get started with the AI SDK. Access models from OpenAI, Anthropic, Google, and other providers. Authenticate with OIDC or an AI Gateway API key
Add your API key to your environment:
The AI Gateway is the default global provider, so you can access models using a simple string:
You can also explicitly import and use the gateway provider:
Using Dedicated Providers
You can also use first-party, OpenAI-compatible, and community provider packages directly. Install the package and create a provider instance. For example, to use Anthropic:
$ pnpm add @ai-sdk/anthropic
$ npm install @ai-sdk/anthropic
$ yarn add @ai-sdk/anthropic
$ bun add @ai-sdk/anthropic
You can change the default global provider so string model references use your preferred provider everywhere in your application. Learn more about provider management.
See available providers for setup instructions for each provider.
Custom Providers
You can build your own provider to integrate any service with the AI SDK. The AI SDK provides a Language Model Specification that ensures compatibility across providers.
See Writing a Custom Provider for a complete guide.