[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_

View original on GitHub ↗

49 Comments

etsraphael · 9 months ago

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

zorth44 · 9 months ago
I'm getting the same issue. And all the Claude GitHub actions are not working anymore either. For 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 ...

baget · 9 months ago

have this issue too

celloudiallo · 9 months ago

same issue. any git related commands not work for me. login/logout doesn't help.

yangcheng · 9 months ago

I have the same issue when run claude in macbook terminal

the-mgk · 9 months ago

I have the problem as well

pcldev · 9 months ago

Same problem as well :)

dcmumby · 9 months ago

started this morning

ileardo · 9 months ago

I just faced the same problem running Claude Code in PowerShell.
For now, logging out and logging back in has worked for me.

dcmumby · 9 months ago

@ileardo that worked for me once , my second instructions resulted in the same error

ileardo · 9 months ago
@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.

Jason-Gregoire · 9 months ago

Same issue - regardless of prompt or instance

yngwi · 9 months ago

Re/Login hasn't worked for me

junemargot · 9 months ago

Same problem as well.

Jason-Gregoire · 9 months ago

resolved by deleting env var anthropic key

nnamanibenjamin · 9 months ago

same error started this morning any solution anyone?

nnamanibenjamin · 9 months ago
resolved by deleting env var anthropic key

how can i do same because am using OAuth

dusalex · 9 months ago

See also #8046 and #8052

pcapp2114 · 9 months ago

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.

yangcheng · 9 months ago

logout and login works for me.

oshoma · 9 months ago

Confirming claude /login fixes the problem for me, as per #8046

prtc · 9 months ago

I 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).

rawestmoreland · 9 months ago

I also have the same problem after logging in / out / in. macOS 15.6.1 CC 1.0.120

zorth44 · 9 months ago

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:

│  Select Model                                                                │
│  Switch between Claude models. Applies to this session and future Claude     │
│  Code sessions. For custom model names, specify with --model.                │
│                                                                              │
│     1. Default (recommended)   Opus 4.1 for up to 50% of usage limits,       │
│                                then use Sonnet 4                             │
│     2. Opus                    Opus 4.1 for complex tasks · Reaches usage    │
│                                limits faster                                 │
│   ❯ 3. Sonnet                  Sonnet 4 for daily use ✔                      │
│     4. Opus Plan Mode          Use Opus 4.1 in plan mode, Sonnet 4           │
│                                otherwise

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.

pcapp2114 · 9 months ago

Thank you @zorth44. You found the problem for my set up. It is working now after switching to Sonnet.

TeoIlie · 9 months ago

Logout and login solved the issue for me.

MichaelJamesHofer · 9 months ago

Also have this issue.

lookbusy1344 · 9 months ago

I’ve experienced this with an annual subscription, not expired. It wouldn’t even let me report the problem with ‘/feedback’

JTarball · 9 months ago

same

nebula5725 · 9 months ago

Thanks to @zorth44 .it works for me.

yuriyward · 9 months ago

@zorth44 fix worked for me, but how claude code in github actions can be fixed? I tried to update credentials but doesn't work

dusalex · 9 months ago

@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

etsraphael · 9 months ago

Does this mean that Claude Opus 4.1 is not included in Claude Pro anymore?

lookbusy1344 · 9 months ago
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).

prtc · 9 months ago

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.

lookbusy1344 · 9 months ago
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 🙃

lookbusy1344 · 9 months ago

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

dusalex · 9 months ago

@lookbusy1344 - looking at your workflow definition, you haven't set the claude_args parameter to include '--model sonnet' This will fix the GitHub action.

lookbusy1344 · 9 months ago

@dusalex thanks for spotting that! It seems to be working now.

sansan88 · 9 months ago
@lookbusy1344 - looking at your workflow definition, you haven't set the claude_args parameter to include '--model sonnet' This will fix the GitHub action.

that fixed the issue in github actions for me:
claude_args: '--model sonnet'

Faizan-Afzal2 · 9 months ago

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"}

paquettej · 9 months ago

happening to me too, specifying /model sonnet solves the issue for now

PabloLION · 9 months ago

for the recently released sonnet 4.5, use this instruction to fix it.
Tell this to your Claude Code or Codex Cloud

---

  1. Open .github/workflows/claude.yml. In the Run Claude Code step, set claude_args to --model claude-sonnet-4-5-20250929, preserving every other setting in the workflow.
  2. Open .github/workflows/claude-code-review.yml. In the Run Claude Code Review step, update the claude_args string so it starts with --model claude-sonnet-4-5-20250929 while leaving the quoted --allowed-tools list untouched.
  3. Save both workflow files, commit with a message such as Add model argument to Claude workflows, and push the branch.
  4. Open a PR describing that the general and review Claude workflows now request the Sonnet 4.5 model.
robjfr · 9 months ago
happening to me too, specifying /model sonnet solves the issue for now

Good call. I second typing /model sonnet in the CLI pulled me out of this Error: 400...

nicolas-geysse · 9 months ago

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 ! :)

NurseWellnessDev · 8 months ago

Changing the model with /model resolved this error message for me

github-actions[bot] · 7 months ago

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.

github-actions[bot] · 6 months ago

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.

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.