Choosing a Provider
Understand and configure AI model providers
Choosing a Provider
The AI SDK supports dozens of model providers through first-party, OpenAI-compatible, and community packages.
This quickstart uses the Vercel AI Gateway provider, which is the default global provider. This means you can access models using a simple string in the model configuration:
model: __MODEL__;You can also explicitly import and use the gateway provider in two other equivalent ways:
// Option 1: Import from 'ai' package (included by default)
import { gateway } from 'ai';
model: gateway('anthropic/claude-sonnet-4.5');
// Option 2: Install and import from '@ai-sdk/gateway' package
import { gateway } from '@ai-sdk/gateway';
model: gateway('anthropic/claude-sonnet-4.5');Using other providers
To use a different provider, install its package and create a provider instance. For example, to use OpenAI directly:
pnpm add @ai-sdk/openaiimport { openai } from '@ai-sdk/openai';
model: openai('gpt-5.1');Updating the global provider
You can change the default global provider so string model references use your preferred provider everywhere in your application. Learn more about provider management.
Pick the approach that best matches how you want to manage providers across your application.