[Bug] Anthropic API Error: Usage credits required for 1M context window with opus-plan model
Resolved 💬 62 comments Opened May 23, 2026 by SchoolNTeach Closed May 24, 2026
Bug Description
API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context
i have selected opusplan model and it if giving this error
Environment Info
- Platform: linux
- Terminal: gnome-terminal
- Version: 2.1.144
- Feedback ID: 4a247478-723a-4e14-8ce7-baf088094f03
Errors
[{"error":"Error: File does not exist. Note: your current working directory is /home/karan/KTX.\n at call (/$bunfs/root/src/entrypoints/cli.js:4277:11536)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-19T16:02:20.203Z"},{"error":"Error: File does not exist. Note: your current working directory is /home/karan/KTX.\n at call (/$bunfs/root/src/entrypoints/cli.js:4277:11536)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-19T16:02:22.925Z"},{"error":"Error: 403 {\"type\":\"error\",\"error\":{\"type\":\"permission_error\",\"message\":\"OAuth authentication is currently not allowed for this organization.\"},\"request_id\":\"req_011CbFYGspVvSohA3dsVMHGh\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:62192)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-21T10:16:01.082Z"},{"error":"Error: 403 The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:62192)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-22T03:57:27.565Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"Usage credits are required for long context requests.\"},\"request_id\":\"req_011CbKw24E6apmnSDPBkWpfj\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:62340)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-23T17:56:39.880Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"Usage credits are required for long context requests.\"},\"request_id\":\"req_011CbKw4tEfQYPsBm5SegixS\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:62340)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-23T17:57:18.700Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"Usage credits are required for long context requests.\"},\"request_id\":\"req_011CbKwztCvpye4UbaBt6yAq\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:62340)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-23T18:09:30.399Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"Usage credits are required for long context requests.\"},\"request_id\":\"req_011CbKx1f7f63ktgD3ZdQur3\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:62340)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-23T18:09:40.935Z"},{"error":"Error: 429 {\"type\":\"error\",\"error\":{\"type\":\"rate_limit_error\",\"message\":\"Usage credits are required for long context requests.\"},\"request_id\":\"req_011CbKxVqgBkSk8sNG5aMbXi\"}\n at generate (/$bunfs/root/src/entrypoints/cli.js:11:62340)\n at makeRequest (/$bunfs/root/src/entrypoints/cli.js:51:7694)\n at processTicksAndRejections (native:7:39)","timestamp":"2026-05-23T18:16:03.390Z"}]
62 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Did you manage to fix ? getting the same
same here
+1
I facing the same issue
Same here in Claude Code
this error caused by your context is getting bigger and touching the limit.
API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard contextjust clear the context and it will be fixed then u can do conversation again.
My Claude is working on Opus 4.7 1M - Claude Code
It's just showing this for Sonet 4.6 in Chat...
tried it many times, still same
Same here in Claude Code
Currently having the same issue with Claude Code.
Having the same issue - seems like some bug? No way to see how I hit this at all.
Note this is in Sonnet 4.6 Claude Cowork - "
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"
same here with 4.6
same here just now 4.6
<img width="427" height="215" alt="Image" src="https://github.com/user-attachments/assets/f7078b22-231b-4bb7-bc20-4968cb78fe2e" />
<img width="745" height="168" alt="Image" src="https://github.com/user-attachments/assets/b26d499c-03a4-4ef9-bf32-9d7404d7c276" />
If I switched the model it works
same here, API Error: Usage credits required for 1M context · turn on usage credits at claude.ai/settings/usage, or use --model to switch to standard contex
Same issue here, I just turned off the additional credit usage and on again and all my balance instantly went to Minus from like 40€. So did I loose 40€ in like 1 sec? It bypassed my limit by 223%.
<img width="1010" height="893" alt="Image" src="https://github.com/user-attachments/assets/4dd616fe-1f4b-4e51-b813-9d04965cc917" />
I am using the vscode extension with Claude Pro. I have credits to use when I hit my 5 hour rate limit. However, I suspect that Claude quietly switches to a 1M+ context window for complex task, and defaults to chewing through the credits before using the session allowance. I very quickly went from $11 to $22 (which is over my $20 monthly spend cap). I think that Clause should loudly surface when credits are being used preferentially.
this is some bullshit! seems liek clause is scamming us , I am so mad!
What worked for me. Im using the vs-code plugin.
I switched to 4.5 than I run /compact.
Switched back to 4.6 and now it is running again.
I am also getting the same error in Claude Code ( Mac ) while using Sonnet on the 20x Max plan
"API Error: Usage credits required for 1M context"<img width="1964" height="112" alt="Image" src="https://github.com/user-attachments/assets/b02de7b7-91a3-4750-aa09-d32f2e75a679" />
<img width="1848" height="822" alt="Image" src="https://github.com/user-attachments/assets/cc0ff6c6-5c56-453a-9b5a-1f2e5fb20a65" />
Has anyone found a fix for this?
Yeah, I got the same...
I am using Cowork
Same here. Im also using cowork and have 5x max plan
switched to the haiku model, sent a message, then re-selected 4.6, and it solved the problem
Change the model, then paste > disable 1M context in config, and use /compact. When done, switch back to your original model.
This is really some bull! You are already getting paid for the service, but why stop there when you can screw your users over even more!
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
Same issue here
constantly happening, why is it closed. sonnet does not compact. it fails into this
Same issue here. Switching to Opus allowed me to continue, but let's see how long this lasts.
<img width="910" height="538" alt="Image" src="https://github.com/user-attachments/assets/45e6c735-3e29-42dc-b094-d11528e664e7" />
<img width="1399" height="691" alt="Image" src="https://github.com/user-attachments/assets/022d5929-632a-4540-8f2d-612a32f278dd" />
same problem
same here, every 10 min or so
same here... It seems the sonnet context is not compacting and then maybe Claude is switching to 1M. Will this be gone when the window resets? Using Haiku for my tasks is pretty sub-optimal.
same
Same here
same
Same problem here unfortunately. It seems it can't compact context well enough, even if the /compact command is used.
same:(
same :/
same here
+1, I've dug a little bit deeper and tested more chats, it appears that Claude can't compact the context early enough, so it gets at 1M really quickly. I've also attempted to use /compact with no success, because when 1M context is reached it can't compact or do anything else without usage credits.
Error messages:
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
Error: Error during compaction: 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
On a different note, even switching models has no effect, and the "--model" command does not work.
I believe that an upgrade to Claude Code completely broke the context counter so Auto - Compacting doesn't work, and just stops working at 1M Context. A feasible workaround would be to periodically use the /compact command manually.
Same issue- 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
same issue and its closed issue?
<img width="1582" height="930" alt="Image" src="https://github.com/user-attachments/assets/918e57e5-b8fb-4505-9c3e-06ef226b9dc6" />
<img width="572" height="184" alt="Image" src="https://github.com/user-attachments/assets/524b0a89-2a73-46a1-90c8-6653a296bf23" />
Install Antigravity and run this for Windows- $path = "$env:USERPROFILE\.claude\settings.json"
$data = if (Test-Path $path) { Get-Content $path | ConvertFrom-Json } else { @{} }
if (-not $data.env) { $data | Add-Member -NotePropertyName env -NotePropertyValue @{} }
$data.env.CLAUDE_CODE_DISABLE_1M_CONTEXT = "1"
$data | ConvertTo-Json -Depth 10 | Set-Content $path
Same problem here:
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
okay thanks for the solution, i already testing on claude code and its works btw...
<img width="618" height="331" alt="Image" src="https://github.com/user-attachments/assets/fa51f6db-527c-4d7d-adc6-ce13aaca7274" />
Interestingly, Sonnet worked again for a while after I switched to Claude Code, but after some time the same problem came back, just like in VS Code.
It seems the issue may be specific to Sonnet rather than the editor itself.
<img width="1389" height="851" alt="Image" src="https://github.com/user-attachments/assets/800b32de-5365-43c0-88b3-c783867396df" />
When it happens (by Claude Code) I just switched to Haiku for example. But this shouldn't be happened, Claude!!!!
Same here.
I'm using Claude Code on macOS 26.
Each time, I have to switch to the Haiku model and then switch back to Sonnet. It’s so troublesome.
<img width="1024" height="77" alt="Image" src="https://github.com/user-attachments/assets/2a74d0d2-f6a7-445e-9fec-be321e0de7eb" />
@hieuhuynh93 Hi, I am currently using the Claude Pro version. This isn't an issue caused by my low version, but rather a bug in the Claude Code itself, right? Is there a solution?
Hello everyone, good morning.
For this problem, I followed the step-by-step instructions in the video.
https://www.youtube.com/watch?v=CHUSuK9ZB_Q
Specific
opusplan+ compaction failure scenario (Max plan)When using
opusplanwith a long plan-mode session (context accumulates over hours), exiting plan mode switches from Opus → Sonnet. If context exceeds ~200K, Sonnet requires 1M context — which fails on Max since only Opus 1M is included natively.The compounding problem: auto-compact and
/compactalso fail at this point, because they too require Sonnet 1M to process the large context. You're completely stuck with no way out from within the session.Workaround (manual):
/model haiku→/compact→ switch back toopusplan.Workaround (env var, from #61692): Set
CLAUDE_CODE_DISABLE_1M_CONTEXT=1— forces Sonnet to 200K, bypasses the credits gate, compaction works normally.Suggested fix:
opusplanshould auto-compact before switching Opus → Sonnet on plan-mode exit, ensuring context fits within standard Sonnet limits. Without this, Max users who do long plan sessions hit an unrecoverable error every single time they try to execute.Same issue here! With Claude Pro using Sonnet 4.6
<img width="996" height="272" alt="Image" src="https://github.com/user-attachments/assets/a809cfe6-87bf-40ef-a530-4a8818f0d8b7" />
@jungwL
It could be like that.
You can do something like my comment: change it to the Haiku model and then change it back to the Sonnet model.
Or try following the instructions from this one: #61692
I found a quick solution who worked for me every time:
<img width="702" height="428" alt="Image" src="https://github.com/user-attachments/assets/7156ab56-6b01-4baf-a9e2-16fd4fe25eb6" />
Seleciona Rewind, seleciona o ponto da conversa, assim ele vai iniciar novo chat compactado, assim não perde o contexto..
sim, mesma coisa que eu fale, mais eu tou usando o CLI , ñao deja fazer /compact (diz o mesmo: 1M token ... ) o unico jeito que eu encontre foi mudar a haiku. fazer /compact e voltar a opus/sonnet
mais sim, e issa solucao
desculpas pelo meu portugues
Fix that worked for me
exit form claude
open with an editor
~/.claude/settings.json
add to the settings.json the following line
"autoCompactEnabled": true
it should look something like this
{
"autoCompactEnabled": true
}
re-open claude and the issue should be gone.
I am experiencing the exact same issue on my end.
Same issue here.
Same issue.
Same issue, happening just while using Sonnet, with normal context window size, even with empty context after doing
/clear.