Skip to content

Claude on AWS Bedrock

HumanLayer sessions can run Claude through Amazon Bedrock instead of the Anthropic API.

Configuration is entirely environment-variable based and inherits your Claude Code settings.

The standard Claude Code Bedrock setup applies unchanged.

Configure environment variables

This guide assumes you are already comfortable using Bedrock - see below for prerequisites.

Set the Bedrock variables in the env block of ~/.claude/settings.json.

json
{
  "env": {
    "CLAUDE_CODE_USE_BEDROCK": "1",
    "AWS_REGION": "us-east-1",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "us.anthropic.claude-opus-4-8",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "us.anthropic.claude-sonnet-4-6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "us.anthropic.claude-haiku-4-5-20251001-v1:0"
  }
}

A repo-level .claude/settings.json env block also works if you want Bedrock for a single project only.

This is the minimal set. For everything else — AWS_PROFILE, AWS_BEARER_TOKEN_BEDROCK, SSO credential auto-refresh, LLM gateways, service tiers, prompt caching — see Anthropic's Bedrock docs and the environment variables reference.

Optional shortcut: run claude in a terminal and pick the third-party platform option at login (or run /setup-bedrock in an existing Claude Code session). The wizard detects your credentials, verifies model availability, and writes this same env block to ~/.claude/settings.json, so HumanLayer sessions pick it up automatically.

text
% claude

> /setup-bedrock

Alternative: shell environment

Exporting the same variables in your shell rc file (for example ~/.zshrc) also works. A daemon started with humanlayer daemon launch inherits the invoking shell's environment. The HumanLayer desktop app instead captures your login-shell environment once at startup, so after changing shell exports you must fully quit and restart the app before they reach sessions.

bash
export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-east-1
open /Applications/HumanLayer.app

Note: the shell environment will only be loaded into your HumanLayer desktop app sessions if the app is launched from the shell with open - launching from spotlight / finder / raycast won't work for the shell approach.

Choosing Models

Bedrock serves Claude under different identifiers than the Anthropic API: cross-region inference profile IDs such as us.anthropic.claude-opus-4-8 (us-gov. in GovCloud). HumanLayer passes your model picker choice to the session as a plain string, so on Bedrock:

  • Select only the OPUS, SONNET, or HAIKU alias entries in the HumanLayer model picker. Versioned entries (OPUS 4.8, SONNET 4.6, HAIKU 4.5, and so on) are sent to Bedrock verbatim and fail with The provided model identifier is invalid.
  • Pin what the aliases mean using the ANTHROPIC_DEFAULT_*_MODEL variables, as in the snippet above. Unpinned aliases resolve to Claude Code's built-in defaults, which lag the newest release and may not be enabled in your account — pinning is required, not just recommended.
  • The ANTHROPIC_DEFAULT_HAIKU_MODEL pin matters even if you never select HAIKU: without it, sessions on Bedrock use the primary model for background tasks instead of Haiku.

Append [1m] to a pinned ID to enable the 1M-token context window. Application inference profile ARNs are accepted anywhere an ID is. Newer versions work the same way — for example ANTHROPIC_DEFAULT_SONNET_MODEL can be pinned to us.anthropic.claude-sonnet-5 where the account has access. Which model versions your account can invoke varies by account and region; see Anthropic's model configuration docs for pinning details and current IDs.

If your organization standardizes on versioned model IDs or per-version application inference profiles, Claude Code's modelOverrides settings key maps Anthropic-style versioned IDs to inference profile ARNs so versioned picker entries resolve correctly — see Anthropic's Bedrock docs for the format and version requirements.

Fable 5 is not yet tested but is intended to work similarly - if you have problems with Fable 5 on Bedrock, please let us know

Verify

Start a new HumanLayer session — settings changes only apply to sessions started after the change — and run /status inside it. The output shows the resolved provider, region, and model; confirm it reports Bedrock and your pinned model ID. Sessions on Bedrock run without an ANTHROPIC_API_KEY in your environment.

Prerequisites

  • An AWS account with Amazon Bedrock available in your target region.
  • Access granted to the Anthropic Claude models in the Bedrock console model catalog. Granting access includes a one-time use-case details form per AWS account.
  • IAM permissions to invoke the models: bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream, bedrock:ListInferenceProfiles, bedrock:GetInferenceProfile.
  • AWS credentials available on the machine that runs your sessions: aws configure, aws sso login, or the standard AWS_* variables. See Anthropic's Bedrock docs for the full IAM policy and auth options.

Limitations & troubleshooting

  • If sessions still hit the Anthropic API, confirm CLAUDE_CODE_USE_BEDROCK is "1" in ~/.claude/settings.json and start a new session.
  • If a versioned model from the model picker errors with The provided model identifier is invalid, that ID does not exist on Bedrock — select OPUS, SONNET, or HAIKU in the picker and pin via settings.json#env instead.
  • If Bedrock returns an error that on-demand throughput isn't supported, you used a base model ID — use the us.-prefixed cross-region inference profile IDs.
  • If a pinned model errors as not available on your Bedrock deployment, your account lacks invocation access to that version in that region. A model appearing in the Bedrock catalog does not mean you can invoke it — grant model access in the Bedrock console and confirm AWS_REGION.
  • The WebSearch tool is not available on Bedrock.
  • If shell exports are not reaching sessions from the desktop app, fully quit and restart the app with open /Applications/HumanLayer.app. The ~/.claude/settings.json channel avoids this entirely.