Anthropic::Bedrock::MantleClient
Inherits Anthropic::Client < Reference < Object
Anthropic Messages client that targets Amazon Bedrock Mantle.
Unlike Anthropic::Bedrock::Client (Bedrock Runtime), Mantle uses native
Anthropic paths (/v1/messages) and does not rewrite the request body.
Auth is SigV4 with service name bedrock-mantle, or a Bedrock bearer token.
client = Anthropic::Bedrock::MantleClient.new(
aws_profile: "anthropic-cr-bedrock",
aws_region: "us-east-1",
)
message = client.messages.create(
model: "claude-haiku-4-5-20251001",
max_tokens: 256,
messages: [{role: "user", content: "Hello from Mantle!"}],
)
puts message.text
Only messages and beta.messages are supported. Models, batches, files,
and other resources raise NotImplementedError.
Constants
SERVICE_NAME = "bedrock-mantle"
Constructors
new(aws_access_key : String | Nil = nil, aws_secret_key : String | Nil = nil, aws_session_token : String | Nil = nil, aws_region : String | Nil = nil, aws_profile : String | Nil = nil, api_key : String | Nil = nil, skip_auth : Bool = false, base_url : String | Nil = nil, timeout : Time::Span = 600.seconds, max_retries : Int32 = DEFAULT_MAX_RETRIES, initial_retry_delay : Float64 = DEFAULT_INITIAL_DELAY, max_retry_delay : Float64 = DEFAULT_MAX_DELAY, default_headers : Hash(String, String) = {} of String => String, middleware : Array = [] of Middleware)
Create a Bedrock Mantle client.
Auth precedence (matches official SDKs):
api_keyconstructor arg → Bearer mode- Explicit AWS credentials /
aws_profile→ SigV4 (bedrock-mantle) AWS_BEARER_TOKEN_BEDROCKorANTHROPIC_AWS_API_KEY→ Bearer mode- Default AWS credential chain → SigV4
Base URL: ANTHROPIC_BEDROCK_MANTLE_BASE_URL, else
https://bedrock-mantle.{region}.api.aws/anthropic.
Instance methods
aws_region
SourceMantle returns native SSE — stream via the standard Anthropic event path with Mantle auth (SigV4 or Bearer) applied.
skip_auth?
Sourceuse_sig_v4?
Source