claude-code - 💡(How to fix) Fix Opus 4 on Vertex AI fails with thinking.type.enabled error (400) [1 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#52811Fetched 2026-04-25 06:20:17
View on GitHub
Comments
0
Participants
1
Timeline
5
Reactions
0
Author
Participants
Timeline (top)
labeled ×5

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_vrtx_011CaNV29S9FHHK79mCMmTeC"}

Root Cause

Claude Code is sending thinking: { type: "enabled" } in the API request. Vertex AI's Opus 4 endpoint requires thinking: { type: "adaptive" } + output_config.effort instead. This is a breaking schema difference between the Vertex Opus 4 endpoint and earlier models.

Fix Action

Fix / Workaround

400 error on every request. Model is unusable. Workaround is to use Sonnet 4.6.

  • Request ID: req_vrtx_011CaNV29S9FHHK79mCMmTeC
  • The Vertex AI Opus 4 model is confirmed enabled in GCP
  • The binary is compiled native (Mach-O arm64) so local patching is not possible

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_vrtx_011CaNV29S9FHHK79mCMmTeC"}
RAW_BUFFERClick to expand / collapse

Bug Description

Selecting Opus 4 (claude-opus-4-7) in Claude Code on a Vertex AI (GCP) backend returns a 400 error immediately:

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_vrtx_011CaNV29S9FHHK79mCMmTeC"}

Root Cause

Claude Code is sending thinking: { type: "enabled" } in the API request. Vertex AI's Opus 4 endpoint requires thinking: { type: "adaptive" } + output_config.effort instead. This is a breaking schema difference between the Vertex Opus 4 endpoint and earlier models.

Environment

  • Claude Code version: 2.1.109
  • Platform: macOS arm64 (darwin 25.4.0)
  • API backend: Vertex AI (GCP) — confirmed via vrtx in request ID
  • Model: Opus 4 (claude-opus-4-7)

Steps to Reproduce

  1. Configure Claude Code to use a Vertex AI backend with Opus 4 enabled
  2. Run /model and select Opus 4
  3. Send any message

Expected Behavior

Claude Code sends the correct thinking schema for Vertex Opus 4 (thinking.type: "adaptive" + output_config.effort) and the model responds successfully.

Actual Behavior

400 error on every request. Model is unusable. Workaround is to use Sonnet 4.6.

Additional Context

  • Request ID: req_vrtx_011CaNV29S9FHHK79mCMmTeC
  • The Vertex AI Opus 4 model is confirmed enabled in GCP
  • The binary is compiled native (Mach-O arm64) so local patching is not possible

extent analysis

TL;DR

Update the API request to use thinking: { type: "adaptive" } and include output_config.effort to match the Vertex AI Opus 4 endpoint's requirements.

Guidance

  • Verify the current API request payload to confirm it's sending thinking: { type: "enabled" }, which is not supported by the Opus 4 endpoint.
  • Update the Claude Code configuration to send thinking: { type: "adaptive" } and include a valid output_config.effort value in the API request.
  • Test the updated configuration with the Opus 4 model to ensure the 400 error is resolved and the model responds successfully.
  • If updating the configuration is not feasible, consider using the Sonnet 4.6 model as a temporary workaround, as mentioned in the issue.

Example

No code snippet is provided, as the issue does not include specific code details.

Notes

The fix relies on updating the API request payload to match the Opus 4 endpoint's requirements. The exact implementation details may vary depending on the Claude Code version and configuration.

Recommendation

Apply workaround: Update the API request to use thinking: { type: "adaptive" } and include output_config.effort, as this is a breaking schema difference between the Vertex Opus 4 endpoint and earlier models.

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 on Vertex AI fails with thinking.type.enabled error (400) [1 participants]