claude-code - 💡(How to fix) Fix Opus 4.7 via Bedrock application inference profiles fails with thinking.type.enabled error [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#51711Fetched 2026-04-22 07:54:53
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
1
Timeline (top)
labeled ×4subscribed ×2commented ×1

Claude Code v2.1.116 sends thinking.type: "enabled" when using Opus 4.7 through an AWS Bedrock application inference profile ARN. Opus 4.7 requires thinking.type: "adaptive" and rejects the request with a 400 error.

The issue is that Claude Code cannot detect the underlying model version from an application inference profile ARN, so it defaults to the legacy thinking type.

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"\"thinking.type.enabled\" is not supported for this model. Use \"thinking.type.adaptive\" and \"output_config.effort\" to control thinking behavior."}}

Root Cause

Claude Code v2.1.116 sends thinking.type: "enabled" when using Opus 4.7 through an AWS Bedrock application inference profile ARN. Opus 4.7 requires thinking.type: "adaptive" and rejects the request with a 400 error.

The issue is that Claude Code cannot detect the underlying model version from an application inference profile ARN, so it defaults to the legacy thinking type.

Fix Action

Fix / Workaround

Workarounds Considered

WorkaroundIssue
CLAUDE_CODE_DISABLE_THINKING=1Loses extended thinking entirely
Use us.anthropic.claude-opus-4-7 instead of ARNBypasses application inference profiles, breaking per-user cost attribution via tags
MAX_THINKING_TOKENS=0Same as disabling thinking

Code Example

export CLAUDE_CODE_USE_BEDROCK=1
   export AWS_BEARER_TOKEN_BEDROCK="<token>"
   export ANTHROPIC_DEFAULT_OPUS_MODEL="arn:aws:bedrock:us-east-1:<account>:application-inference-profile/<profile-id>"

---

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"\"thinking.type.enabled\" is not supported for this model. Use \"thinking.type.adaptive\" and \"output_config.effort\" to control thinking behavior."}}
RAW_BUFFERClick to expand / collapse

Description

Claude Code v2.1.116 sends thinking.type: "enabled" when using Opus 4.7 through an AWS Bedrock application inference profile ARN. Opus 4.7 requires thinking.type: "adaptive" and rejects the request with a 400 error.

The issue is that Claude Code cannot detect the underlying model version from an application inference profile ARN, so it defaults to the legacy thinking type.

Steps to Reproduce

  1. Create an application inference profile for Opus 4.7 in AWS Bedrock
  2. Configure Claude Code with the inference profile ARN:
    export CLAUDE_CODE_USE_BEDROCK=1
    export AWS_BEARER_TOKEN_BEDROCK="<token>"
    export ANTHROPIC_DEFAULT_OPUS_MODEL="arn:aws:bedrock:us-east-1:<account>:application-inference-profile/<profile-id>"
  3. Ensure MAX_THINKING_TOKENS is not set
  4. Run claude, switch to /model opus, and send any message

Error

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"\"thinking.type.enabled\" is not supported for this model. Use \"thinking.type.adaptive\" and \"output_config.effort\" to control thinking behavior."}}

Expected Behavior

Claude Code should detect that Opus 4.7 requires thinking.type: "adaptive" and send the correct parameter, even when the model is referenced via an application inference profile ARN.

Environment

  • Claude Code version: 2.1.116
  • Provider: AWS Bedrock
  • Model: Opus 4.7 (anthropic.claude-opus-4-7)
  • Auth method: Bearer token (service-specific credential)
  • Model reference: Application inference profile ARN (not cross-region profile ID)

Workarounds Considered

WorkaroundIssue
CLAUDE_CODE_DISABLE_THINKING=1Loses extended thinking entirely
Use us.anthropic.claude-opus-4-7 instead of ARNBypasses application inference profiles, breaking per-user cost attribution via tags
MAX_THINKING_TOKENS=0Same as disabling thinking

None of these preserve both extended thinking and per-user cost tracking.

Context

We use application inference profiles for per-developer cost attribution — each user gets a tagged profile that routes through CloudWatch for usage tracking. This is a standard Bedrock pattern for enterprise cost management. The profiles work correctly for Sonnet 4.6, Haiku 4.5, and Opus 4.6 — only Opus 4.7 breaks due to the thinking type change.

Suggested Fix

When Claude Code resolves a Bedrock application inference profile ARN, it could:

  1. Query the underlying model via the Bedrock API to determine the correct thinking type, or
  2. Allow users to specify thinking type via an env var (e.g., CLAUDE_CODE_THINKING_TYPE=adaptive), or
  3. Default to thinking.type: "adaptive" for all models (since it's backwards compatible with older models that support thinking)

extent analysis

TL;DR

To fix the issue, Claude Code needs to detect the correct thinking type for Opus 4.7 when using an AWS Bedrock application inference profile ARN, potentially by querying the Bedrock API or allowing user specification via an environment variable.

Guidance

  • The issue arises because Claude Code defaults to thinking.type: "enabled" when it cannot detect the underlying model version from an application inference profile ARN, which is not compatible with Opus 4.7.
  • To mitigate this, consider allowing users to specify the thinking type via an environment variable, such as CLAUDE_CODE_THINKING_TYPE=adaptive, as a temporary workaround.
  • Another potential solution is to default to thinking.type: "adaptive" for all models, given its backwards compatibility with older models that support thinking.
  • Verify the fix by running Claude Code with the proposed solution and checking that it sends thinking.type: "adaptive" when using the Opus 4.7 model via an application inference profile ARN.

Example

No code snippet is provided as the issue does not require a code change for the workaround, but rather a configuration or environment variable adjustment.

Notes

The suggested fixes aim to address the compatibility issue between Claude Code and Opus 4.7 when using AWS Bedrock application inference profiles. However, the ideal solution would involve modifying Claude Code to correctly detect the thinking type for models referenced by ARNs.

Recommendation

Apply a workaround by allowing users to specify the thinking type via an environment variable, such as setting CLAUDE_CODE_THINKING_TYPE=adaptive, as this provides a flexible and immediate solution without requiring changes to Claude Code's core functionality.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix Opus 4.7 via Bedrock application inference profiles fails with thinking.type.enabled error [1 comments, 2 participants]