Amazon Bedrock Models in OpenClaw: Setup and Auth

Learn how to use Amazon Bedrock models with OpenClaw through the Bedrock Converse streaming provider. Covers AWS credential setup, provider config, and model verification.

Read this when

  • You want to use Amazon Bedrock models with OpenClaw
  • You need AWS credential/region setup for model calls

OpenClaw supports Amazon Bedrock models through its Bedrock Converse streaming provider. Authentication to Bedrock relies on the AWS SDK default credential chain rather than an API key.

PropertyValue
Provideramazon-bedrock
APIbedrock-converse-stream
AuthAWS credentials (env vars, shared config, or instance role)
RegionAWS_REGION or AWS_DEFAULT_REGION (default: us-east-1)

Getting started

Pick whichever auth method suits you and work through the matching setup steps.

Access keys / env vars

Best for: developer machines, CI, or hosts where you manage AWS credentials directly.

Set AWS credentials on the gateway host

export AWS_ACCESS_KEY_ID="EXAMPLE_AWS_ACCESS_KEY_ID"
export AWS_SECRET_ACCESS_KEY="..."
export AWS_REGION="us-east-1"
# Optional:
export AWS_SESSION_TOKEN="..."
export AWS_PROFILE="your-profile"
# Optional (Bedrock API key/bearer token):
export AWS_BEARER_TOKEN_BEDROCK="..."

Add a Bedrock provider and model to your config

You do not need an apiKey. Point the provider at auth: "aws-sdk" instead:

{
  models: {
    providers: {
      "amazon-bedrock": {
        baseUrl: "https://bedrock-runtime.us-east-1.amazonaws.com",
        api: "bedrock-converse-stream",
        auth: "aws-sdk",
        models: [
          {
            id: "us.anthropic.claude-opus-4-6-v1",
            name: "Claude Opus 4.6 (Bedrock)",
            reasoning: true,
            input: ["text", "image"],
            cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
            contextWindow: 200000,
            maxTokens: 8192,
          },
        ],
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "amazon-bedrock/us.anthropic.claude-opus-4-6-v1" },
    },
  },
}

Verify models are available

openclaw models list

Tip

When env-marker auth is in play (AWS_ACCESS_KEY_ID, AWS_PROFILE, or AWS_BEARER_TOKEN_BEDROCK), OpenClaw turns on the implicit Bedrock provider by itself so models can be discovered, with no extra configuration needed.

EC2 instance roles (IMDS)

Best for: EC2 instances that carry an IAM role, authenticating through the instance metadata service.

Enable discovery explicitly

Because IMDS-based AWS auth is invisible to env markers alone, OpenClaw needs an explicit opt-in:

openclaw config set plugins.entries.amazon-bedrock.config.discovery.enabled true
openclaw config set plugins.entries.amazon-bedrock.config.discovery.region us-east-1

Optionally add an env marker for auto mode

Should you also want the env-marker auto-detection route to function (for instance, on openclaw status surfaces):

export AWS_PROFILE=default
export AWS_REGION=us-east-1

A fake API key is not needed.

Verify models are discovered

openclaw models list

Warning

The IAM role attached to your EC2 instance must carry these permissions:

  • bedrock:InvokeModel
  • bedrock:InvokeModelWithResponseStream
  • bedrock:ListFoundationModels (for automatic discovery)
  • bedrock:ListInferenceProfiles (for inference profile discovery)

Alternatively, attach the managed policy AmazonBedrockFullAccess.

Note

AWS_PROFILE=default is only necessary when you specifically want an env marker for auto mode or status surfaces. Runtime Bedrock auth actually goes through the AWS SDK default chain, so IMDS instance-role auth functions even with no env markers present.

Automatic model discovery

Models on Bedrock that offer streaming and text output can be found by OpenClaw automatically. The discovery process calls bedrock:ListFoundationModels and bedrock:ListInferenceProfiles, and it caches results (default: 1 hour).

Both lists must succeed, inference-profile pages included, before OpenClaw writes the cache. When a refresh fails, OpenClaw reports that catalog access is unavailable or rejected and keeps the compatible last-good models. Bring both list operations back online and refresh once more. A successful but empty list wipes the discovered membership.

At startup, if no compatible previous catalog exists, a failed inference-profile list also blocks foundation-only inventory. Either grant both list permissions or supply an explicit models.providers["amazon-bedrock"].models list.

