claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Bug] Anthropic API Error: Credential Restricted to Claude Code

Open lookbusy1344 opened this issue 1 year ago • 31 comments

Bug Description On my initial request I'm getting: 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_01XXXXXX"}

Environment Info

  • Platform: darwin
  • Terminal: Apple_Terminal
  • Version: 1.0.120
  • Feedback ID:

Errors

[{"error":"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_011CTR9KfL6jha6UVBXWVX4Q\"}\n    at new B5 (unknown:1:28)\n    at new OY (/$bunfs/root/claude:842:1962)\n    at new RG0 (unknown:1:28)\n    at generate (/$bunfs/root/claude:842:2419)\n    at makeRequest (/$bunfs/root/claude:859:5359)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-09-23T10:05:16.884Z"},{"error":"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_011CTR9MF7sQRPojoinMNyGM\"}\n    at new B5 (unknown:1:28)\n    at new OY (/$bunfs/root/claude:842:1962)\n    at new RG0 (unknown:1:28)\n    at generate (/$bunfs/root/claude:842:2419)\n    at makeRequest (/$bunfs/root/claude:859:5359)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-09-23T10:05:38.284Z"},{"error":"Error\n    at nN (/$bunfs/root/claude:536:1083)\n    at B1 (/$bunfs/root/claude:537:9957)\n    at emit (node:events:92:22)\n    at endReadableNT (internal:streams/readable:862:50)\n    at processTicksAndRejections (native:7:39)\n    at request (/$bunfs/root/claude:539:2105)\n    at processTicksAndRejections (native:7:39)","timestamp":"2025-09-23T10:06:34.576Z"}]

lookbusy1344 avatar Sep 23 '25 10:09 lookbusy1344

same problem

superman1006 avatar Sep 24 '25 06:09 superman1006

same

TimBroddin avatar Sep 24 '25 07:09 TimBroddin

Logging out and back in fixed it for me.

lookbusy1344 avatar Sep 24 '25 07:09 lookbusy1344

Nevermind, my subscription has expired.

TimBroddin avatar Sep 24 '25 07:09 TimBroddin

Same , and my subscription has not expired

cptfinch avatar Sep 24 '25 09:09 cptfinch

I’ve got a current annual subscription. I need to try another computer to see if it’s common to them all or just on that one machine.

lookbusy1344 avatar Sep 24 '25 09:09 lookbusy1344

same problem

icaca avatar Sep 24 '25 13:09 icaca

Same ... hope a fix will come soon

amiavia avatar Sep 24 '25 18:09 amiavia

What is going on here? I can't use Claude Code and get this API error. So, I typed "/status" and it tells me I'm using Opus 4, but Pro plan doesn't have access to Opus 4. So, I typed exit, then relaunched as "claude --model sonnet" and it's fine now. Wacky!!

jmmirabile avatar Sep 25 '25 02:09 jmmirabile

I notice that its as change the default model to opus. Since pro sub don't have access to opus model with the pro credential, it output error. Use /model to change back the default model to sonnet

mg-dev25 avatar Sep 25 '25 19:09 mg-dev25

Anyone having problems with GH workflows can fix them as in this commit https://github.com/lookbusy1344/PicoArgs-dotnet/commit/957f6639d0aa92a69845ab5973e12921ade074d8

lookbusy1344 avatar Sep 25 '25 19:09 lookbusy1344

Same issue for me as well:

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

beavinash avatar Sep 26 '25 06:09 beavinash

same issue

mattmar10 avatar Sep 26 '25 23:09 mattmar10

same here...

haddock-development avatar Oct 05 '25 20:10 haddock-development

Same problem - my solution was to revert to a previous V of the plugin. Worked immediately.

glennrmilano avatar Nov 29 '25 16:11 glennrmilano

How is this STILL an issue?! And yes, I am also seeing this.

MikeGitIt avatar Dec 19 '25 09:12 MikeGitIt

Same here XD

pivattogui avatar Jan 09 '26 02:01 pivattogui

im facing the same issue just today, same with my brothers and sisters. using opencode too guys.

engrjcrv avatar Jan 09 '26 03:01 engrjcrv

same here, was using opencode to connect to my pro claude plan, worked fine yesterday, now broken

vimcity avatar Jan 09 '26 03:01 vimcity

yes, facing the same issue. was trying with opencode and i got this error.

devaxai avatar Jan 09 '26 05:01 devaxai