[BUG] Claude Code with Vertex AI (Unexpected value(s) `prompt-caching-scope-2026-01-05`)

Resolved 💬 18 comments Opened Jan 29, 2026 by matanbaruch Closed Jan 29, 2026

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?

Hey,
I got this error message with latest version of Claude Code with using Vertex AI (Via LiteLLM)

What Should Happen?

Claude Code should successfully continue. (It works on Foundry AI - Azure via LiteLLM)

Error Messages/Logs

  ⎿ API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Unexpected value(s) `prompt-caching-scope-2026-01-05` for the
    `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the header.\"},\"request_id\":\"req_vrtx_0xxxxxxxxxxxxxxxx\"}. Received
    Model Group=claude-opus-4-5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

Steps to Reproduce

Install LiteLLM, Configure Vertex AI Anthropic models. Use this models in Claude Code

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

v2.1.22

Claude Code Version

v2.1.23

Platform

Google Vertex AI

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

_No response_

View original on GitHub ↗

18 Comments

github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/11154
  2. https://github.com/anthropics/claude-code/issues/12429
  3. https://github.com/anthropics/claude-code/issues/1229

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

pszemus · 5 months ago

downgrade to 2.1.22:

claude install --force 2.1.22

and disabling autoupdater

"DISABLE_AUTOUPDATER": "1"

worked for me as a temporary fix

szwang · 5 months ago

Thanks so much for reporting. We just shipped v2.1.25 with the fix, and you should be able to avoid the error now (set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1). So sorry for the friction, closing now but please let me know if you're still seeing any issues.

nirvedhmeshram · 5 months ago

~~I am still getting this failure for v2.1.25 it works for me for v2.1.22~~
Edit: sorry it works I missed the (set CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1)

JPeetz · 5 months ago

Apologies, this is not fixed just yet.
I use the Claude Extension through VScode on my MacBook Pro and I see it was updated to v2.1.25, and I am still getting the same error:
API Error: 400 {"error":{"message":"{"type":"error","error":{"type":"invalid_request_error","message":"Unexpected value(s) prompt-caching-scope-2026-01-05 for the anthropic-beta header. Please consult our documentation at docs.anthropic.com or try again without the header."},"request_id":"req_vrtx_011CXdGjEHsMBfTPLuNzs9Nb"}. Received Model Group=claude-4.5-opus\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}}

...despite the setting:
"claudeCode.enablePromptCaching": false,
"claudeCode.useAnthropicBetaHeaders": false

szwang · 5 months ago

@JPeetz with VSCode, can you try adding the env var to your settings.json? Instructions here.

Alternatively, you can also try setting this:

    "claudeCode.environmentVariables": [                                                                                                                    
      { "name": "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS", "value": "true" }                                                                             
    ]                                                                                                                                                   
zkl94 · 5 months ago

with claude code cli this is still not working as of version 2.1.27

❯ export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1
❯ claude

 ▐▛███▜▌   Claude Code v2.1.27
▝▜█████▛▘  claude-opus-4-5 · API Usage Billing
  ▘▘ ▝▝    ~/Downloads/ccswitch-test

  Welcome to Opus 4.5

❯ /model
  ⎿  Set model to claude-opus-4-5

❯ who are you?
  ⎿ 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_011CXfx7iALDUesksGN9yRfS\"}. Received Model Group=claude-opus-4-5\nAvailable Model Group
    Fallbacks=None","type":"None","param":"None","code":"400"}}
stevo-knievo · 5 months ago

Same here with version 2.1.27

with claude code cli this is still not working as of version 2.1.27 `` ❯ export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS=1 ❯ claude ▐▛███▜▌ Claude Code v2.1.27 ▝▜█████▛▘ claude-opus-4-5 · API Usage Billing ▘▘ ▝▝ ~/Downloads/ccswitch-test Welcome to Opus 4.5 ❯ /model ⎿ Set model to claude-opus-4-5 ❯ who are you? ⎿ 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_011CXfx7iALDUesksGN9yRfS\"}. Received Model Group=claude-opus-4-5\nAvailable Model Group Fallbacks=None","type":"None","param":"None","code":"400"}} ``
szwang · 5 months ago

Thanks for the reports. Seems like we shipped a regression with a different beta header, looking and will keep you all updated on the fix.

stevo-knievo · 5 months ago

BTW: The 2.1.25 version is working for me. claude install --force 2.1.25

szwang · 5 months ago

@stevo-knievo can you confirm you saw the same error?

Unexpected value(s) `oauth-2025-04-20` for the `anthropic-beta` header

@zkl94 and @stevo-knievo Would be helpful to know your setups. Specifically:

  • Have you logged in with claude login or /login in the past with a claude.ai (pro/max/enterprise) account?
  • Are you using a gateway/proxy? If so, which one?
  • Are you using Vertex and/or other providers
zkl94 · 5 months ago

@szwang

  • yes I have been using claude max for CC for a long time and this my first time trying to connect to our company instance of claude-opus-4-5@20251101 on vertex ai. I am using https://github.com/farion1231/cc-switch to switch between claude max and the vertex ai instace (behind litellm) for testing
  • using litellm with below config to translate vertex ai to anthropic compatible format. I can verify the litellm is functioning and I can send request to the model using curl command through litellm
    model_list:
      # Claude Opus 4.5 via Vertex AI
      - model_name: claude-opus-4-5
        litellm_params:
          model: vertex_ai/claude-opus-4-5@20251101
          vertex_ai_project: xxxxx
          vertex_ai_location: us-east5

    # General settings
    litellm_settings:
      drop_params: true
      set_verbose: false

    # Router settings
    router_settings:
      enable_pre_call_checks: true
szwang · 5 months ago

@zkl94 Thanks so much! Super helpful.

  • What version of litellm are you on? If you downgrade to 1.80 or earlier, does it work?
  • What happens if you set ANTHROPIC_API_KEY=xx claude when running with litellm? Or try /logout and logging in with a Console account.
stevo-knievo · 5 months ago
Unexpected value(s) oauth-2025-04-20 for the anthropic-beta header

I got this message:
"message":"Unexpected value(s) prompt-caching-scope-2026-01-05 for the anthropic-beta header. Please consult our documentation at [docs.anthropic.com](http://docs.anthropic.com/) or try again without the header."

stevo-knievo · 5 months ago

Claude Code v2.1.29

API Error: 400 {"error":{"message":"{\"type\":\"error\",\"error\":{\"type\":\"invalid_request_error\",\"message\":\"Unexpected value(s)
     `prompt-caching-scope-2026-01-05` for the `anthropic-beta` header. Please consult our documentation at docs.anthropic.com or try again without the
     header.\"},\"request_id\":\"req_vrtx_011CXiTPtM5yCLkJPMoWkvqZ\"}. Received Model Group=claude-opus-4.5\nAvailable Model Group
     Fallbacks=None","type":"None","param":"None","code":"400"}}```
stevo-knievo · 5 months ago
BTW: The 2.1.25 version is working for me. claude install --force 2.1.25

Sorry for the confusion. I tested 2.1.29 but had to downgrade again. 2.1.25 actually does not work for me either, while 2.1.22 does.
Apologies again!

pieter-venter · 5 months ago

In case this helps someone:

  1. You're using this via LiteLLM
  2. You previously had a subscription
  3. You're on a Mac

There were some leftover credentials in my local keyring:
Run this to find
security find-generic-password -s "Claude Code-credentials"
It located an entry from back when I first subscribed.

Remove it with
security delete-generic-password -s "Claude Code-credentials"

You can also use the KeyChain access app to do the same (find it, remove it).

Launch Claude again. Note that it adds a new entry on launch, but it will have a new date and the beta-headers problem was gone for me.

github-actions[bot] · 5 months 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.