Claude Platform Docs
MessagesClaude on cloud platforms

Claude on Amazon Bedrock (bedrock-runtime)

Use Claude models on Amazon Bedrock’s bedrock-runtime endpoint, through the InvokeModel and Converse APIs.

Calling Claude through Bedrock slightly differs from how you would call Claude on the Claude API directly. This guide walks you through completing an API call to Claude on Bedrock using one of Anthropic’s client SDKs.

Note that this guide assumes you have already signed up for an AWS account and configured programmatic access.

Install and configure the AWS CLI

  1. Install a version of the AWS CLI at or newer than version 2.13.23.
  2. Configure your AWS credentials using the AWS configure command (see Configure the AWS CLI) or find your credentials by navigating to Command line or programmatic access within your AWS dashboard and following the directions in the modal window.
  3. Verify that your credentials are working:
AWS CLI
aws sts get-caller-identity

Install an SDK for accessing Bedrock

Anthropic’s client SDKs support Bedrock. You can also use an AWS SDK such as boto3 directly.

pip install -U "anthropic[bedrock]<2"

Accessing Bedrock

Subscribe to Anthropic models

Go to the AWS Console > Bedrock > Model Access and request access to Anthropic models. Note that Anthropic model availability varies by region. See the AWS documentation on model availability by region for the latest information.

API model IDs

To call a model, pass its inference profile ID: a prefix, a period, and the base model ID. For example, global.anthropic.claude-opus-5-5⁠ calls Claude Opus 5.5. The prefix sets where AWS routes the request through cross-region inference (CRIS). To learn how the prefixes affect routing and pricing, see Global versus regional endpoints.

The following table gives each model’s base ID and the prefixes it takes:

ModelBase Bedrock model IDglobaluseujpau
Claude Fable 5.2anthropic.claude-fable-5-2YesYesNoNoNo
Claude Mythos 5.2 (limited availability)anthropic.claude-mythos-5-2YesYesNoNoNo
Claude Fable 5.1anthropic.claude-fable-5-1YesYesNoNoNo
Claude Mythos 5.1 (limited availability)anthropic.claude-mythos-5-1YesYesNoNoNo
Claude Fable 5anthropic.claude-fable-5YesYesNoNoNo
Claude Opus 5.5anthropic.claude-opus-5-5YesYesYesYesYes
Claude Opus 5anthropic.claude-opus-5YesYesYesNoYes
Claude Opus 4.8anthropic.claude-opus-4-8YesYesYesYesYes
Claude Opus 4.7anthropic.claude-opus-4-7YesYesYesYesYes
Claude Opus 4.6anthropic.claude-opus-4-6-v1YesYesYesNoYes
Claude Opus 4.5 (deprecated)anthropic.claude-opus-4-5-20251101-v1:0YesYesYesNoNo
Claude Opus 4.1 (deprecated)anthropic.claude-opus-4-1-20250805-v1:0NoYesNoNoNo
Claude Sonnet 5.5anthropic.claude-sonnet-5-5YesYesYesNoYes
Claude Sonnet 5anthropic.claude-sonnet-5YesYesYesNoYes
Claude Sonnet 4.6anthropic.claude-sonnet-4-6YesYesYesYesYes
Claude Sonnet 4.5 (deprecated)anthropic.claude-sonnet-4-5-20250929-v1:0YesYesYesYesYes
Claude Haiku 5.5anthropic.claude-haiku-5-5YesYesYesYesYes
Claude Haiku 4.5anthropic.claude-haiku-4-5-20251001-v1:0YesYesYesYesYes

The Claude Mythos models in the table are available only to organizations verified through Anthropic’s verification programs, such as the Cyber Verification Program.

In most AWS regions, a request that passes the base model ID with no prefix fails with an HTTP 400 error such as this one:

Invocation of model ID anthropic.claude-opus-5 with on-demand throughput isn’t supported. Retry your request with the ID or ARN of an inference profile that contains this model.

In place of the inference profile ID, you can pass its full ARN: arn:aws:bedrock:{region}:{account-id}:inference-profile/{inference-profile-id}.

AWS’s Anthropic model cards list inference profile IDs and the regions where each one works. A card can also show regions where the base model ID works on its own. AWS adds prefixes over a model’s life, so a card and the table can differ.

Model deprecations defines the lifecycle terms (Deprecated, Retired). On partner-operated platforms, the partner sets lifecycle dates, which can differ from the Claude API schedule. For the current retirement date of any model on Amazon Bedrock, see Amazon Bedrock’s model lifecycle page.

List available models

To print the inference profile IDs that you can call from a region, run aws bedrock list-inference-profiles --region us-west-2. Replace us-west-2 with your region.

The following examples print the base model IDs of all the Claude models available through Bedrock:

import boto3

bedrock = boto3.client(service_name="bedrock")
response = bedrock.list_foundation_models(byProvider="anthropic")

for summary in response["modelSummaries"]:
    print(summary["modelId"])

Making requests

The following examples show how to generate text from Claude on Bedrock:

from anthropic import AnthropicBedrock

client = AnthropicBedrock(
    # Authenticate by either providing the following keys or using the default AWS credential providers, such as
    # using ~/.aws/credentials or the "AWS_SECRET_ACCESS_KEY" and "AWS_ACCESS_KEY_ID" environment variables.
    aws_access_key="<access key>",
    aws_secret_key="<secret key>",
    # Temporary credentials can be used with aws_session_token.
    # Read more at https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp.html.
    aws_session_token="<session_token>",
    # aws_region changes the AWS region to which the request is made. If it is not provided, the SDK reads
    # AWS_REGION / AWS_DEFAULT_REGION, then the region configured for your boto3 session or AWS profile
    # (including ~/.aws/config), and raises ValueError if no region can be resolved.
    aws_region="us-west-2",
)

message = client.messages.create(
    model="global.anthropic.claude-opus-4-6-v1",
    max_tokens=256,
    messages=[{"role": "user", "content": "Hello, world"}],
)
print(message.content)

See the client SDKs for more details, and the official Bedrock documentation.

Bearer token authentication

You can authenticate with Bedrock using bearer tokens instead of AWS credentials. This is useful in corporate environments where teams need access to Bedrock without managing AWS credentials, IAM roles, or account-level permissions.

The simplest approach is to set the AWS_BEARER_TOKEN_BEDROCK environment variable, which the SDK detects automatically when resolving credentials from the environment.

To provide a token programmatically:

from anthropic import AnthropicBedrock

client = AnthropicBedrock(
    api_key="your-bearer-token",
    aws_region="us-west-2",
)

message = client.messages.create(
    model="us.anthropic.claude-opus-4-6-v1",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello!"}],
)
print(message.content)

Activity logging

Bedrock provides an invocation logging service that allows you to log the prompts and completions associated with your usage.

Anthropic recommends that you log your activity on at least a 30-day rolling basis to understand your activity and investigate any potential misuse.

Feature support

For the full feature list with Amazon Bedrock availability, see Features overview.

Supported feature highlights

Features not supported

Computer use and browser use toolsets on Bedrock

The computer use and browser use toolsets are available through the InvokeModel API on select models. Both toolsets work on the same models. For the list, see the entry for Amazon Bedrock (bedrock-runtime) in Availability of the browser use tool.

To use one, add an entry of type computer_toolset_20260801 or browser_toolset_20260801 to the tools array. No beta header is required for either toolset.

PDF support on Bedrock

PDF support is available on Bedrock through both the Converse API and the InvokeModel API.

Mid-conversation system messages on Bedrock

Mid-conversation system messages are available through the InvokeModel API on select models. For the list, see the entry for Amazon Bedrock (bedrock-runtime) in Availability of mid-conversation system messages. This feature is not available on Claude Sonnet 5. Use the top-level system field instead.

A role: "system" message can also set output_config.effort to change effort mid-conversation on Claude Fable 5.2, Claude Mythos 5.2, Claude Fable 5.1, and Claude Opus 5.5. This is in beta: add mid-conversation-output-config-2026-07-01 to the anthropic_beta array in the request body. Without that beta, or on Claude Fable 5, Claude Opus 5, or Claude Opus 4.8, the request returns a 400 error: messages.N.output_config: Extra inputs are not permitted. In the error, N is the index of the system message in messages.

For Converse API users: the Converse API accepts system instructions through its top-level system parameter. To add system instructions mid-conversation, use the InvokeModel API.

Context window

On bedrock-runtime, Claude 4.6 and later models have a 1M-token context window. Claude Opus 4.5, Claude Opus 4.1, Claude Sonnet 4.5, and Claude Haiku 4.5 have a 200k-token context window.

Bedrock limits request payloads to 20 MB. When sending large documents or many images, you might reach this limit before the token limit.

Global versus regional endpoints

Bedrock offers two endpoint types:

  • Global endpoints: Dynamic routing for maximum availability
  • Regional endpoints: Guaranteed data routing through specific geographic regions

The table in API model IDs shows which endpoint types each model offers. The global prefix is the global endpoint. The other prefixes are regional endpoints, each named for its geography, such as au for Australia and jp for Japan.

When to use each option

Global endpoints (recommended):

  • Provide maximum availability and uptime
  • Dynamically route requests to regions with available capacity
  • Carry no pricing premium
  • Work best for applications where data residency is flexible

Regional endpoints (CRIS):

  • Route traffic through specific geographic regions
  • Are required for data residency and compliance requirements
  • Carry a 10 percent pricing premium over global endpoints on Claude 4.5 and later models outside AWS GovCloud

Implementation

Using global endpoints:

To use global endpoints, add the global. prefix to the base model ID:

from anthropic import AnthropicBedrock

client = AnthropicBedrock(aws_region="us-west-2")

message = client.messages.create(
    model="global.anthropic.claude-opus-4-6-v1",
    max_tokens=256,
    messages=[{"role": "user", "content": "Hello, world"}],
)

Using regional endpoints (CRIS):

To use regional endpoints, replace the global. prefix with a regional prefix such as us.. Send the request to an AWS region that the prefix covers, such as us-west-2 for us. or ap-southeast-2 for au.:

from anthropic import AnthropicBedrock

client = AnthropicBedrock(aws_region="us-west-2")

# Using US regional endpoint (CRIS)
message = client.messages.create(
    model="us.anthropic.claude-opus-4-6-v1",  # Regional prefix
    max_tokens=256,
    messages=[{"role": "user", "content": "Hello, world"}],
)

Additional resources

Was this page helpful?