Skip to content

AnthropicAwsFetch

Namespace: Vercel.AI.Anthropic

public static class AnthropicAwsFetch

Claude Platform on AWS fetch behavior. GET and POST requests without a body skip signing. POST bodies are signed for service aws-external-anthropic.

Inheritance: object

View source

public const string Service = "aws-external-anthropic"

SigV4 service name.

Value: string

View source

public static readonly string UserAgent

User agent sent on every AWS request. The runtime segment is dotnet.

Value: string

View source

Prepare(string, string?, string?, byte[]?, JsonNode?, IReadOnlyDictionary<string, string?>?, IReadOnlyDictionary<string, string?>?, AnthropicAwsCredentials, DateTimeOffset?)

Section titled “Prepare(string, string?, string?, byte[]?, JsonNode?, IReadOnlyDictionary<string, string?>?, IReadOnlyDictionary<string, string?>?, AnthropicAwsCredentials, DateTimeOffset?)”
public static AnthropicAwsPreparedCall Prepare(string url, string? method, string? body, byte[]? binaryBody, JsonNode? objectBody, IReadOnlyDictionary<string, string?>? headers, IReadOnlyDictionary<string, string?>? requestHeaders, AnthropicAwsCredentials credentials, DateTimeOffset? utcNow = null)

Prepares a call. Non-POST requests and POST requests without a body are not signed. String bodies are left unchanged. Byte bodies are decoded as UTF-8. Other objects are JSON.

Parameters

Name Type Description
url string
method string
body string
binaryBody byte[]
objectBody JsonNode
headers IReadOnlyDictionary<string, string>
requestHeaders IReadOnlyDictionary<string, string>
credentials AnthropicAwsCredentials
utcNow DateTimeOffset?

Returns: AnthropicAwsPreparedCall

View source

PrepareApiKey(string, string, string?, string?, IReadOnlyDictionary<string, string?>?)

Section titled “PrepareApiKey(string, string, string?, string?, IReadOnlyDictionary<string, string?>?)”
public static AnthropicAwsPreparedCall PrepareApiKey(string apiKey, string url, string? method, string? body, IReadOnlyDictionary<string, string?>? headers)

Adds x-api-key and the AWS user-agent without signing. The API key replaces any caller-supplied x-api-key.

Parameters

Name Type Description
apiKey string
url string
method string
body string
headers IReadOnlyDictionary<string, string>

Returns: AnthropicAwsPreparedCall

View source

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