[BUG] API 400 error message not helpful when model is not allowed in Pro billing
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?
This report describes a different path to get to a previously-reported but unaddressed problem. It also describes the real apparent problem, that the API 400 error message is not helpful when the currently selected model is not allowed in Pro billing, which I did not see in other reports.
In my repro path, I did not select the offending model; I inherited the selection when I went from API-based billing to Pro-based billing. It was not clear at all to me that the model selection was the underlying cause of the error.
It is unknown to me whether the 1M model that caused the error is meant to be available for Pro but there's a bug preventing it, or if it's meant to be unavailable.
In either case, the error message does not help the user understand the underlying problem or know what to do to work around the problem.
Similar reports: #9940, #9649.
What Should Happen?
If a model is not available for Pro billing, it should say that the current model is incompatible with (currently selected, i.e., Pro) billing, and that the user should select an available model using /model.
Error Messages/Logs
API Error: 400 {"type": "error", "error":{"type":"invalid_request_error", "message":"This authentication style is incompatible with the long context beta header."?,"request_id":"req_011CVudFbvuXq9BvxsArA×ХК"}
Steps to Reproduce
- Run Claude Code using an account with API Usage Billing.
- Switch to
Sonnet 4.5 (1M context)(Note, I don't think I switched this manually, I started Claude Code a couple of weeks after last using it, and the 1M model was selected.) - Use
/loginto change to an account with Claude Pro billing. (I don't know if Sonnet 4.5 (1M context) is disallowed for Pro accounts, or if it's another bug that it doesn't work for some reason, like "incompatible with the long context beta header".) - Use a command that needs to call a model; I used
/init. - API Error: 400 occurs
Claude Model
Other, Sonnet 4.5 (1M context)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.61
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
Workaround: Use /model to switch to default for your account billing type.
Here's where I initially hit the 400 error:
<img width="2048" height="782" alt="Image" src="https://github.com/user-attachments/assets/ad2389a0-3b8e-446f-85bc-f95d08b2754c" />
After reading the other related bugs, it seemed like it was a model problem; here is where the 1M model was selected even though I had switched to Pro, which apparently doesn't have access to 1M, either because of a bug, or on purpose.
<img width="2037" height="906" alt="Image" src="https://github.com/user-attachments/assets/8aed346a-3257-4dcf-a263-dfdde017aa3a" />
After this screenshot, I switched to Default (Sonnet 4.5 · Best for everyday tasks) and everything proceeded.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