Skip to content

AnthropicOptions

Namespace: Vercel.AI.Anthropic

public class AnthropicOptions

Anthropic Messages API settings.

Inheritance: object

View source

public string? AccessKeyId { get; set; }

AWS access key. Used when no Anthropic API key is configured.

Value: string

View source

public string? ApiKey { get; set; }

Explicit API key. Mutually exclusive with AuthToken.

Value: string

View source

public string ApiKeyEnvironmentVariable { get; set; }

Environment variable. Defaults to ANTHROPIC_API_KEY.

Value: string

View source

public string? AuthToken { get; set; }

Bearer token. Mutually exclusive with ApiKey.

Value: string

View source

public string BaseUrl { get; set; }

API origin. The official host is normalized to /v1. Message calls append /messages.

Value: string

View source

public BatchResultDownloads? BatchResultDownloads { get; set; }

Settings for downloading JSON Lines batch results.

Value: BatchResultDownloads

View source

public Func<CancellationToken, Task<AnthropicAwsCredentials>>? CredentialProvider { get; set; }

Supplies SigV4 credentials for one request.

Value: Func<CancellationToken, Task<AnthropicAwsCredentials>>

View source

public Dictionary<string, string?> Headers { get; }

Headers merged into every request.

Value: Dictionary<string, string>

View source

public string? Name { get; set; }

Model provider id. Defaults to anthropic.messages.

Value: string

View source

public string? Region { get; set; }

AWS region. Used when the AWS base URL is not set explicitly.

Value: string

View source

public string? SecretAccessKey { get; set; }

AWS secret key.

Value: string

View source

public string? SessionToken { get; set; }

AWS session token.

Value: string

View source

public Func<JsonObject, JsonObject>? TransformRequestBody { get; set; }

Optional rewrite of the JSON body before it is sent.

Value: Func<JsonObject, JsonObject>

View source

public Func<Dictionary<string, string?>, IReadOnlyDictionary<string, JsonElement>?, Dictionary<string, string?>>? TransformRequestHeaders { get; set; }

Optional rewrite of the combined request headers. Receives the call’s provider options and returns the headers to send.

Value: Func<Dictionary<string, string>, IReadOnlyDictionary<string, JsonElement>, Dictionary<string, string>>

View source

public Func<DateTimeOffset>? UtcNow { get; set; }

Clock used when signing. Tests pin this.

Value: Func<DateTimeOffset>

View source

public string Version { get; set; }

anthropic-version header.

Value: string

View source

public string? WorkspaceId { get; set; }

Claude Platform workspace id.

Value: string

View source

Apache-2.0 · Copyright 2023 Vercel, Inc. · unofficial community port, not an official Vercel product