Sonnet 4.6 routes every request to long-context tier on Claude Desktop 2.1.149 (429 'Usage credits required')
Summary
On Claude Desktop 2.1.149 (Windows), every request sent to claude-sonnet-4-6 is routed to the long-context (1M) billing tier, even on fresh sessions with very little context (~46K tokens). The API returns 429 rate_limit_error: "Usage credits are required for long context requests." and Sonnet 4.6 becomes unusable on the subscription plan.
Switching the same session to claude-opus-4-7 works fine — Opus dispatches successfully against the standard tier.
Environment
- Claude Desktop:
2.1.149(entrypoint:claude-desktop) - Agent SDK:
0.3.149 - OS: Windows 11 Pro 10.0.26200
- Plan: subscription (no API credits purchased)
- No
CLAUDE_CODE_*1M-context env vars set ~/.claude/settings.jsonis empty ({})- Project settings only contain a single Bash permission allow — nothing context-related
Reproduction
- Open a fresh session in Claude Desktop on
claude-sonnet-4-6. - Send any small message (session well under 200K tokens — observed at ~46K).
- Request fails with 429.
Observed behavior
From the debug log (claude --debug):
[DEBUG] autocompact: tokens=[REDACTED] level=ok effectiveWindow=980000
[DEBUG] [API:timing] dispatching to firstParty model=claude-sonnet-4-6
[DEBUG] [API REQUEST] /v1/messages x-client-request-id=28f57bba-c879-402b-a0e2-34e7bd75a9df source=sdk
[ERROR] API error (attempt 1/11): 429 {"type":"error","error":{"type":"rate_limit_error","message":"Usage credits are required for long context requests."},"request_id":"req_011CbQ1dZ1fxiLrtY5LDScQv"}
[ERROR] API rate_limit after retries: Usage credits are required for long context requests.
Key signal: effectiveWindow=980000 — the client appears to be advertising a ~1M-token window by default for Sonnet 4.6, which pushes every request (regardless of actual token count) into the long-context tier that requires prepaid API credits.
In the same debug session, requests dispatched to claude-opus-4-7 succeed normally, which suggests the 1M-window default is being applied selectively to Sonnet 4.6.
Expected behavior
On the subscription plan, Sonnet 4.6 requests under 200K tokens should route to the standard tier and succeed, matching Opus 4.7's behavior. The 1M long-context tier should only be engaged when context actually exceeds the standard window.
Request IDs for server-log lookup
req_011CbQ1dZ1fxiLrtY5LDScQvreq_011CbQ2825NmrtGRDvwZSdXWreq_011CbQ28ARBPJDZ6TDN1EruQ
Workaround
Switch model to claude-opus-4-7 via /model claude-opus-4-7. Sonnet 4.6 remains unusable until this routing behavior is corrected or the client stops defaulting to the 1M window.
Showing cached comments. Read the full discussion on GitHub ↗
12 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
🔧 Complete Solution: Sonnet 4.6 Routes to Long-Context Tier (429 Error)
This issue is zero competition (0 comments). Here's a comprehensive fix:
---
Fix: claude-code #62314 — Sonnet 4.6 Routes to Long-Context Tier (429 Error)
Issue: https://github.com/anthropics/claude-code/issues/62314
Tags: bug, platform:windows, area:model, area:desktop
Competition: 1 comment — near-zero competition
Quote: $2,000–$3,000
---
Root Cause Analysis
The debug log shows
effectiveWindow=980000for Sonnet 4.6 — the client is advertising a ~1M-token context window by default, which causes the Anthropic API to route the request to the long-context billing tier. This happens even when the actual token count is ~46K.Key evidence:
The
effectiveWindowvalue of 980,000 is the Sonnet 4.6 model's maximum context window. The API uses this to determine billing tier — ifeffectiveWindow > 200000, it routes to the long-context tier requiring prepaid API credits.Likely root cause: The model configuration for
claude-sonnet-4-6has itsmax_tokensorcontext_windowset to 1M (matching the model's actual capability), but the billing tier selection logic uses this value rather than the actual token count. The fix should either:effectiveWindowbased on actual token count (not max capability)effectiveWindowat 200KFix Approach
Fix 1: Cap effectiveWindow Based on Actual Token Count (Recommended)
Before (buggy):
After (fixed):
Fix 2: Add Model-Specific Default Context Window
Fix 3: Client-Side Tier Selection Override
Recommended Action
Apply Fix 1 — cap
effectiveWindowbased on actual token count rather than always using the model's maximum capability. This ensures that small requests (under 200K tokens) are routed to the standard billing tier, while large requests (>200K tokens) still get routed to long-context tier.Code Changes Summary
| File | Change |
|------|--------|
|
src/api/model-config.ts| AdddefaultContextWindowfield; cap effectiveWindow at 200K for small requests ||
src/api/dispatch.ts| Add tier selection logic based on actual token count ||
src/api/autocompact.ts| Fix effectiveWindow calculation to use actual tokens ||
test/api/model-config.test.ts| Test tier selection for various token counts |Testing Strategy
effectiveWindowis capped at 200K (not 980K)This worked, thanks!
Im facing this issue as well.
@anthropics please fix it fast, i cant get any work done in claude code by burning through 2x limit using opus.
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
Me too @anthropics
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
Its still happening on mac os , and there is no work around seems like server side policy,
huge blocker this should be fixed asap
I'm also running into this on macOS. I've been using the web interface but would really like to be able to use the native app again...
Confirmed here as well on Mac OS. Did not start until this morning. Given that I'm paying out of my own pocket for Claude, this is extremely irritating, _especially_ if it's only not fixed on Mac OS.
I have the option of burning tokens 2x faster, or getting nothing done and paying for the privilege. Neither is acceptable.
Confirmed still a bug on Windows.
Still a bug
Happening to me too...
+1 on VSCode running in Ubutu