[BUG] anthropic-beta header rejects oauth-2025-04-20 with 400 invalid_request_error ("Unexpected value(s) ...")

Resolved 💬 3 comments Opened Dec 12, 2025 by DennySORA Closed Dec 15, 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?

Starting in Claude Code 2.0.65, all requests fail with HTTP 400 due to an invalid anthropic-beta header value being sent:

anthropic-beta: oauth-2025-04-20

The error response states this is an unexpected value and suggests retrying without the header. This breaks our setup where we use LiteLLM gateway to route requests to Vertex AI (vertex_ai).

This is a regression: 2.0.64 works, while 2.0.65 / 2.0.66 / 2.0.67 consistently fail.

What Should Happen?

Claude Code should function the same as 2.0.64 in this environment (LiteLLM gateway → Vertex AI), i.e. requests should succeed and Claude Code should not send an anthropic-beta header value that the upstream rejects.

If that header is only intended for specific auth modes (e.g., direct Anthropic OAuth), it should not be attached by default for non-Anthropic/gateway paths, or there should be a documented way to disable/override it.

Error Messages/Logs

API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Unexpected
     value(s) `oauth-2025-04-20` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try
    again without the header.\"},\"request_id\":\"req_vrtx_011CW2Gd9sh8dZqn6pseQvb4\"}. Received Model
    Group=claude-4.5-opus\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

Steps to Reproduce

  • Install Claude Code 2.0.64 globally via npm:

```bash
npm i -g @anthropic-ai/claude-code@2.0.64
claude --version

```

  • Configure Claude Code to use our LiteLLM gateway endpoint (which routes to Vertex AI / vertex_ai).
  • Gateway setup: LiteLLM → Vertex AI
  • Claude Code config method: [ENV VAR / config file / CLI flag — please fill in exact details]
  • Run any command that triggers a model call (example):

```bash
claude "hello"

```

  • Observe: Success on 2.0.64.
  • Upgrade to 2.0.67:

```bash
npm i -g @anthropic-ai/claude-code@2.0.67
claude --version

```

  • Run the exact same command again:

```bash
claude "hello"

```

  • Observe: request fails with the 400 error above referencing:
  • unexpected value oauth-2025-04-20 for anthropic-beta header

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.64

Platform

Other

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Other / Custom Gateway (LiteLLM gateway → Vertex AI)

  • We route requests through LiteLLM gateway to Vertex AI.
  • Regression begins at 2.0.65; 2.0.64 is a working workaround.
  • The API response suggests retrying without the anthropic-beta header, but we couldn’t find a Claude Code configuration option to disable/override that header.
  • It looks like Claude Code >= 2.0.65 may be adding anthropic-beta: oauth-2025-04-20 automatically; if so, can you confirm:
  1. Why this header/value is being added?
  2. Whether it should be gated to specific auth modes only?
  3. Whether there is a supported way to disable/override anthropic-beta header injection for gateway/provider integrations?
  • Any relevant config snippets (sanitized):

```
[paste relevant Claude Code + LiteLLM gateway endpoint config, redacting secrets]

```

View original on GitHub ↗

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