Programmatic callers that use the plugin's public discovery helpers retain the advisory defaults from v2026.9.2. To propagate acquisition failures while keeping successful empty provider results, pass discoveryMode: "strict", which is what the bundled catalog hooks do. Advisory partial results never get cached as complete inventory.

How the implicit provider gets enabled:

  • When plugins.entries.amazon-bedrock.config.discovery.enabled equals true, OpenClaw attempts discovery even with no AWS env marker present.
  • When plugins.entries.amazon-bedrock.config.discovery.enabled is unset, OpenClaw auto-adds the implicit Bedrock provider only upon seeing one of these AWS auth markers: AWS_BEARER_TOKEN_BEDROCK, AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY, or AWS_PROFILE.
  • Runtime Bedrock auth still goes through the AWS SDK default chain, so shared config, SSO, and IMDS instance-role auth can all work even when discovery required enabled: true as an opt-in.

Note

For explicit models.providers["amazon-bedrock"] entries, OpenClaw can still resolve Bedrock env-marker auth early from AWS env markers like AWS_BEARER_TOKEN_BEDROCK, without forcing a full runtime auth load. The model-call auth path itself still goes through the AWS SDK default chain.

Discovery config options

Configuration options sit under plugins.entries.amazon-bedrock.config.discovery:

