[BUG] API 400
Resolved 💬 49 comments Opened Sep 23, 2025 by The-Verscienta Closed Jan 12, 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?
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"This credential is only authorized
for use with Claude Code and cannot be used for other API requests."},"request_id":"req_011CTQeLCSF2vLvXXJ6DYtY8"}
This is with using claude code in the cli.
What Should Happen?
should not have this error
Error Messages/Logs
API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"This credential is only authorized
for use with Claude Code and cannot be used for other API requests."},"request_id":"req_011CTQeLCSF2vLvXXJ6DYtY8"}
Steps to Reproduce
I am not sure
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
1.0.120 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
49 Comments
I'm getting the same issue. And all the Claude GitHub actions are not working anymore either.
For me right now, login and logout are fixing the issue, but this issue seems to come back after a couple of hours
now i logout and login still can't solve this issue ...
have this issue too
same issue. any git related commands not work for me. login/logout doesn't help.
I have the same issue when run
claudein macbook terminalI have the problem as well
Same problem as well :)
started this morning
I just faced the same problem running Claude Code in PowerShell.
For now, logging out and logging back in has worked for me.
@ileardo that worked for me once , my second instructions resulted in the same error
I've been using it for an hour since relogging in, and so far there have been no problems. I'll edit this comment if it stops working.
Same issue - regardless of prompt or instance
Re/Login hasn't worked for me
Same problem as well.
resolved by deleting env var anthropic key
same error started this morning any solution anyone?
how can i do same because am using OAuth
See also #8046 and #8052
Same error for me when using claude-code terminal in VScode on Windows. It worked fine last night. Strange but the claude-code terminal works fine without error inside of a different set up > Windows, WSL VScode DDEV setup. No error there.
logout and login works for me.
Confirming
claude /loginfixes the problem for me, as per #8046I have the same problem on MacOS 15.6.1, CC 1.0.120. Re-login didn't fix. Update: it worked on a second attempt. Over the last few days, I was showing Opus access despite being on a Pro plan; now it is back to normal (Sonnet only).
I also have the same problem after logging in / out / in. macOS 15.6.1 CC 1.0.120
I found the cause of the problem, because after the claude code update, the recommended configuration was updated, but this recommended configuration is not applicable to Pro subscribers.
You can use the /model command to see the model currently used by Claude Code, which will output:
The default configuration uses the Opus 4.1 model, which is not available for the pro subscription, which is also the root cause of the error.
Select "3. Sonnet", problem solving.
Thank you @zorth44. You found the problem for my set up. It is working now after switching to Sonnet.
Logout and login solved the issue for me.
Also have this issue.
I’ve experienced this with an annual subscription, not expired. It wouldn’t even let me report the problem with ‘/feedback’
same
Thanks to @zorth44 .it works for me.
@zorth44 fix worked for me, but how claude code in github actions can be fixed? I tried to update credentials but doesn't work
@yuriyward - see my post here: https://github.com/anthropics/claude-code/issues/8046#issuecomment-3324496657
TLDR: You'll need to add "--model sonnet" to the "claude_args:" parameter of claude-code-review.yml
Does this mean that Claude Opus 4.1 is not included in Claude Pro anymore?
Not currently. It seems to come and go (I’ve only been using CC a month and we’d gone through different iterations on this).
I confirm what @lookbusy1344 says. When I started using CC 2 or 3 months ago (with a Pro account), only Sonnet was available. Opus showed up for 1-2 weeks for me, and now I see only Sonnet again. According to the Anthropic webpage, only Sonnet is available in CC with a Pro account, so I believe the temporary availability of Opus was a glitch.
@prtc yes my feeling too. A cautionary warning for us all to proof read what Claude puts into our code-bases 🙃
Although I’m not seeing the error from the command line any more, it’s still an issue with GitHub actions. Eg https://github.com/lookbusy1344/PicoArgs-dotnet/actions/runs/18008879575/job/51235820467
@lookbusy1344 - looking at your workflow definition, you haven't set the claude_args parameter to include '--model sonnet' This will fix the GitHub action.
@dusalex thanks for spotting that! It seems to be working now.
that fixed the issue in github actions for me:
claude_args: '--model sonnet'
getting the same error here
y
⎿ API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"This credential is only authorized for use with Claude Code and cannot be used for other API
requests."},"request_id":"req_011CTaGdEyjjdVZo6rjiNLsQ"}
happening to me too, specifying
/model sonnetsolves the issue for nowfor the recently released sonnet 4.5, use this instruction to fix it.
Tell this to your Claude Code or Codex Cloud
---
.github/workflows/claude.yml. In theRun Claude Codestep, setclaude_argsto--model claude-sonnet-4-5-20250929, preserving every other setting in the workflow..github/workflows/claude-code-review.yml. In theRun Claude Code Reviewstep, update theclaude_argsstring so it starts with--model claude-sonnet-4-5-20250929while leaving the quoted--allowed-toolslist untouched.Add model argument to Claude workflows, and push the branch.Good call. I second typing /model sonnet in the CLI pulled me out of this Error: 400...
I also had this issue, it was a MCP server causing it.
Deactivate all MCP's, restart, then check again, then activate one by one your MCP's to catch the one causing it.
Cheers ! :)
Changing the model with /model resolved this error message for me
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.