[BUG] API Error: Unexpected value(s) `interleaved-thinking-2025-05-14` for the `anthropic-beta` header. when using via Vertex AI

Status Fixed / completed
Maintainer reply ✓ Yes — bcherny
Activity 7 comments · opened May 22, 2025 · closed May 23, 2025
💡 Likely answer: A maintainer (bcherny, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [ ] Anthropic API
  • [ ] AWS Bedrock
  • [x] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.0 (Claude Code)
  • Operating System: Debian
  • Terminal: VS Code Terminal

Bug Description

I cannot use Claude Code today because all requests fail 🥲

Steps to Reproduce

  1. Configure Claude Code to use Vertex AI
  2. Say something to Claude Code, e.g. hello world

Expected Behavior

It should greet me back.

Actual Behavior

> hello world
  ⎿ API Error: 400 
    {"type":"error","error":{"type":"invalid_request_error","message":"Unexpected value(s) 
    `interleaved-thinking-2025-05-14` for the `anthropic-beta` header. Please consult our 
    documentation at docs.anthropic.com or try again without the header."}}

Additional Context

Screenshot:
<img width="757" alt="Image" src="https://github.com/user-attachments/assets/8a83a591-5643-4601-ab7a-05e11c0c25f4" />

View original on GitHub ↗

7 Comments

bcherny collaborator · 1 year ago

Hey, can you try again now and report back if you're still hitting this?

bcherny collaborator · 1 year ago

We've just validated that interleaved-thinking-2025-05-14 works for both Opus 4 and Sonnet 4 for all the regions we have them deployed in. Please re-open if this is still happening.

pokutuna · 1 year ago

I'm experiencing the same issue when using Claude Code with Vertex AI.
This issue is that claude-code send the beta header regardless of the model version.

Even when specifying an older model version that should be available:

ANTHROPIC_MODEL=claude-3-7-sonnet@20250219 claude

The interleaved-thinking-2025-05-14 header is still being sent automatically by claude-code, causing the request to fail with:

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"Unexpected value(s) `interleaved-thinking-2025-05-14` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header."}}
dicksontsai collaborator · 1 year ago

Thank you for the report. We made the following changes to mitigate the Claude Code issues on Vertex.

  • In v1.0.2, we have adjusted Vertex requests to only send the header for Claude Opus 4 and Claude Sonnet 4.
  • In v1.0.1, we introduced the environment variable DISABLE_INTERLEAVED_THINKING to give you the option of disabling the header.
pokutuna · 1 year ago

Thank you!
I confirmed that in v1.0.2, the corresponding error no longer occurs even when specifying 3.7.

dtinth · 1 year ago

Thanks @dicksontsai and the team for the quick fix\! 🎉

I can confirm that v1.0.2 has resolved the issue - Claude Code now works perfectly with Vertex AI without the 400 error.

🤖 Generated with Claude Code

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.