Skip to content

AnthropicProviderOptions

Namespace AgentPrism · Assembly AgentPrism.Anthropic.dll

AgentPrism’s Anthropic (Claude) provider settings.

public sealed class AnthropicProviderOptions

objectAnthropicProviderOptions

object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

This type is deliberately a class, not a record: a record’s generated ToString would print every property and a single log line would expose the API key.

Validation is done by hand in AnthropicProviderOptionsValidator; DataAnnotations relies on reflection and breaks AOT compatibility.

public AnthropicProviderOptions()

The full path of the configuration section settings are read from.

public const string SectionName = "AgentPrism:Providers:Anthropic"

string

Anthropic API key.

public string? ApiKey { get; set; }

string?

This value is a secret and is never written to a file. Use dotnet user-secrets, an environment variable, or a secret manager. The key is never written to the database, never returned from the API, and never shown in the UI, under any condition.

The upper bound used when ModelBinding.MaxOutputTokens is not given.

public int DefaultMaxOutputTokens { get; set; }

int

The Anthropic Messages API requires max_tokens; it is not an optional field like in OpenAI. Because of this, AgentPrism carries a default and the default cannot be null.

The value bounds output generation, not tokens actually spent. Even so, a very high limit is treated by some providers as a “worst case” cost (see the HTTP 402 encountered with OpenRouter).

The model name used when ModelBinding.Model is left empty.

public string? DefaultModel { get; set; }

string?

The request address. When null, Anthropic’s own address is used. Filled in for setups behind a proxy or gateway.

public Uri? Endpoint { get; set; }

Uri?

How many times the SDK automatically retries a request. When null, the library default is used.

public int? MaxRetries { get; set; }

int?

The circuit breaker looks at failure of the AI.IChatClient level, not the raw request count; this setting does not affect it. However, if a test measures raw request count, this value must be set to 0.

The model catalog shown to the UI.

public IList<ModelDescriptor> Models { get; }

IList<ModelDescriptor>

AgentPrism carries no built-in model list; the catalog comes entirely from here. This list is not a validation list: a model name absent from it can still be used.

The upper time limit for a single request. When null, the library default is used.

public TimeSpan? Timeout { get; set; }

TimeSpan?