[BUG] Vertex AI provider returns 400 error due to unsupported web-search-2025-03-05 in anthropic-beta header when count-tokens

Resolved 💬 2 comments Opened Nov 26, 2025 by biubiuqiu Closed Nov 26, 2025

Preflight Checklist

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

What's Wrong?

I am encountering a issue when using Claude Code configured with the Vertex AI provider. The tool appears to automatically inject the web-search-2025-03-05 value into the anthropic-beta header when count-tokens.

However, the Vertex AI endpoint rejects this specific beta header value, resulting in a 400 invalid_request_error.

What Should Happen?

When using the vertex provider, Claude Code should either:

Not send the web-search-2025-03-05 header by default, as Vertex likely does not support this beta feature yet.

Error Messages/Logs

400: {"type":"error","error":{"type":"invalid_request_error","message":"Unexpected value(s) `web-search-2025-03-05` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header."},"request_id":"req_vrtx_011CVVmAGpANwSni83J9vMri"}

Steps to Reproduce

  1. Configure Claude Code to use the Google Vertex AI provider.
  2. Randomly encounter this error during usage (the exact trigger is unclear, but it happens intermittently).

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.53

Platform

Google Vertex AI

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗

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