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

[BUG] API Error: Usage credits required for 1M context

Open Zamhinio94 opened this issue 6 months ago • 72 comments

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?

Keep getting the 'API Error: Usage credits required for 1M context' error - however I still have usage remaining and it has not been more than usual amounts...

What Should Happen?

Claude should not give this error and work successfully

Error Messages/Logs

'API Error: Usage credits required for 1M context'

Steps to Reproduce

n/a

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

2.1.121

Claude Code Version

2.1.121

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Image Image

Zamhinio94 avatar May 28 '26 09:05 Zamhinio94

@claude grateful for help

Zamhinio94 avatar May 28 '26 09:05 Zamhinio94

same here

Bug Description On Max 20x plan with latest Claude Code (v2.1.154), I get: "API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context"

This appears even though 1M context is documented as included in Max plans with no extra usage required. The client seems to default to the 1M long-context tier instead of routing standard (<200K) requests to the standard tier.

Environment

  • Plan: Max 20x ($200/mo)
  • Claude Code version: 2.1.154 (latest on npm)
  • OS: [Windows / macOS / Linux — à compléter]
  • Model selected: [Opus / Sonnet — à compléter]

Expected behavior Requests under 200K tokens should use the standard tier and succeed without usage credits, since 1M context is included in my Max plan.

Actual behavior Every request is gated behind the 1M usage-credits requirement, blocking the session. Updating doesn't help (already on latest version).

Workaround /model → standard context lets work continue, but 1M (included in Max) remains unusable.

osetavoix avatar May 29 '26 01:05 osetavoix

Same issue here. The setting keeps the 1M token option disabled, but the issue still happens. Opening a new thread fixed it for a few hours, but the same error eventually came back. The issue is; Desktop's context is tied to your Anthropic account, not local machine config.

ADeravi avatar May 29 '26 08:05 ADeravi

This worked for me:

Turn off “usage credits to keep using Claude if you hit a limit”, then quit and reopen the app.

After that, turn it back on, quit and reopen the app again, then continue the chat.

Same issue here, I just did that and all my balance instantly went to Minus from like 40€

Image

1Demo avatar May 29 '26 09:05 1Demo

I am facing similar issue and I see similar bugs but no response.

Manish-Kumar94 avatar May 30 '26 12:05 Manish-Kumar94

I am experiencing the exact same issue. I have tried every single troubleshooting step and workaround mentioned here and in the documentation, but none of them resolved the problem.

To make matters worse, during my last session, this persistent error triggered an automated loop that rapidly and completely depleted all of my paid tokens within minutes, without me even making any substantial usage or writing much code.

This is a critical system-side glitch that is costing users real credits. Please investigate and fix this context/billing loop as soon as possible.

MRavandoust avatar May 30 '26 18:05 MRavandoust

메시지를 다시 보내 보세요. 계속 발생하면 저희가 조사할 수 있도록 피드백을 공유해 주세요.

API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard context 이전 메시지부터 대화를 다시 시작할 수 있습니다.

openc2023 avatar Jun 01 '26 01:06 openc2023

i also have this error randomly. usage limit is 0% yet cannot do anything. not sure whats going on

cjhudlin avatar Jun 01 '26 12:06 cjhudlin

I am also having this error. Usage limit and session limits remaining but cant use anything

parin-superalign avatar Jun 01 '26 13:06 parin-superalign

face the same issue.

oliver-zhao avatar Jun 02 '26 00:06 oliver-zhao

This cost me all my extra usage credits. somehow claude changes modes and starts using 1m context. silently used all my extra usage credits then i got this error, so i looked at usage, not near my limit, then i see all my extra credits gone. fails to auto compact message maybe? does not show token meter during error but i assume it something to do with that. so it changed to 1m context to handle the large message. first of all it needs to auto compact, second, if that fails, needs to warn user before auto switching to diff model context, third, do not use extra usage without user approval.

this is the one that cost me all my credits

Image

and this one today

Image

PPPAnimal avatar Jun 02 '26 09:06 PPPAnimal

Has anyone since found the solution ?

andrejpolacek123 avatar Jun 02 '26 14:06 andrejpolacek123

Start the new session

johnson-nadar avatar Jun 02 '26 15:06 johnson-nadar

i already tried restarting claude code multiple times

andrejpolacek123 avatar Jun 02 '26 16:06 andrejpolacek123

i already tried restarting claude code multiple times

Did you try closing the current Claude tab and opening a fresh tab?

Image

johnson-nadar avatar Jun 02 '26 18:06 johnson-nadar

i tried that multiple times also everything i found so far regarding this problem on github and like 10 different solutions claude gave me but nothing worked.

andrejpolacek123 avatar Jun 02 '26 18:06 andrejpolacek123

I am losing money now :( since all my additional credits are gone and I made the mistake of doing /usage-credits thinking it will be smart to only use additional credits once my free allowance for the Pro plan is done.

valsaach avatar Jun 02 '26 22:06 valsaach

I can confirm that for me 'Terminate claude code' and restarting the same has resolved the issue.

valsaach avatar Jun 02 '26 23:06 valsaach

I had to open a new chat tab, but thats what eventually let me use claude again, though I lost the context

Gib-git avatar Jun 03 '26 03:06 Gib-git

Same issue here. The workaround is pretty clunky: run /export, then start a new session.

kyle-huan avatar Jun 03 '26 07:06 kyle-huan