{
  plugins: {
    entries: {
      "amazon-bedrock": {
        config: {
          discovery: {
            enabled: true,
            region: "us-east-1",
            providerFilter: ["anthropic", "amazon"],
            refreshInterval: 3600,
            defaultContextWindow: 32000,
            defaultMaxTokens: 4096,
          },
        },
      },
    },
  },
}
OptionDefaultDescription
enabledautoWith auto, OpenClaw turns on the implicit Bedrock provider only when a supported AWS env marker is present. To force discovery, set true.
regionAWS_REGION / AWS_DEFAULT_REGION / us-east-1The AWS region that discovery API calls target.
providerFilter(all)Filters which Bedrock provider names match (such as anthropic, amazon).
refreshInterval3600How long, in seconds, cached results are kept. Use 0 to turn caching off.
defaultContextWindow32000The context window applied to discovered models whose token limits are unknown (override this if you know your model's limits).
defaultMaxTokens4096The max output tokens applied to discovered models whose token limits are unknown (override this if you know your model's limits).

Context window and max-token limits

Neither the Bedrock ListFoundationModels nor the GetFoundationModel API reports token-limit metadata. All they return is the model ID, name, modalities, and lifecycle status. To make session management, compaction thresholds, and context-overflow detection behave correctly, OpenClaw includes a lookup table holding known context windows and output limits for widely used Bedrock models (Claude, Nova, Llama, Mistral, DeepSeek, and more).

Any discovered model absent from that table defaults to defaultContextWindow and defaultMaxTokens. Should a model you rely on have inaccurate limits, supply an explicit models.providers["amazon-bedrock"].models entry to override them.

Quick setup (AWS path)

Following these steps creates an IAM role, grants Bedrock permissions, attaches the instance profile, and switches on OpenClaw discovery on the EC2 host.

# 1. Create IAM role and instance profile
aws iam create-role --role-name EC2-Bedrock-Access \
  --assume-role-policy-document '{
    "Version": "2012-10-17",
    "Statement": [{
      "Effect": "Allow",
      "Principal": {"Service": "ec2.amazonaws.com"},
      "Action": "sts:AssumeRole"
    }]
  }'

aws iam attach-role-policy --role-name EC2-Bedrock-Access \
  --policy-arn arn:aws:iam::aws:policy/AmazonBedrockFullAccess

aws iam create-instance-profile --instance-profile-name EC2-Bedrock-Access
aws iam add-role-to-instance-profile \
  --instance-profile-name EC2-Bedrock-Access \
  --role-name EC2-Bedrock-Access

# 2. Attach to your EC2 instance
aws ec2 associate-iam-instance-profile \
  --instance-id i-xxxxx \
  --iam-instance-profile Name=EC2-Bedrock-Access

# 3. On the EC2 instance, enable discovery explicitly
openclaw config set plugins.entries.amazon-bedrock.config.discovery.enabled true
openclaw config set plugins.entries.amazon-bedrock.config.discovery.region us-east-1

# 4. Optional: add an env marker if you want auto mode without explicit enable
echo 'export AWS_PROFILE=default' >> ~/.bashrc
echo 'export AWS_REGION=us-east-1' >> ~/.bashrc
source ~/.bashrc

# 5. Verify models are discovered
openclaw models list

Advanced configuration

Inference profiles

Along with foundation models, OpenClaw discovers regional and global inference profiles. Where a profile points at a known foundation model, it takes on that model's capabilities (context window, max tokens, reasoning, vision), and the right Bedrock request region gets injected for you. Cross-region Claude profiles therefore work with no manual provider overrides. Because they usually deliver more capacity and automatic failover, global cross-region profiles (global.*) are listed first in openclaw models list.

An inference profile ID takes the form us.anthropic.claude-opus-4-6-v1 (regional) or anthropic.claude-opus-4-6-v1 (global). When the backing model already appears in the discovery results, the profile picks up its complete capability set; if not, safe defaults are used instead.

Nothing extra needs configuring. Provided discovery is enabled and the IAM principal holds bedrock:ListInferenceProfiles, profiles show up next to foundation models in openclaw models list.

Service tier

A service_tier parameter is available on some Bedrock models to tune for cost or latency. These tiers exist:

TierDescription
defaultStandard Bedrock tier
flexDiscounted processing for workloads that can tolerate longer latency
priorityPrioritized processing for latency-sensitive workloads
reservedReserved capacity for steady-state workloads

Pass serviceTier (or service_tier) through agents.defaults.params for Bedrock model requests, or set it per-model in agents.defaults.models["<model-key>"].params:

{
  agents: {
    defaults: {
      params: {
        serviceTier: "flex", // applies to all models
      },
      models: {
        "amazon-bedrock/mistral.mistral-large-3-675b-instruct": {
          params: {
            serviceTier: "priority", // per-model override
          },
        },
      },
    },
  },
}

Acceptable values are default, flex, priority, and reserved. For Claude Fable 5, Opus 5, and Sonnet 5, the default tier is the only one supported; if you request flex, priority, or reserved for those models, OpenClaw issues a warning and ignores it. With other models, support varies by tier -- asking for a tier the model lacks produces a Bedrock validation error, and that message may point you in the wrong direction (it could say "The provided model identifier is invalid" instead of identifying the tier). When this error appears, verify whether the model actually supports the tier you asked for.

Claude Opus 5, 4.8, and 4.7 temperature

Bedrock will not accept the temperature parameter on Claude Opus 5, Opus 4.8, or Opus 4.7. Whenever a Bedrock ref matches one of those models, OpenClaw drops temperature on its own. That covers foundation model ids, named inference profiles, application inference profiles whose underlying model resolves to Opus 5/4.8/4.7 through bedrock:GetInferenceProfile, plus dotted opus-4.7/opus-4.8 variants carrying optional region prefixes (us., eu., ap., apac., au., jp., global.). You do not need to set any config knob, and the removal happens both in the request options object and in the inferenceConfig payload field.

Claude Opus 5

Point at amazon-bedrock/anthropic.claude-opus-5 on the Messages-API Bedrock endpoint, or use a regional or global inference profile like global.anthropic.claude-opus-5 when Bedrock discovery surfaces it. From OpenClaw you get the 1,000,000-token context window, a 128,000-token output limit, image input, prompt caching, refusal-safe streaming, and native xhigh/max effort levels.

Adaptive thinking starts at high. Setting /think off turns thinking off, whereas /think xhigh|max leaves adaptive thinking on. OpenClaw strips out custom sampling parameters and any unsupported non-default service tiers.

Claude Fable 5

Reach for amazon-bedrock/anthropic.claude-fable-5 inside us-east-1, or use regional inference ids such as us.anthropic.claude-fable-5. OpenClaw gives you Fable's 1M context window, a 128K output limit, always-on adaptive thinking, and effort mapping where supported. Fable 5 and 5.1 begin at medium effort, and any explicit effort setting wins over that default. /think off and /think minimal resolve to low, while temperature and forced tool choice controls get dropped, just as on the Opus 4.7/4.8 route. Output is buffered until Bedrock reports a terminal status, so a refusal mid-stream never leaks partial text.

Before Fable becomes usable, AWS demands an explicit provider_data_share data-retention opt-in. Anthropic receives your prompts and completions, which are kept for as long as 30 days for trust and safety purposes. Check and set up Bedrock data retention prior to turning the model on.

Claude Mythos 5

Only accounts holding the necessary limited-access approval can get Claude Mythos 5 through Bedrock. OpenClaw knows the foundation model anthropic.claude-mythos-5 along with regional or global inference profiles such as us.anthropic.claude-mythos-5.

The 1,000,000-token context window, 128,000-token output limit, image input, prompt caching, refusal-safe streaming, and native effort levels all apply under OpenClaw. Thinking is adaptive and permanently on: /think off and /think minimal map to low, and xhigh and max stay selectable too. Values for custom sampling and forced tool choice are discarded.

Claude Sonnet 5

AWS covers Sonnet 5 for both the bedrock-runtime and bedrock-mantle endpoints. OpenClaw knows the Bedrock foundation model anthropic.claude-sonnet-5 plus regional or global inference profiles such as us.anthropic.claude-sonnet-5. It brings the 1,000,000-token context window, 128,000-token output limit, image input, native effort levels, prompt caching, and refusal-safe streaming.

On Sonnet 5, Bedrock leaves adaptive thinking on at all times. OpenClaw's default is high; since this route offers no way to switch thinking off, /think off and /think minimal both map to low. While adaptive thinking is running, custom temperature and forced tool choice values are dropped.

Guardrails

Adding a guardrail object to the amazon-bedrock plugin config lets you apply Amazon Bedrock Guardrails across every Bedrock model invocation. With Guardrails you can enforce content filtering, topic denial, word filters, sensitive information filters, and contextual grounding checks.

{
  plugins: {
    entries: {
      "amazon-bedrock": {
        config: {
          guardrail: {
            guardrailIdentifier: "abc123", // guardrail ID or full ARN
            guardrailVersion: "1", // version number or "DRAFT"
            streamProcessingMode: "sync", // optional: "sync" or "async"
            trace: "enabled", // optional: "enabled", "disabled", or "enabled_full"
          },
        },
      },
    },
  },
}

Both guardrailIdentifier and guardrailVersion must be supplied.

OptionDescription
guardrailIdentifierEither a guardrail ID (for example abc123) or its complete ARN (for example arn:aws:bedrock:us-east-1:123456789012:guardrail/abc123).
guardrailVersionA published version number, or "DRAFT" to target the working draft.
streamProcessingModeUse "sync" or "async" to evaluate guardrails while streaming. When left out, Bedrock falls back to its default.
traceSet to "enabled" or "enabled_full" when debugging; leave it out, or use "disabled", in production.

Warning

Beyond the usual invoke permissions, the IAM principal the gateway runs as also needs the bedrock:ApplyGuardrail permission.

Bedrock is also usable as the embedding provider behind memory search. You configure it independently of the inference provider by setting memory.search.provider to "bedrock":

{
  memory: {
    search: {
      provider: "bedrock",
      model: "amazon.titan-embed-text-v2:0", // default
    },
  },
}

For embeddings, Bedrock draws on the same AWS SDK credential chain that inference uses (instance roles, SSO, access keys, shared config, and web identity). An API key is not required.

Models available for embedding include Amazon Titan Embed (v1, v2), Amazon Nova Embed, Cohere Embed (v3, v4), and TwelveLabs Marengo. The complete model list and dimension choices live in Memory configuration reference -- Bedrock.

Notes and caveats

  • Your AWS account/region must have model access turned on before Bedrock works.
  • Automatic discovery requires the bedrock:ListFoundationModels and bedrock:ListInferenceProfiles permissions.
  • When auto mode is what you depend on, put one of the supported AWS auth env markers on the gateway host. Should you want IMDS/shared-config auth with no env markers instead, set plugins.entries.amazon-bedrock.config.discovery.enabled: true.
  • OpenClaw reports the credential source in the following order: AWS_BEARER_TOKEN_BEDROCK, then AWS_ACCESS_KEY_ID + AWS_SECRET_ACCESS_KEY, then AWS_PROFILE, then the default AWS SDK chain.
  • Whether reasoning is available varies by model; consult the Bedrock model card for current capabilities.
  • A managed key flow is another option: put an OpenAI-compatible proxy in front of Bedrock and set it up as an OpenAI provider instead.
2,511 words · updated Sep 18, 2026