Skip to main content
Version: 2.0

AI Providers Overview

Reveal SDK AI uses a provider-based architecture that lets you integrate with different large language model (LLM) services. The same set of providers is available on ASP.NET Core, Node.js, and Java — only the registration syntax differs.

Available Providers

ProviderASP.NET NuGetNode.js / Java keyExtension Method (ASP.NET)
OpenAIReveal.Sdk.AI.OpenAIopenai.AddOpenAI()
Azure OpenAIReveal.Sdk.AI.AzureOpenAIazure-openai.AddAzureOpenAI()
AnthropicReveal.Sdk.AI.Anthropicanthropic.AddAnthropic()
Google GeminiReveal.Sdk.AI.Googlegoogle.AddGoogle()

For ASP.NET Core, each provider is a separate NuGet package — install only the ones you need. For Node.js (reveal-sdk-node-ai) and Java (reveal-sdk-ai), the provider implementations are bundled in the main AI package.

How Providers Work

All providers implement a common provider interface and are registered with the AI runtime. The SDK supports registering multiple providers simultaneously and resolves the appropriate one based on the request or a configured default.

Registering Providers

Chain extension methods after AddRevealAI():

builder.Services.AddRevealAI()
.AddOpenAI(options =>
{
options.ApiKey = "your-api-key";
})
.AddAnthropic(options =>
{
options.ApiKey = "your-api-key";
});

Default Provider

The SDK uses a default provider when no specific provider is requested. Available provider keys: openai, azure-openai, anthropic, google.

appsettings.json
{
"RevealAI": {
"DefaultProvider": "openai"
}
}

Configuration Binding

For ASP.NET Core, all providers support configuration binding from appsettings.json under the RevealAI section. Options set in code take precedence over configuration file values:

appsettings.json
{
"RevealAI": {
"DefaultProvider": "openai",
"OpenAI": {
"ApiKey": "sk-...",
"Model": "gpt-4.1"
},
"Anthropic": {
"ApiKey": "sk-ant-..."
}
}
}

For Node.js and Java, load your settings from environment variables, a secrets manager, or a local config file and pass them inline at startup.

Multiple Providers

You can register multiple providers and the SDK will resolve the appropriate one based on the request. This is useful for scenarios such as:

  • Using different models for different types of analysis
  • Providing fallback options
  • Cost optimization by routing simpler tasks to less expensive models
builder.Services.AddRevealAI()
.AddOpenAI() // Registered as "openai"
.AddAnthropic() // Registered as "anthropic"
.AddGoogle(); // Registered as "google"

Custom Providers

If you need to integrate with an LLM service that isn't supported out of the box, you can build a custom provider. Custom providers are currently supported on ASP.NET Core only.