日本語

Claude Code: "Usage credits required for 1M context"

Blocked on a Pro or Max plan with no warning? Here is what actually recovers it — and what doesn't.

The error: 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 (newer builds say run /usage-credits ... or /model to switch to standard context). It hits paid Pro and Max users, on the CLI, the VS Code extension, the desktop app, and Cowork. As of this writing there is no official fix and no "fixed in version X" — so treat the steps below as recovery, not a permanent cure.

First: which situation are you in?

There are two different problems behind the same message. The fix is different for each, so check this first:

A. It started mid-session (the recoverable case)

What is happening: your session context grew past 200K tokens (often because auto-compaction didn't fire, or large tool outputs — e.g. MCP screenshots — piled up in the session). The next request silently escalates to the 1M-context tier, which is gated, so it gets blocked. The trick is that a smaller model can still compact the session even when Sonnet is blocked.

Confirmed recovery (reported working by multiple unaffiliated users):

1. Switch to a smaller model, compact, switch back

# resume the SAME session in a small model
claude --continue --model claude-haiku-4-5-20251001
# inside it:
/compact
# then resume in Sonnet again — the compacted context now fits
claude --continue --model claude-sonnet-4-6

Opus works too as the "compact in a different model" step. The point is that /compact succeeds in the smaller model where it was blocked in Sonnet.

2. If compact still won't run: prune large items from the session file

If huge images/screenshots are what pushed you over 200K, the compact itself can be too big to run. Trim the biggest items out of the session JSONL and resume. Find your session file under ~/.claude/projects/<project>/<session>.jsonl, make a backup, and replace the large type: image blocks in tool_result entries with small placeholders, then claude --resume <session>. (Always copy the .jsonl to .jsonl.bak first.)

3. Last resort: /clear

/clear reliably unblocks you, but it discards the session context. Use it only when the steps above fail and you can afford to lose the conversation.

Workarounds that do NOT work (save your time)

B. It fires on a fresh session at low usage (account/server-side)

If the error appears immediately on a brand-new session while your dashboard shows plenty of headroom, no confirmed local fix exists — the strongest signal in the issue threads is that this variant is tied to the account/server side, not your machine. Honest options:

Why Max users get hit too

It is easy to assume a Max plan is immune. It isn't: Sonnet's 1M context is not auto-included even on Max (Opus 1M is included; Sonnet 1M requires usage credits on every plan). So when a long Sonnet session escalates to 1M, Max plans hit the same gate as Pro.

Prevent it from recurring

A free, MIT-licensed set of guardrails for exactly this class of problem — pre-compact checkpoints, context-bloat guards, and cost-spike protection — lives in
cc-safe-setup. One command: npx cc-safe-setup.