AWSSDK.BedrockRuntime
4.1.1
Prefix Reserved
dotnet add package AWSSDK.BedrockRuntime --version 4.1.1
NuGet\Install-Package AWSSDK.BedrockRuntime -Version 4.1.1
<PackageReference Include="AWSSDK.BedrockRuntime" Version="4.1.1" />
<PackageVersion Include="AWSSDK.BedrockRuntime" Version="4.1.1" />
<PackageReference Include="AWSSDK.BedrockRuntime" />
paket add AWSSDK.BedrockRuntime --version 4.1.1
#r "nuget: AWSSDK.BedrockRuntime, 4.1.1"
#:package AWSSDK.BedrockRuntime@4.1.1
#addin nuget:?package=AWSSDK.BedrockRuntime&version=4.1.1
#tool nuget:?package=AWSSDK.BedrockRuntime&version=4.1.1
Describes the API operations for running inference using Amazon Bedrock models.
Getting started
using Amazon.BedrockRuntime;
using Amazon.BedrockRuntime.Model;
var client = new AmazonBedrockRuntimeClient();
var response = await client.ApplyGuardrailAsync(new ApplyGuardrailRequest
{
// request parameters
});
Bidirectional streaming
InvokeModelWithBidirectionalStream sends and receives events over HTTP/2. It is available on .NET 8 and later.
The SDK calls BodyPublisher to get each event to send, until it returns null. The call does not return a response until some events have been published, so provide events from a different thread than the one that invokes the operation.
using System.Text;
using System.Threading.Channels;
using Amazon.BedrockRuntime;
using Amazon.BedrockRuntime.Model;
var client = new AmazonBedrockRuntimeClient();
var input = Channel.CreateUnbounded<string>();
var request = new InvokeModelWithBidirectionalStreamRequest
{
ModelId = "<model-id>",
BodyPublisher = async () =>
{
if (!await input.Reader.WaitToReadAsync())
{
return null;
}
var json = await input.Reader.ReadAsync();
return new BidirectionalInputPayloadPart
{
Bytes = new MemoryStream(Encoding.UTF8.GetBytes(json))
};
}
};
// The event format is defined by the model, so these are placeholders.
// In a real application the caller generates these from application events,
// while processing the response events as they stream in.
var events = new[] { "<event 1 JSON>", "<event 2 JSON>", "<event 3 JSON>" };
// Produce events over time from a separate task, then end the input stream.
_ = Task.Run(async () =>
{
foreach (var json in events)
{
await input.Writer.WriteAsync(json);
}
input.Writer.Complete();
});
using var response = await client.InvokeModelWithBidirectionalStreamAsync(request);
await foreach (var item in response.Body)
{
if (item is BidirectionalOutputPayloadPart part)
{
Console.WriteLine(Encoding.UTF8.GetString(part.Bytes.ToArray()));
}
}
Microsoft.Extensions.AI
Besides the low-level client shown above, the AWS.Bedrock.MEAI package lets you use Bedrock models through Microsoft.Extensions.AI abstractions such as IChatClient and IEmbeddingGenerator.
Resources
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net11.0 is compatible. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 is compatible. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
- AWSSDK.Core (>= 4.1.1.2 && < 5.0.0)
NuGet packages (46)
Showing the top 5 NuGet packages that depend on AWSSDK.BedrockRuntime:
| Package | Downloads |
|---|---|
|
AWSSDK.Extensions.Bedrock.MEAI
Implementations of Microsoft.Extensions.AI's abstractions for Bedrock. |
|
|
Microsoft.SemanticKernel.Connectors.Amazon
Empowers app owners to integrate cutting-edge LLM technology quickly and easily into their apps. |
|
|
AWS.Bedrock.MEAI
Implementations of Microsoft.Extensions.AI's abstractions for Amazon Bedrock. |
|
|
Zatomic.AI.Providers
.NET SDK for integrating with various AI model providers. |
|
|
LangChain.Providers.Amazon.Bedrock
Amazon Bedrock model provider. |
GitHub repositories (8)
Showing the top 8 popular GitHub repositories that depend on AWSSDK.BedrockRuntime:
| Repository | Stars |
|---|---|
|
microsoft/semantic-kernel
Integrate cutting-edge LLM technology quickly and easily into your apps
|
|
|
cmu-sei/GHOSTS
GHOSTS (General Human-Oriented Synthetic Teammates and Systems) is a realistic user simulation framework for cyber experimentation, simulation, training, and exercise
|
|
|
open-telemetry/opentelemetry-dotnet-contrib
This repository contains set of components extending functionality of the OpenTelemetry .NET SDK. Instrumentation libraries, exporters, and other components can find their home here.
|
|
|
rwjdk/agent-framework-samples
Samples demonstrating the Microsoft Agent Framework in C#
|
|
|
AIDotNet/Thor
Thor is a powerful artificial intelligence model management tool, whose main purpose is to achieve unified management and use of multiple AI models. Through Thor, users can easily manage and utilize numerous AI models
|
|
|
Cysharp/Claudia
Unofficial Anthropic Claude API client for .NET.
|
|
|
newrelic/newrelic-dotnet-agent
The New Relic .NET language agent.
|
|
|
temporalio/samples-dotnet
Samples for working with the Temporal .NET SDK
|
| Version | Downloads | Last Updated |
|---|---|---|
| 4.1.1 | 9 | 11/20/2026 |
| 4.1.0.2 | 13,576 | 11/17/2026 |
| 4.1.0.1 | 6,098 | 11/16/2026 |
| 4.1.0 | 32,307 | 11/12/2026 |
| 4.0.101.18 | 27,328 | 11/10/2026 |
| 4.0.101.17 | 46,091 | 11/6/2026 |
| 4.0.101.16 | 73,447 | 11/5/2026 |
| 4.0.101.15 | 8,603 | 11/4/2026 |
| 4.0.101.14 | 225,949 | 10/26/2026 |
| 4.0.101.13 | 83,575 | 10/21/2026 |
| 4.0.101.12 | 38,883 | 10/19/2026 |
| 4.0.101.11 | 168,885 | 10/14/2026 |
| 4.0.101.10 | 41,928 | 10/12/2026 |
| 4.0.101.9 | 53,954 | 10/8/2026 |
| 4.0.101.8 | 159,271 | 9/30/2026 |
| 4.0.101.7 | 291,744 | 9/14/2026 |
| 4.0.101.6 | 92,623 | 9/9/2026 |
| 4.0.101.5 | 73,295 | 9/4/2026 |
| 4.0.101.4 | 264,829 | 8/24/2026 |
| 4.0.101.3 | 89,751 | 8/20/2026 |