[Bug] Anthropic API Error: Credential Authorization Restriction

Resolved 💬 16 comments Opened Sep 23, 2025 by kummar Closed Jan 8, 2026

Bug Description
⎿  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_011CTRRgxPidZvEEirG5recn"}

Environment Info

  • Platform: darwin
  • Terminal: iTerm.app
  • Version: 1.0.120
  • Feedback ID:

Errors

[{"error":"AxiosError: Request failed with status code 403\n    at MN (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:715:1077)\n    at Unzip.J0 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:716:9955)\n    at Unzip.emit (node:events:519:35)\n    at Unzip.emit (node:domain:489:12)\n    at endReadableNT (node:internal/streams/readable:1701:12)\n    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)\n    at OQ1.request (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:718:2088)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async KB5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1986:480)\n    at async Promise.all (index 0)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1972:6855","timestamp":"2025-09-23T13:41:16.505Z"}]

View original on GitHub ↗

16 Comments

rawestmoreland · 9 months ago

I'm also seeing this inside the anthropic github actions.

 "result": "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_011CTRTnR1ym12LUXqdSxo7B\"}",
ksarangmath · 9 months ago

https://github.com/anthropics/claude-code/issues/8042
https://github.com/anthropics/claude-code/issues/8046
some people have fixed the issue by logging out (/logout) and logging back in
others have fixed the issue by switching their model to sonnet (/model)

JWBWork · 9 months ago

Changing the model to sonnet with /model fixed this for me

JoshuaMarden · 9 months ago

@JWBWork You're an officer and a gentleman.

Y2Data · 9 months ago

@JWBWork fixed it for me. Thank you

JoniUzan · 9 months ago

Im getting this error in GitHub action after Claude set up on code review and when i mention Claude on on issues
the /model solve the error in my cli but not in GitHub action

alperensert · 9 months ago

For @JoniUzan and others experiencing this error during the setting the GitHub Actions Workflow can resolve the issue by modifying the model with claude_args as follows: --model claude-sonnet-4-20250514

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

We have the same error, but the default model for us was claude-3-5-haiku-20241022. We are using this version: anthropics/claude-code-action@v1.0.8

haddock-development · 9 months ago

same here...

paultiplady · 9 months ago
Changing the model to sonnet with /model fixed this for me

I got this error when i tried to switch from sonnet to opus; is there a solution to this error that lets me use opus instead?

I did see this warning: Approaching Opus usage limit · /model to use best available model but I'd hope for a different error if I hit my Opus token limit.

RimshaKhanSherwani · 8 months ago
Changing the model to sonnet with /model fixed this for me

@JWBWork why we need to change the modal to fix this issue?

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.

engrjcrv · 6 months ago

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

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