[Bug] Anthropic API Error: Usage credits required for 1M context window
Resolved 💬 16 comments Opened May 19, 2026 by SlimeyD Closed May 31, 2026
Bug Description
Getting an error when trying to use sonnet xAPI Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context
Environment Info
- Platform: darwin
- Terminal: cursor
- Version: 2.1.145
- Feedback ID: 55d4d99b-83c9-4d3f-9c24-b8128d1b991c
Errors
[]
16 Comments
Claude give me the awnser:
Open VS Code
click Ctrl + Shift + P
Typ Open User Settings JSON
add this line: "claudeCode.defaultModel": "claude-sonnet-4-6"
Restart
Temporary Workaround Fix: set flag
CLAUDE_CODE_DISABLE_1M_CONTEXT=1. Quit and relaunched Claude Codestill same problem !!!!!!!!!!!!!!
My experience, using Sonnet 4.6 at medium effort in a named session.
I put into settings.local.json:
and re-started the named session. No effect.
But a clean session was unaffected.
So, in that session, I had claude produce a briefing of what it had been doing in that previous named session.
This was enough to get me going again.
This did NOT fix it for me.
i got this today on every session , although i set the CLAUDE_CODE_DISABLE_1M_CONTEXT var in settings.local.env
pessoal mesmo problema aqui
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
<img width="743" height="397" alt="Image" src="https://github.com/user-attachments/assets/865964f8-be33-433c-82ec-894a1ab8252f" />
Still getting this error with version 2.1.259 after updating Claude Code and reloading VSC. Anything else I need to do?
Only thing that fixes it for me is to close the session and open a new one. When the context gets too big, it's too big until you allow and pay for more.
the bug is in the chat itself not in the extension. open another chat and the bug is gone
<img width="518" height="300" alt="Image" src="https://github.com/user-attachments/assets/33fe1d85-f0a1-4464-9ec4-d74ac8b44bf8" />
They seem to have changed this
https://code.claude.com/docs/en/model-config#extended-context-with-1m
/compact command solved problem for me. I could continue to use same session after compacting.
That does work sometimes, not always though.
Okay, i got same error again today, and compacting didnt solve it, and doing remote connection (/remote_connection or /rc) and then using it from remote session worked. not real solution but can be helpful.
Yeah, it seems erratic at best. Today I worked for exactly 10 min before it said I ran out of tokens and had to wait for 3 hours for the next token re-up.
And again