ModelProviders
Namespace: E2E
public static class ModelProvidersReady-made models for the providers upstream’s e2e init and docs name, each reading the key from the
environment variable the AI SDK reads. Subscription logins are in Subscriptions.
Inheritance: object
Methods
Section titled “Methods”Anthropic(string, string?)
Section titled “Anthropic(string, string?)”public static AnthropicModel Anthropic(string model, string? apiKey = null)Anthropic’s Messages API, reading ANTHROPIC_API_KEY.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
apiKey |
string |
Returns: AnthropicModel
AzureOpenAi(string, string?, string?)
Section titled “AzureOpenAi(string, string?, string?)”public static OpenAiResponsesModel AzureOpenAi(string deployment, string? resourceName = null, string? apiKey = null)An Azure OpenAI deployment over the Responses API (/openai/v1), reading AZURE_API_KEY.
<code class=“paramref”>resourceName</code> defaults to AZURE_RESOURCE_NAME.
Parameters
| Name | Type | Description |
|---|---|---|
deployment |
string | |
resourceName |
string | |
apiKey |
string |
Returns: OpenAiResponsesModel
AzureOpenAiAt(string, string, string?)
Section titled “AzureOpenAiAt(string, string, string?)”public static OpenAiResponsesModel AzureOpenAiAt(string deployment, string baseUrl, string? apiKey = null)An Azure OpenAI deployment at an explicit /openai/v1 base URL, reading AZURE_API_KEY.
Parameters
| Name | Type | Description |
|---|---|---|
deployment |
string | |
baseUrl |
string | |
apiKey |
string |
Returns: OpenAiResponsesModel
Bedrock(string, string?)
Section titled “Bedrock(string, string?)”public static BedrockModel Bedrock(string model, string? region = null)Amazon Bedrock’s Converse API, signed from the AWS environment or with AWS_BEARER_TOKEN_BEDROCK.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
region |
string |
Returns: BedrockModel
Gateway(string, string?)
Section titled “Gateway(string, string?)”public static OpenAiCompatibleModel Gateway(string model, string? apiKey = null)The Vercel AI Gateway over its OpenAI-compatible API, reading AI_GATEWAY_API_KEY, or without it the
VERCEL_OIDC_TOKEN that vercel env pull writes for a linked project.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
apiKey |
string |
Returns: OpenAiCompatibleModel
Google(string, string?)
Section titled “Google(string, string?)”public static GoogleModel Google(string model, string? apiKey = null)Google’s Gemini API, reading GOOGLE_GENERATIVE_AI_API_KEY.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
apiKey |
string |
Returns: GoogleModel
Ollama(string, string)
Section titled “Ollama(string, string)”public static OpenAiCompatibleModel Ollama(string model, string baseUrl = "http://127.0.0.1:11434/v1")A local Ollama server’s OpenAI-compatible API, no key.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
baseUrl |
string |
Returns: OpenAiCompatibleModel
OpenAi(string, string?)
Section titled “OpenAi(string, string?)”public static OpenAiCompatibleModel OpenAi(string model, string? apiKey = null)OpenAI over chat completions, reading OPENAI_API_KEY.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
apiKey |
string |
Returns: OpenAiCompatibleModel
OpenAiResponses(string, string?)
Section titled “OpenAiResponses(string, string?)”public static OpenAiResponsesModel OpenAiResponses(string model, string? apiKey = null)OpenAI over the Responses API, reading OPENAI_API_KEY. The AI SDK’s openai(id) calls this API.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
apiKey |
string |
Returns: OpenAiResponsesModel
OpenRouter(string, string?)
Section titled “OpenRouter(string, string?)”public static OpenAiCompatibleModel OpenRouter(string model, string? apiKey = null)OpenRouter, reading OPENROUTER_API_KEY. Model ids name the upstream, such as openai/gpt-6-luna-fast.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
apiKey |
string |
Returns: OpenAiCompatibleModel
Xai(string, string?)
Section titled “Xai(string, string?)”public static OpenAiCompatibleModel Xai(string model, string? apiKey = null)The SpaceXAI API, reading XAI_API_KEY.
Parameters
| Name | Type | Description |
|---|---|---|
model |
string | |
apiKey |
string |
Returns: OpenAiCompatibleModel