CLI returns "API Error: Rate limit reached" on every command including logout (native binary, Max plan)

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 10 comments · opened Feb 21, 2026 · closed Apr 19, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

Bug Description

Claude Code CLI v2.1.49 (native binary install) immediately returns "API Error: Rate limit reached" on every command, including claude logout. The CLI is completely unusable.

Claude Code Desktop app works fine on the same machine and account.

Environment

  • Claude Code version: v2.1.49 (native binary install via curl -fsSL https://claude.ai/install.sh | sh)
  • Plan: Claude Max (Opus 4.6, 1M context)
  • OS: macOS 26.3 (Build 25D125)
  • Architecture: Apple Silicon (M1 Pro, arm64)
  • Shell: Zsh with oh-my-zsh

Steps to Reproduce

  1. Open terminal
  2. Run claude → "API Error: Rate limit reached"
  3. Run claude logout → "API Error: Rate limit reached"

Any command triggers the same error immediately.

Expected Behavior

  • claude should start an interactive session
  • claude logout should not make API calls that can be rate-limited

Actual Behavior

Every command, including logout, returns "API Error: Rate limit reached" before doing anything useful.

Troubleshooting Attempted

  • claude logout → same rate limit error
  • Checked ~/.claude/.credentials.json → file does not exist (auth is in macOS Keychain)
  • Checked for stale ANTHROPIC_API_KEY env var → none set
  • Desktop app works fine with the same account

Additional Context

  • No .credentials.json file in ~/.claude/ (expected for Keychain-based auth)
  • The error appears instantly, not after extended usage
  • This has persisted across sessions — it's not a temporary rate limit

View original on GitHub ↗

10 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/26812
  2. https://github.com/anthropics/claude-code/issues/26699
  3. https://github.com/anthropics/claude-code/issues/26821

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Marviel · 6 months ago

This just happened to me as well.

=== Claude Code ===
2.1.50 (Claude Code)
=== OS ===
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.5 LTS
Release:        22.04
Codename:       jammy
=== Arch ===
x86_64
=== Shell ===
/bin/bash
=== Node ===
v20.20.0
=== npm ===
10.8.2
=== Install method ===
/home/ubuntu/.local/bin/claude
=== API Key env ===
(not set)

EDIT:

This was resolved for me — the issue was caused by selecting the sonnet 1M model, which isn't available on the Claude Max plan. Instead of returning a clear "model not available" error, the CLI returns "API Error: Rate limit reached," which is misleading. The fix was switching to a supported model. Leaving this open as the error message should be improved — a model availability error shouldn't surface as a rate limit error.

ShakataGaNai · 6 months ago

Same. But I'm on standard Opus.

depoledna · 6 months ago

Same issue here, im using Max plan and I was running opus in 1m context window until rate limited. 200k models work fine for me in CLI. I did not find anything when the rate limit is reset for this exact model as the dashboard does not show the Claude Code limits I assume...

jizhi0v0 · 6 months ago
This just happened to me as well.我也刚经历过这种情况。 `` === Claude Code === 2.1.50 (Claude Code) === OS === No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04.5 LTS Release: 22.04 Codename: jammy === Arch === x86_64 === Shell === /bin/bash === Node === v20.20.0 === npm === 10.8.2 === Install method === /home/ubuntu/.local/bin/claude === API Key env === (not set) `` EDIT:编辑: This was resolved for me — the issue was caused by selecting the sonnet 1M model, which isn't available on the Claude Max plan. Instead of returning a clear "model not available" error, the CLI returns "API Error: Rate limit reached," which is misleading. The fix was switching to a supported model. Leaving this open as the error message should be improved — a model availability error shouldn't surface as a rate limit error.这个问题后来解决了——问题是因为选择了Sonnet 1M型号,而Claude Max套餐没有这个型号。它没有返回明确的“型号不可用”错误,而是返回“API 错误:速率上限已达”,这具有误导性。解决办法是切换到支持的型号。保持开放状态,错误信息应当改进——模型可用性错误不应以速率限制错误的形式出现。

This helped me; I chose the OPUS 1m plan, which wasn't supported by my MAX 5X plan.

nromey · 5 months ago

I'm now receiving this error. I was working just fine throughout the day, I'm way under my limits and now get the error. Very odd indeed.

MichalKantor · 5 months ago

SOLVED
I had same issue - only in CLI in cursor on mac.
Solved by

  1. uninstalling claude: npm uninstall -g @anthropic-ai/claude-code

but claude still works in terminal

  1. finally I had mess in installations (two installations since claude changed npm installation) : which -a claude

It showed more installations so:

  1. Removed manually:

rm -f ~/.local/bin/claude
rm -rf ~/.local/share/claude
rm -rf ~/.claude
(eventually: bun uninstall -g @anthropic-ai/claude-code)

  1. New Installation :

npm install -g @anthropic-ai/claude-code

Problem was that claude used API based account on claude.com instead of my max plan on claude.ai
Logging in and out didn't change anything, but finally reinstalling solved the problem.

Regards,
Michal

ssolders · 5 months ago

Was resolved for me with a /logout and then restarting claude cli. Only restart did not resolve it.
This happened to me after I downgraded from max to pro

ashwin-ant collaborator · 4 months ago

This was fixed in v2.1.88 — Fixed misleading "Rate limit reached" message when the API returned an entitlement error (e.g. 1M context without Extra Usage) — now shows the actual error with actionable hints (/extra-usage or /model to switch). If you're still seeing this in the latest version, please comment with your version and repro and we'll reopen.

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