From 1453b4b1fc9729eb4bfcec6cb60b3fb7757ebe8c Mon Sep 17 00:00:00 2001 From: Yevhenii Shcherbina Date: Thu, 16 Jul 2026 14:58:09 -0400 Subject: [PATCH] docs: document Bedrock mantle protocol (#27296) Implements: https://linear.app/codercom/issue/AIGOV-518/add-docs-for-bedrock-mantle Follow-up to: https://github.com/coder/coder/pull/26745 --- docs/ai-coder/ai-gateway/providers.md | 40 +++++++++++++++++-- .../ProvidersPage/components/ProviderForm.tsx | 4 +- 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/docs/ai-coder/ai-gateway/providers.md b/docs/ai-coder/ai-gateway/providers.md index 4f9567342e..01ace45824 100644 --- a/docs/ai-coder/ai-gateway/providers.md +++ b/docs/ai-coder/ai-gateway/providers.md @@ -86,10 +86,42 @@ to have restricted permissions at the time of writing (June 2026). Bedrock providers serve Anthropic models hosted on AWS and authenticate with AWS credentials rather than a registered API key. Configure: -- A **region** (or a full base URL when routing through a proxy or a - non-standard endpoint that does not follow the - `https://bedrock-runtime..amazonaws.com` format). -- The **model** and **small fast model** identifiers. +- A **protocol**, either `InvokeModel` or `Mantle`. It determines the + endpoint format and which of the fields below apply. See + [InvokeModel](#invokemodel) and [Mantle](#mantle). +- An **endpoint** in the format the protocol requires: + `https://bedrock-runtime..amazonaws.com` for InvokeModel or + `https://bedrock-mantle..api.aws/anthropic` for Mantle. The AWS + region is read from the endpoint host. +- The **model** and **small fast model** identifiers, for InvokeModel + only. Mantle providers do not set them; the client chooses the model on + each request and AI Gateway forwards it upstream. + +#### InvokeModel + +The legacy Bedrock runtime API. AI Gateway translates each request into +Bedrock's InvokeModel format and sends it to +`https://bedrock-runtime..amazonaws.com`. Still supported, but +Mantle is recommended for new deployments. + +#### Mantle + +The newer Anthropic-compatible Bedrock endpoint, recommended by AWS for new +deployments. AI Gateway serves Anthropic models through the native Messages +API, forwarding the request body **unchanged** and only applying AWS SigV4 +signing with the provider's base identity. + +To route Claude Code through a Mantle provider, run it in mantle mode with +client-side signing disabled so the gateway signs centrally: + +```sh +export CLAUDE_CODE_USE_MANTLE=1 +export CLAUDE_CODE_SKIP_MANTLE_AUTH=1 +export ANTHROPIC_BEDROCK_MANTLE_BASE_URL="/api/v2/ai-gateway/" +export ANTHROPIC_AUTH_TOKEN="" +``` + +#### AWS credentials Do not attach API keys to a Bedrock provider. diff --git a/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderForm.tsx b/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderForm.tsx index 27008a4958..982237df9b 100644 --- a/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderForm.tsx +++ b/site/src/pages/AISettingsPage/ProvidersPage/components/ProviderForm.tsx @@ -573,9 +573,7 @@ export const ProviderForm: FC = ({ - - InvokeModel (default) - + InvokeModel Mantle