The correct region to use for Claude 3 Haiku is RegionEndpoint.USWest2
.
Long story short, you need to review the Regions Supported
column from the table where Amazon lists all of its Supported foundation models in Amazon Bedrock.
Copy/Paste the string
listed in the Amazon ID
column and use a RegionEndpoint
enum that corresponds to one listed in Regions Supported
column.
using AiChatClient.Common;
using AiChatClient.Console;
using Amazon;
using Amazon.BedrockRuntime;
var bedrockService = new BedrockService(
new AmazonBedrockRuntimeClient(AwsCredentials.AccessKeyId, AwsCredentials.SecretAccessKey, RegionEndpoint.USWest2),
"anthropic.claude-3-haiku-20240307-v1:0");
await foreach (var response in bedrockService.GetStreamingResponseAsync("Is this working?", new(), CancellationToken.None))
{
Console.Write(response.Text);
}
Here's a blog post I wrote to help explain more: https://codetraveler.io/2025/03/25/introducing-awssdk-extensions-bedrock-meai-2/