Skip to content

ModelProviders

Namespace: E2E

public static class ModelProviders

Ready-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

View source

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

View source

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

View source

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

View source

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

View source

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

View source

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

View source

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

View source

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

View source

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

View source

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

View source

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

View source