SPB Git forge

spb/doc-api

Public
2commits 1branches 0releases
15.7 MBsize
maindefault branch
14 days agolast push
Python 88.3% TypeScript 7.6% Shell 4.1%
1.6 KB · 30 lines shellscript
Raw Blame History
1#!/usr/bin/env bash2# STATUS: UNVERIFIED — no cloud credentials in this atlas; snippet follows official docs verbatim-ish3# Source: https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock (retrieved 2026-09-18)4# Requires curl >= 7.75 (--aws-sigv4) and AWS credentials in the environment. No secrets in this file.5set -eo pipefail6: "${AWS_ACCESS_KEY_ID:?set AWS credentials}" "${AWS_SECRET_ACCESS_KEY:?set AWS credentials}"7REGION="${AWS_REGION:-us-east-1}"89# Claude in Amazon Bedrock — Messages API on bedrock-mantle (SigV4 service name: bedrock-mantle).10# Omit the x-amz-security-token header when using long-term IAM user credentials.11curl -sS "https://bedrock-mantle.${REGION}.api.aws/anthropic/v1/messages" \12  --aws-sigv4 "aws:amz:${REGION}:bedrock-mantle" \13  --user "${AWS_ACCESS_KEY_ID}:${AWS_SECRET_ACCESS_KEY}" \14  -H "x-amz-security-token: ${AWS_SESSION_TOKEN:-}" \15  -H "content-type: application/json" \16  -H "anthropic-version: 2023-06-01" \17  -d '{18    "model": "anthropic.claude-haiku-4-5",19    "max_tokens": 8,20    "messages": [{"role": "user", "content": "Reply with OK."}]21  }'22echo2324# Legacy InvokeModel integration (AWS CLI handles SigV4; model in the URL, anthropic_version in the body):25#   aws bedrock-runtime invoke-model --region us-west-2 \26#     --model-id us.anthropic.claude-haiku-4-5-20251001-v1:0 \27#     --body '{"anthropic_version":"bedrock-2023-05-31","max_tokens":8,"messages":[{"role":"user","content":"Reply with OK."}]}' \28#     --cli-binary-format raw-in-base64-out /dev/stdout29# Bearer-token alternative (short-term token from aws-bedrock-token-generator): -H "x-api-key: $TOKEN" instead of --aws-sigv4.30