claude-code - 💡(How to fix) Fix [BUG] opusplan fails with 400 error when ANTHROPIC_DEFAULT_OPUS_MODEL points to 4.7 using the new thinking API format [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#49580Fetched 2026-04-17 08:37:06
View on GitHub
Comments
1
Participants
2
Timeline
4
Reactions
0
Timeline (top)
labeled ×3commented ×1

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."},"request_id":"req_011Ca8FdBuWpqDJZZbMQnhiS"}

Code Example

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."},"request_id":"req_011Ca8FdBuWpqDJZZbMQnhiS"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Using /model opusplan crashes with a 400 API error when ANTHROPIC_DEFAULT_OPUS_MODEL is set to a model that requires the new adaptive thinking API format (e.g. claude-opus-4-7).

Claude Code sends thinking.type.enabled but newer models require thinking.type.adaptive + output_config.effort. Models that have adopted the new thinking API require thinking: { type: "adaptive" } + output_config: { effort: "..." } instead.

What Should Happen?

opusplan works with claude-opus-4-7, using the new thinking API format. Models that have adopted the new thinking API require thinking: { type: "adaptive" } + output_config: { effort: "..." } instead.

Error Messages/Logs

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."},"request_id":"req_011Ca8FdBuWpqDJZZbMQnhiS"}

Steps to Reproduce

  1. Set ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-7 via export ANTHROPIC_DEFAULT_OPUS_MODEL=claude-opus-4-7 or in ~/.zshrc
  2. run claude > /model opusplan
  3. ask Claude to enter planning mode i.e. "go into planning mode" > 400 error

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.109

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

extent analysis

TL;DR

Update the API request to use thinking.type.adaptive and output_config.effort instead of thinking.type.enabled to fix the 400 error.

Guidance

  • Verify that the issue is resolved by checking the API response after updating the request with the new thinking API format.
  • Ensure that the ANTHROPIC_DEFAULT_OPUS_MODEL is set to a model that supports the new thinking API format, such as claude-opus-4-7.
  • Review the error message and logs to confirm that the issue is related to the thinking.type.enabled parameter.
  • Test the updated request with different models to ensure that the fix is not model-specific.

Example

{
  "thinking": {
    "type": "adaptive"
  },
  "output_config": {
    "effort": "..."
  }
}

Replace the ... with the desired effort value.

Notes

The fix assumes that the Anthropic API supports the new thinking API format for the specified model. If the issue persists, verify that the model is compatible with the new format.

Recommendation

Apply the workaround by updating the API request to use the new thinking API format, as it is likely that the issue is caused by the deprecated thinking.type.enabled parameter.

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 [BUG] opusplan fails with 400 error when ANTHROPIC_DEFAULT_OPUS_MODEL points to 4.7 using the new thinking API format [1 comments, 2 participants]