claude-code - 💡(How to fix) Fix [BUG] 401 "Access denied due to missing subscription key" error in v2.1.94 (regression from v2.1.92) [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45142Fetched 2026-04-09 08:12:16
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Timeline (top)
labeled ×6commented ×1

Error Message

Starting with v2.1.94, Claude Code returns a 401 error on every request. The same setup works correctly on v2.1.92.

Error Messages/Logs

  1. Error is returned immediately This appears to be a regression introduced in v2.1.94. The error message format ("subscription key") suggests it may be related to a change in how the API key is

Fix Action

Fix / Workaround

Workaround

Downgrade to v2.1.92:
npm install -g @anthropic-ai/[email protected]

Code Example

401 Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Starting with v2.1.94, Claude Code returns a 401 error on every request. The same setup works correctly on v2.1.92.

What Should Happen?

Requests succeed as they did on v2.1.92.

Error Messages/Logs

401 Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.

Steps to Reproduce

  1. Upgrade Claude Code from v2.1.92 to v2.1.94
  2. Run any Claude Code command
  3. Error is returned immediately

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.92

Claude Code Version

2.1.94

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Actual Behavior

All requests fail with 401 — missing subscription key.

Workaround

Downgrade to v2.1.92:
npm install -g @anthropic-ai/[email protected]

Environment

  • Claude Code version (broken): v2.1.94
  • Claude Code version (working): v2.1.92

Notes

This appears to be a regression introduced in v2.1.94. The error message format ("subscription key") suggests it may be related to a change in how the API key is
passed in request headers.

extent analysis

TL;DR

Downgrade to v2.1.92 to resolve the 401 error issue with Claude Code.

Guidance

  • The issue appears to be a regression introduced in v2.1.94, so downgrading to the last working version (v2.1.92) is a viable workaround.
  • Verify that the error is resolved by running Claude Code commands after downgrading.
  • If downgrading is not feasible, investigate how the API key is passed in request headers, as the error message suggests a potential issue with this process.
  • Consider reporting this issue to the developers or waiting for a patch release that addresses this regression.

Example

No code snippet is provided, as the issue does not require a specific code change to resolve.

Notes

The provided workaround (downgrading to v2.1.92) may not be a long-term solution, and the root cause of the issue (related to the API key in request headers) should be investigated further.

Recommendation

Apply workaround: Downgrade to v2.1.92, as it is a confirmed working version and allows for continued use of Claude Code while the regression is addressed.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING