AWS Builder Center

Claude Opus 4.7 on Amazon Bedrock: APIs, Features, and Migration Guide

"A practical walkthrough of every API path for Claude Opus 4.7 on Bedrock — Messages API, InvokeModel, and Converse — with code examples, feature comparison, and breaking changes to watch for when upgrading from Opus 4.6."

Claude Opus 4.7 on Amazon Bedrock: APIs, Features, and Migration Guide
TL;DR -- Claude Opus 4.7 is available on Amazon Bedrock through three API paths today (Messages API, InvokeModel, Converse) with two more coming soon (Responses API, Chat Completions). It brings major improvements in agentic coding (64.3% SWE-bench Pro, industry-leading), a 1M-token context window, 128K max output, and a behavioral shift: Opus 4.7 reasons through ambiguity instead of asking clarifying questions. Pricing is unchanged at $5/$25 per MTok. This guide covers every consumption path, when to use each, and what to watch for when upgrading. Sources: Claude in Amazon Bedrock documentation , Amazon Bedrock pricing 

Claude Opus 4.7 is Anthropic's most capable generally available model, with meaningful improvements across agentic coding, knowledge work, long-running tasks, and vision. It ships with a 1M-token input context, 128K-token max output, and a knowledge cutoff of January 2026. Pricing is $5 per million input tokens and $25 per million output tokens.
For customers already running Claude on Amazon Bedrock, upgrading is straightforward: update the model ID, review your prompts, and you are running. But Opus 4.7 arrives alongside an expanded set of API paths, each suited to different integration patterns and operational requirements. This guide walks you through every option.

What's New in Opus 4.7

Before diving into API paths, here is what changed in the model itself. These improvements apply regardless of which API path you use.

Agentic Coding

Opus 4.7 is built for agentic coding at scale. It handles the full lifecycle from architecture to deployment, excelling at long-horizon projects, complex implementations, and polished UI design.
BenchmarkOpus 4.7Opus 4.6GPT-5.4Gemini 3.1 Pro
SWE-bench Pro64.3%53.4%57.7%54.2%
SWE-bench Verified87.6%80.8%--80.6%
Terminal-Bench 2.069.4%65.4%75.1%*68.5%
* Terminal-Bench 2.0 figure for GPT-5.4 uses the "Pro" variant as reported in source benchmarks. Other GPT-5.4 figures are from the standard variant.

Knowledge Work and Ambiguity Handling

Opus 4.7 sets a new standard for enterprise knowledge work: carrying context across sessions, managing complex multi-day projects end-to-end, and delivering professional polish on documents, spreadsheets, and presentations.
Two behavioral patterns worth highlighting:
  1. More autonomous on underspecified requests. Anthropic describes Opus 4.7 as highly autonomous  and designed to push through hard problems . In practice, this means the model is more likely to make sensible assumptions and proceed with the work rather than stopping to ask clarifying questions. This is useful for enterprise workflows where you want the model to make progress independently.
  2. Self-verifies output. The model checks its own work to improve quality on the first pass, reducing the back-and-forth cycle.
Note on prompt compatibility: Because of this increased autonomy, Opus 4.7 may skip clarifying questions that Opus 4.6 would have asked. If you prefer the old behavior, add system prompt instructions like: "Always ask clarifying questions before proceeding when requirements are ambiguous."
The following script lets you observe this difference firsthand. Send the same deliberately underspecified prompt to both models and compare the responses:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from anthropic import AnthropicBedrockMantle

client = AnthropicBedrockMantle(aws_region="us-east-1")

ambiguous_prompt = "Build me a REST API for user management"

for model in ["anthropic.claude-opus-4-6-v1", "anthropic.claude-opus-4-7"]:
print(f"\n{'='*60}")
print(f"Model: {model}")
print(f"{'='*60}")
response = client.messages.create(
model=model,
max_tokens=1024,
messages=[{"role": "user", "content": ambiguous_prompt}]
)
print(response.content[0].text[:500])
What you may observe: Opus 4.6 tends to respond with clarifying questions ("What language? Which framework? What database?"). Opus 4.7 is more likely to pick reasonable defaults, state its assumptions, and deliver working code. Both are valid behaviors — the right one depends on your workflow.

Long-Running Tasks

Opus 4.7 powers production agentic workflows with industry-leading reliability. It plans deliberately and uses memory to learn across sessions. This enables long-running work with minimal oversight. Better reasoning through ambiguity and stronger memory make Opus 4.7 agents more autonomous, enabling longer unsupervised runs.

Enhanced Vision

Opus 4.7 brings high-resolution vision to frontier multimodal reasoning. Images are now processed at up to 2576px (up from 1568px on previous models), with no API changes needed. This is especially important for coordinate-based tasks like computer use and element positioning.
BenchmarkOpus 4.7Opus 4.6
CharXiv Reasoning (no tools)82.169.1
CharXiv Reasoning (with tools)91.084.7

