Opus 4.7 via Bedrock application inference profiles fails with thinking.type.enabled error

Resolved 💬 6 comments Opened Apr 21, 2026 by stevopsfhc Closed Apr 26, 2026

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:

``bash
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>"
``

  1. Ensure MAX_THINKING_TOKENS is not set
  2. 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

| Workaround | Issue |
|---|---|
| CLAUDE_CODE_DISABLE_THINKING=1 | Loses extended thinking entirely |
| Use us.anthropic.claude-opus-4-7 instead of ARN | Bypasses application inference profiles, breaking per-user cost attribution via tags |
| MAX_THINKING_TOKENS=0 | Same 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)

View original on GitHub ↗

This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