From 5a889ef58bccb3f9ce4d75db06e0ba223cbc4822 Mon Sep 17 00:00:00 2001 From: wirjo Date: Sun, 19 Apr 2026 16:47:10 +1000 Subject: [PATCH] fix(amazon-bedrock): pass model.baseUrl as endpoint to BedrockRuntimeClient (#3402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit BedrockRuntimeClient was constructed without the endpoint option, causing model.baseUrl to be silently ignored. This meant custom Bedrock endpoints (VPC endpoints, proxy setups, custom routing) were never used — requests always went to the default regional endpoint. Pass model.baseUrl as the endpoint config when set. When not set (the default), the SDK falls back to the standard regional endpoint constructed from the region config, preserving existing behavior. Fixes openclaw/openclaw#47899 --- packages/ai/src/providers/amazon-bedrock.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/ai/src/providers/amazon-bedrock.ts b/packages/ai/src/providers/amazon-bedrock.ts index 4dd36690..c6aa377e 100644 --- a/packages/ai/src/providers/amazon-bedrock.ts +++ b/packages/ai/src/providers/amazon-bedrock.ts @@ -115,6 +115,12 @@ export const streamBedrock: StreamFunction<"bedrock-converse-stream", BedrockOpt profile: options.profile, }; + // Pass custom endpoint when the model has a non-default baseUrl. + // This enables VPC endpoints, proxy setups, and custom routing. + if (model.baseUrl) { + config.endpoint = model.baseUrl; + } + // Resolve bearer token for Bedrock API key auth. const bearerToken = options.bearerToken || process.env.AWS_BEARER_TOKEN_BEDROCK || undefined; const useBearerToken = bearerToken !== undefined && process.env.AWS_BEDROCK_SKIP_AUTH !== "1";