hermes - 💡(How to fix) Fix [BUG] Bedrock: Fix 'Invalid API Key format' for presigned URL tokens

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Root Cause

The Bedrock adapter relied on the boto3 SDK, which expects standard IAM credentials or bearer tokens. When provided with a presigned URL, boto3 passed the entire URL as the API key string, which is unsupported by the Bedrock runtime API.

Fix Action

Solution

Implemented a direct HTTP transport in agent/bedrock_adapter.py using httpx.

RAW_BUFFERClick to expand / collapse

Problem

AWS Bedrock integration failed with 'AccessDeniedException: Invalid API Key format: Must start with pre-defined prefix' when using presigned URL tokens.

RCA

The Bedrock adapter relied on the boto3 SDK, which expects standard IAM credentials or bearer tokens. When provided with a presigned URL, boto3 passed the entire URL as the API key string, which is unsupported by the Bedrock runtime API.

Solution

Implemented a direct HTTP transport in agent/bedrock_adapter.py using httpx.

Verification

  • Verified via test_bedrock_patch_v2.py.
  • Confirmed HTTP 200 OK response from bedrock-runtime.ap-southeast-1.amazonaws.com.
  • Verified successful normalization of response into OpenAI-compatible format.

Fix Verified & Closed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING