Anthropic Provider
The Anthropic provider integrates Reveal SDK AI with Anthropic's Claude models, providing access to the Claude family of AI assistants.
Installation
- ASP.NET
- Node.js
- Java
Install the Anthropic provider NuGet package:
dotnet add package Reveal.Sdk.AI.Anthropic
The Anthropic provider is bundled with reveal-sdk-node-ai — no extra package is required:
- npm
- Yarn
- pnpm
- Bun
npm install reveal-sdk-node-ai
yarn add reveal-sdk-node-ai
pnpm add reveal-sdk-node-ai
bun add reveal-sdk-node-ai
The Anthropic provider is bundled with reveal-sdk-ai — no extra dependency is required beyond the base AI artifact:
<dependency>
<groupId>io.revealbi</groupId>
<artifactId>reveal-sdk-ai</artifactId>
<version>1.0.6-SNAPSHOT</version>
</dependency>
Configuration
Basic Setup
- ASP.NET
- Node.js
- Java
Add the Anthropic provider in your Program.cs:
using Reveal.Sdk;
using Reveal.Sdk.AI;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddControllers().AddReveal();
builder.Services.AddRevealAI()
.AddAnthropic(options =>
{
options.ApiKey = builder.Configuration["RevealAI:Anthropic:ApiKey"];
});
var app = builder.Build();
app.MapControllers();
app.Run();
Pass Anthropic settings under the anthropic key in the settings object:
const reveal = require('reveal-sdk-node');
const revealAI = require('reveal-sdk-node-ai');
const express = require('express');
const aiSettings = {
anthropic: {
ApiKey: process.env.ANTHROPIC_API_KEY,
Model: 'claude-sonnet-4-5'
}
};
const revealOptions = {
plugins: [
revealAI.withOptions({
defaultProvider: 'anthropic',
settings: aiSettings
})
]
};
const app = express();
app.use('/', reveal(revealOptions));
app.listen(5111);
Pass Anthropic settings under the anthropic key in the settings map and register the plugin:
import io.revealbi.ai.RevealAIPlugin;
import io.revealbi.ai.RevealAIPluginOptions;
import io.revealbi.core.IRevealServer;
import io.revealbi.core.RevealServerBuilder;
import java.util.Map;
Map<String, Object> aiSettings = Map.of(
"anthropic", Map.of(
"ApiKey", System.getenv("ANTHROPIC_API_KEY"),
"Model", "claude-sonnet-4-5"));
RevealAIPluginOptions aiPluginOptions = new RevealAIPluginOptions(
"anthropic",
"config/catalog.json",
null,
null,
Map.of("settings", aiSettings));
IRevealServer revealServer = new RevealServerBuilder()
.addPlugin(RevealAIPlugin.withOptions(aiPluginOptions))
.build();
Using a Configuration File
- ASP.NET
- Node.js
- Java
The provider automatically binds to the RevealAI:Anthropic configuration section:
{
"RevealAI": {
"Anthropic": {
"ApiKey": "sk-ant-your-api-key-here",
"Model": "claude-opus-4-1",
"MaxTokens": 4096
}
}
}
With configuration binding, no code options are needed:
builder.Services.AddRevealAI()
.AddAnthropic();
Node.js does not bind to appsettings.json. Load your settings from environment variables, a secrets manager, or a local config file and pass them inline:
const aiSettings = {
anthropic: {
ApiKey: process.env.ANTHROPIC_API_KEY,
Model: 'claude-opus-4-1',
MaxTokens: 4096
}
};
Java does not bind to appsettings.json. Load your settings from environment variables, a secrets manager, or a local config file and pass them inline:
Map<String, Object> aiSettings = Map.of(
"anthropic", Map.of(
"ApiKey", System.getenv("ANTHROPIC_API_KEY"),
"Model", "claude-opus-4-1",
"MaxTokens", 4096));
Options
The same option names are used across all server platforms — ASP.NET sets them on the strongly-typed options object, Node.js and Java set them as keys in the anthropic settings map.
| Property | Type | Default | Description |
|---|---|---|---|
ApiKey | string | "" | Required. Your Anthropic API key. |
Model | string | "claude-opus-4-1" | The Claude model to use. |
MaxTokens | int | 4096 | Maximum number of tokens to generate in the response. |
Available Models
Anthropic offers several Claude models. Here are some commonly used options:
| Model | Description |
|---|---|
claude-opus-4-1 | Most capable model for complex tasks (default) |
claude-sonnet-4-5 | Balanced performance and speed |
claude-haiku-3-5 | Fastest and most cost-effective |
- ASP.NET
- Node.js
- Java
builder.Services.AddRevealAI()
.AddAnthropic(options =>
{
options.ApiKey = builder.Configuration["RevealAI:Anthropic:ApiKey"];
options.Model = "claude-sonnet-4-5";
options.MaxTokens = 8192;
});
const aiSettings = {
anthropic: {
ApiKey: process.env.ANTHROPIC_API_KEY,
Model: 'claude-sonnet-4-5',
MaxTokens: 8192
}
};
Map<String, Object> aiSettings = Map.of(
"anthropic", Map.of(
"ApiKey", System.getenv("ANTHROPIC_API_KEY"),
"Model", "claude-sonnet-4-5",
"MaxTokens", 8192));
Getting an API Key
- Create an account at console.anthropic.com
- Navigate to API Keys in the console
- Create a new API key
- Store it securely using User Secrets or environment variables
Never commit API keys to source control. Always use environment variables, User Secrets, or a secure key management service.