Improved In-Session Memory

Opus 4.7 is better at tracking context, decisions, and state across long conversations and multi-turn interactions. In long agentic loops, the model is less likely to forget earlier instructions, contradict previous decisions, or lose track of state. This pairs well with compaction for customers running long-running agents.
For persistent cross-session memory on Bedrock, see Amazon Bedrock AgentCore Memory.

Key Opus 4.7 Features Explained

Three features shape how developers build with Opus 4.7. All three work across the Messages API and InvokeModel paths. Converse supports adaptive thinking but not compaction or task budgets during the beta.

Adaptive Thinking

Adaptive thinking replaces the old fixed token budget approach to extended thinking. Instead of telling Claude "here's 8,000 tokens to think with," you set thinking.type to "adaptive" and optionally guide reasoning depth with an effort parameter in output_config. Claude decides dynamically how much reasoning each query needs. Simple questions get answered directly; complex problems get deep analysis automatically.
On Opus 4.7, adaptive thinking is the only supported thinking mode. Manual thinking.type: "enabled" with budget_tokens is rejected with a 400 error. Interleaved thinking (reasoning between tool calls) is built in automatically.
Effort levelBehavior
maxClaude always thinks with no constraints on thinking depth
xhighClaude always thinks deeply with extended exploration (Opus 4.7 only)
high (default)Claude always thinks. Deep reasoning on complex tasks
mediumModerate thinking. May skip thinking for simple queries. Anthropic recommends this as the best tradeoff for Opus 4.7
lowMinimizes thinking. Skips thinking when speed matters most
Thinking display modes: Opus 4.7 defaults to "omitted" -- the API returns a thinking block with an empty thinking field and a signature field containing an encrypted representation of the full reasoning chain (used for multi-turn continuity). You are still billed for the full thinking tokens. To see thinking summaries, set "display": "summarized" explicitly in the thinking configuration.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from anthropic import AnthropicBedrockMantle

client = AnthropicBedrockMantle(aws_region="us-east-1")

message = client.messages.create(
model="anthropic.claude-opus-4-7",
max_tokens=16000,
thinking={"type": "adaptive", "display": "summarized"},
output_config={"effort": "medium"},
messages=[{"role": "user", "content": "Design a retry strategy for a distributed payment system."}]
)

for block in message.content:
if block.type == "thinking":
print(f"[Thinking]: {block.thinking}")
elif block.type == "text":
print(f"[Response]: {block.text}")

Context Compaction (Beta)

Compaction solves two problems for customers building long-running agents: hitting the context window limit, and the subtler issue of "context rot" where performance degrades as the context fills up, with the model losing track of earlier instructions or contradicting itself.
Instead of building custom summarization logic, customers enable compaction and the API handles it server-side. When input tokens exceed a trigger threshold, Claude generates a summary of the conversation so far, returns it as a compaction block, and on subsequent requests everything before that block is ignored. Opus 4.7's stronger reasoning and memory mean compaction summaries are more accurate and preserve more relevant context than on previous models.
  • Beta header required: "anthropic_beta": ["compact-2026-01-12"]
  • Available on Messages API and InvokeModel -- not Converse during the beta
  • pause_after_compaction lets you inspect or inject context before continuing
Billing note: When compaction triggers, usage.input_tokens and usage.output_tokens at the top level do not include the compaction iteration. Sum across all entries in usage.iterations for accurate billing totals.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import boto3, json

bedrock_runtime = boto3.client('bedrock-runtime', region_name='us-east-1')

request_body = {
"anthropic_version": "bedrock-2023-05-31",
"anthropic_beta": ["compact-2026-01-12"],
"max_tokens": 4096,
"messages": [
{"role": "user", "content": "Let's start designing the migration plan."}
],
"context_management": {
"edits": [{
"type": "compact_20260112",
"trigger": {
"type": "input_tokens",
"value": 100000
}
}]
}
}

response = bedrock_runtime.invoke_model(
modelId="us.anthropic.claude-opus-4-7",
body=json.dumps(request_body)
)

response_body = json.loads(response["body"].read())

if "iterations" in response_body.get("usage", {}):
total_input = sum(i["input_tokens"] for i in response_body["usage"]["iterations"])
total_output = sum(i["output_tokens"] for i in response_body["usage"]["iterations"])
print(f"Total tokens (including compaction): {total_input} in / {total_output} out")

Task Budgets (Beta)

