#!/usr/bin/env bash # STATUS: UNVERIFIED — no cloud credentials in this atlas; snippet follows official docs verbatim-ish # Source: https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock (retrieved 2026-09-18) # Requires curl >= 7.75 (--aws-sigv4) and AWS credentials in the environment. No secrets in this file. set -eo pipefail : "${AWS_ACCESS_KEY_ID:?set AWS credentials}" "${AWS_SECRET_ACCESS_KEY:?set AWS credentials}" REGION="${AWS_REGION:-us-east-1}" # Claude in Amazon Bedrock — Messages API on bedrock-mantle (SigV4 service name: bedrock-mantle). # Omit the x-amz-security-token header when using long-term IAM user credentials. curl -sS "https://bedrock-mantle.${REGION}.api.aws/anthropic/v1/messages" \ --aws-sigv4 "aws:amz:${REGION}:bedrock-mantle" \ --user "${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}" \ -H "x-amz-security-token: ${AWS_SESSION_TOKEN:-}" \ -H "content-type: application/json" \ -H "anthropic-version: 2023-06-01" \ -d '{ "model": "anthropic.claude-haiku-4-5", "max_tokens": 8, "messages": [{"role": "user", "content": "Reply with OK."}] }' echo # Legacy InvokeModel integration (AWS CLI handles SigV4; model in the URL, anthropic_version in the body): # aws bedrock-runtime invoke-model --region us-west-2 \ # --model-id us.anthropic.claude-haiku-4-5-20251001-v1:0 \ # --body '{"anthropic_version":"bedrock-2023-05-31","max_tokens":8,"messages":[{"role":"user","content":"Reply with OK."}]}' \ # --cli-binary-format raw-in-base64-out /dev/stdout # Bearer-token alternative (short-term token from aws-bedrock-token-generator): -H "x-api-key: $TOKEN" instead of --aws-sigv4.