Files
openclaw/extensions
wirjo dbac5fa258 feat(bedrock): add Bedrock Mantle (OpenAI-compatible) provider (#61296)
* feat(bedrock): add Bedrock Mantle (OpenAI-compatible) provider

New amazon-bedrock-mantle extension that provides auto-discovery and
authentication for Amazon Bedrock Mantle endpoints.

Mantle (bedrock-mantle.<region>.api.aws) is Amazon Bedrock's OpenAI-
compatible API surface, separate from the existing bedrock-runtime
(ConverseStream) endpoint. It has its own model catalog including
models not available via ConverseStream (e.g. openai.gpt-oss-120b,
mistral.devstral-2-123b).

Extension structure:
- discovery.ts: Model discovery via GET /v1/models (OpenAI format),
  bearer token resolution, implicit provider configuration
- register.sync.runtime.ts: Provider registration with catalog,
  error classification (rate limits, context overflow)
- openclaw.plugin.json: Plugin manifest, enabledByDefault

Auth support:
- Long-lived Bedrock API key (AWS_BEARER_TOKEN_BEDROCK env var)
  created from the AWS Console → used directly as Bearer token
- Pre-generated SigV4-derived tokens (via aws-bedrock-token-generator)
  set in AWS_BEARER_TOKEN_BEDROCK → works transparently

Provider config (auto-resolved when AWS_BEARER_TOKEN_BEDROCK is set):
  api: "openai-completions"
  baseUrl: "https://bedrock-mantle.<region>.api.aws/v1"
  auth: "api-key" (bearer token)

Available in 12 regions: us-east-1, us-east-2, us-west-2,
ap-northeast-1, ap-south-1, ap-southeast-3, eu-central-1,
eu-west-1, eu-west-2, eu-south-1, eu-north-1, sa-east-1

Tests: 15 passing (13 discovery + 2 plugin registration)

* chore(bedrock): clarify mantle bearer auth scope

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-04-05 12:53:54 +01:00
..
2026-04-05 11:19:05 +01:00