Task budgets let you tell Claude how many tokens it has for a full agentic loop, including thinking, tool calls, tool results, and output. The model sees a live countdown of how many tokens remain and uses it to prioritize work, plan ahead, and wrap up gracefully as the budget is consumed -- giving developers cost predictability without hard cutoffs.
  • Beta header required: "anthropic_beta": ["task-budgets-2026-03-13"]
  • Parameter: output_config.task_budget = {"type": "tokens", "total": N}
  • Minimum: 20,000 tokens (requests below this are rejected)
  • Advisory, not enforced: Task budgets guide the model's planning but do not hard-cap usage. max_tokens remains the enforced ceiling per request.
  • Only available on Opus 4.7
  • Task budgets complement the effort parameter: effort controls how deeply Claude reasons per step, task budgets cap the total work across an agentic loop
The extra_body parameter passes fields not yet supported as first-class SDK parameters. When the SDK adds native support for task budgets, you can pass these as regular arguments.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from anthropic import AnthropicBedrockMantle

client = AnthropicBedrockMantle(aws_region="us-east-1")

message = client.messages.create(
model="anthropic.claude-opus-4-7",
max_tokens=8000,
thinking={"type": "adaptive"},
extra_body={
"anthropic_beta": ["task-budgets-2026-03-13"],
"output_config": {
"effort": "medium",
"task_budget": {"type": "tokens", "total": 25000}
}
},
messages=[{
"role": "user",
"content": "Implement a complete REST API for a todo application with authentication."
}]
)

for block in message.content:
if block.type == "text":
print(block.text)

The Model IDs

The model ID you use depends on your API path and routing preference.
ScenarioModel ID
Messages API (Bedrock Mantle)anthropic.claude-opus-4-7
US cross-region inference (InvokeModel / Converse)us.anthropic.claude-opus-4-7
EU cross-region inference (InvokeModel / Converse)eu.anthropic.claude-opus-4-7
Global inference profile (InvokeModel / Converse)global.anthropic.claude-opus-4-7
Cross-region model IDs (us., eu., global.) are for bedrock-runtime only. The Messages API on bedrock-mantle uses the bare model ID anthropic.claude-opus-4-7.

Three API Paths Available Today

Customers can reach Opus 4.7 through three fully supported API paths. Two additional OpenAI-compatible paths (Responses API and Chat Completions API) are coming soon on the bedrock-mantle endpoint.

1. Messages API (Bedrock Mantle)

Endpoint: https://bedrock-mantle.{region}.api.aws/anthropic/v1/messages
The Messages API uses the same request and response format as Anthropic's first-party API, available through Bedrock Mantle. This is the most feature-complete path for Claude. It supports all Anthropic features including adaptive thinking, compaction, task budgets, vision, and tool use.
Best for:
  • Customers migrating existing code from Anthropic's direct API
  • Teams that want the most direct access to Claude's full feature set
  • Developers already familiar with the Anthropic SDK
  • Workloads that need compaction or task budgets (available here first)
Not ideal for:
  • Teams that need Amazon Bedrock Guardrails (not supported on the bedrock-mantle endpoint at launch; use bedrock-runtime instead)
  • Workloads that depend on CloudWatch metrics and model invocation logging (not available on bedrock-mantle at launch)
Authentication: SigV4 signing against the bedrock-mantle:CreateInference IAM action. This is a different IAM action than InvokeModel/Converse (bedrock:InvokeModel), so customers need to update their IAM policies.
IAM policy required:
1
2
3
4
5
6
7
8
9
10
{
"Effect": "Allow",
"Action": "bedrock-mantle:CreateInference",
"Resource": "arn:aws:bedrock-mantle:*:*:project/*",
"Condition": {
"StringEquals": {
"bedrock-mantle:Model": "anthropic.claude-opus-4-7"
}
}
}
Example (Python):
1
2
3
4
5
6
7
8
9
10
from anthropic import AnthropicBedrockMantle

client = AnthropicBedrockMantle(aws_region="us-east-1")

message = client.messages.create(
model="anthropic.claude-opus-4-7",
max_tokens=1024,
messages=[{"role": "user", "content": "Hello, Claude"}]
)
print(message.content[0].text)
SDK support: pip install anthropic[bedrock] provides the AnthropicBedrockMantle client. Also available for TypeScript, C#, Go, Java, PHP, and Ruby.

2. InvokeModel API (Bedrock Runtime)

Endpoint: https://bedrock-runtime.{region}.amazonaws.com
The standard Bedrock API. The request body uses the Anthropic message format, wrapped in the Bedrock InvokeModel call. It supports adaptive thinking, vision, tool use, and compaction.
Best for:
  • Customers already using Bedrock's InvokeModel for other models
  • Workloads that need the full Anthropic request body format
  • Teams that want to use cross-region inference profiles
  • Workloads that need Amazon Bedrock Guardrails or CloudWatch metrics
Not ideal for:
  • Teams migrating from Anthropic's direct API (the Messages API offers a lower-friction path)
  • Workloads that need model-agnostic code across providers
Example (Python):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import boto3, json

bedrock_runtime = boto3.client('bedrock-runtime', region_name='us-east-1')

request_body = {
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 2048,
"thinking": {
"type": "adaptive"
},
"output_config": {
"effort": "high"
},
"messages": [
{"role": "user", "content": [{"type": "text", "text": "Hello, Claude"}]}
]
}

response = bedrock_runtime.invoke_model(
modelId="us.anthropic.claude-opus-4-7",
body=json.dumps(request_body)
)

response_body = json.loads(response["body"].read())
print(response_body["content"][0]["text"])

3. Converse API (Bedrock Runtime)

Endpoint: https://bedrock-runtime.{region}.amazonaws.com
Bedrock's unified conversational API. It works across all Bedrock models with a consistent interface, making it the simplest integration path. Supports adaptive thinking and tool use. Compaction is not supported on Converse during the beta.
Best for:
  • Customers who want model-agnostic code (easy to swap between providers)
  • Teams that want the simplest possible integration path
  • Prototyping and experimentation across multiple Bedrock models
Not ideal for:
  • Workloads that need compaction or task budgets (use Messages API or InvokeModel)
  • Teams that need full control over the Anthropic-native request format
Example (Python):
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import boto3

bedrock_runtime = boto3.client('bedrock-runtime', region_name='us-east-1')

response = bedrock_runtime.converse(
modelId="us.anthropic.claude-opus-4-7",
messages=[
{"role": "user", "content": [{"text": "Hello, Claude"}]}
],
inferenceConfig={"maxTokens": 2048},
additionalModelRequestFields={
"thinking": {"type": "adaptive"},
"output_config": {"effort": "high"}
}
)

print(response["output"]["message"]["content"][0]["text"])

Coming Soon: OpenAI-Compatible APIs

Two additional API paths are coming soon on the bedrock-mantle endpoint for Claude models:
  • Responses API (/v1/responses): OpenAI-compatible API that will support server-side tool use and agentic workloads. Customers using the OpenAI SDK will be able to point it at this endpoint with minimal code changes.
  • Chat Completions API (/v1/chat/completions): Enables customers migrating from OpenAI to use their existing SDK code with minimal changes.
Both are already available on Bedrock Mantle for non-Anthropic models. In the meantime, the Messages API with the Anthropic SDK is the recommended path for customers migrating from OpenAI.

API Comparison Matrix

FeatureMessagesInvokeModelConverse
Adaptive thinkingYesYesYes
Compaction (beta)YesYesNo
Task budgets (beta)YesYesNo
Prompt cachingYesYesYes
Tool useYesYesYes
VisionYesYesYes
StreamingYes (SSE)YesYes
Bedrock GuardrailsNoYesYes
CloudWatch metricsNoYesYes
Endpointbedrock-mantlebedrock-runtimebedrock-runtime
IAM actionCreateInferenceInvokeModelInvokeModel
The Responses API and Chat Completions API will be added to this matrix when available.

Choosing the Right Path

  • Already on Bedrock with InvokeModel? Stay there. Update the model ID to us.anthropic.claude-opus-4-7 (or eu./global. as needed).
  • Migrating from Anthropic's direct API? Messages API is the lowest-friction path. Same request format, same SDK.
  • Want model-agnostic code that can swap providers? Converse.
  • Need compaction or task budgets? Messages API or InvokeModel (not Converse during beta).
  • Need Bedrock Guardrails or CloudWatch metrics? Use InvokeModel or Converse on bedrock-runtime.
  • Migrating from OpenAI? The Responses API and Chat Completions API are coming soon. In the meantime, the Messages API with the Anthropic SDK is the recommended path.

Key Migration Notes for Opus 4.7

If upgrading from Opus 4.6, be aware of these breaking changes:
  1. Model ID format changed: Use claude-opus-4-7 (no -v1 suffix), unlike Opus 4.6 which used claude-opus-4-6-v1.
  2. Sampling parameters deprecated: temperature, top_p, and top_k return a 400 error if set to non-default values. Omit them entirely.
  3. budget_tokens removed: Extended thinking with budget_tokens is no longer supported. Migrate to adaptive thinking: "thinking": {"type": "adaptive"} with "output_config": {"effort": "high"}.
  4. Effort parameter placement: effort goes in output_config, NOT inside the thinking dict.
  5. Thinking defaults to omitted: Opus 4.7 returns an empty thinking field by default. The signature field proves reasoning occurred. To see thinking summaries, set "display": "summarized" in the thinking configuration.
  6. More verbose output: Opus 4.7 produces longer responses. Mitigate with task budgets, the medium effort level (recommended by Anthropic for most Opus 4.7 workloads), or system prompt instructions.

Resources

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article