Skip to content
AI Dev Toolkit.
Esc
  • Loading…

Claude Code · Server and limits

API Error: Usage credits required for 1M context

Claude Code’s “Usage credits required for 1M context” means your plan reaches the 1M-token window only through usage credits. Switch model or turn credits on.

Message

The exact error

Claude Code
API Error: Usage credits required for 1M context · run /usage-credits to turn them on (they take effect after you restart Claude Code), or /model to switch to standard context

Also appears as:

Before v2.1.268
API Error: Usage credits required for 1M context · run /usage-credits to turn them on, or /model to switch to standard context

Meaning

What does “Usage credits required for 1M context” mean?

The model you picked runs with the 1 million token context window, and your plan includes that window only as paid usage credits. Anthropic calls this an entitlement check, not an exhausted quota: it fires even when your session and weekly allowances have room left. On subscriptions it mainly affects the [1m] variants of Opus 4.6 and Sonnet 4.6. Newer models such as Opus 4.7 and later and Sonnet 5 run with the 1M window by default, so they don’t need the suffix.

Causes

Why do I see it when I still have usage left?

  • You selected a [1m] model, such as sonnet[1m], that your plan reaches only through usage credits
  • A [1m] model ID is set somewhere else: in settings, ANTHROPIC_MODEL or a --model flag
  • On older versions, the conversation grew past 200K tokens and every later request failed

Fix

How do I fix “Usage credits required for 1M context”?

  1. Switch to standard context

    Run /model and pick the same model without the [1m] suffix. The conversation stays, and it uses the standard window from then on.

  2. Or turn usage credits on

    Run /usage-credits to turn on metered billing for the 1M variant on Pro and Max, or to ask your admin for usage credits on Team and Enterprise. Then restart Claude Code or start a new session, as the message says: until then the session stays at the standard context.

  3. If it comes back after /model

    A 1M model ID is set elsewhere. Check, in order, the --model flag you start with, the ANTHROPIC_MODEL environment variable, the model field in your settings files and ANTHROPIC_DEFAULT_MODEL, and remove the [1m] suffix.

    macOS / Linux
    echo $ANTHROPIC_MODEL
    grep -n '"model"' ~/.claude/settings.json .claude/settings.json .claude/settings.local.json 2>/dev/null
    Windows PowerShell
    $env:ANTHROPIC_MODEL
    Select-String -Path "$HOME\.claude\settings.json", ".claude\settings.json" -Pattern '"model"'
  4. Hide the 1M variants entirely

    Set CLAUDE_CODE_DISABLE_1M_CONTEXT=1 to remove [1m] variants from the model picker and hold models that use 1M by default to a 200K window.

  5. On v2.1.171 or earlier, update

    Before v2.1.172 the error repeated on every request, /compact included, once the context passed 200K; /clear was the only way out. Run claude update: current versions compact the conversation back under the standard limit automatically.

Explained

Which plans include 1M context in Claude Code?

For the two models that need the [1m] suffix, Anthropic’s model configuration docs give this split. On Max, Team and Enterprise, Opus 4.6 with 1M context is included in the subscription, while Sonnet 4.6 with 1M context needs usage credits. On Pro, both need usage credits. With an API key or pay-as-you-go, both are fully available and billed at standard rates. Claude Code checks this only when it talks to the Anthropic API directly; behind an LLM gateway, the gateway decides.

A bigger window isn’t free in another way either: every turn re-sends the whole conversation, so a 600K-token session uses far more per message than a 100K one. The context window checker shows how much a document takes, and the guide to reducing Claude Code token usage covers keeping sessions small enough for the standard window. See Claude Code pricing for how plans and usage credits compare.

FAQ

Questions people ask

Why does it say usage credits are required when I haven’t hit my limit?

Because it isn’t a limit. It’s an entitlement check: your plan includes the 1M-token window for this model only through usage credits, so it fires even with session and weekly allowance left. Switch to the model without the [1m] suffix with /model, or turn usage credits on with /usage-credits and restart.

Do I need to do anything if the error appears in the middle of a long conversation?

Usually not. On current versions, when the context grows past 200K tokens and your plan doesn’t include 1M, Claude Code compacts the conversation back under the standard limit by itself and keeps the session there. On versions before v2.1.172 the error repeated, so update with claude update or run /clear.

Is the 1M context window more expensive per token?

On the Anthropic API, Anthropic’s docs say 1M context uses standard model pricing with no premium above 200K tokens, except on Haiku 5.5, which costs more on prompts over 100K tokens. On subscriptions that reach 1M through usage credits, those tokens are billed to usage credits. Long contexts still cost more in total because every turn re-sends them.

What does the [1m] suffix on a model name mean?

It selects the 1 million token context variant of a model that otherwise uses a smaller window, for example claude-sonnet-4-6[1m]. Only some models need it: Opus 4.7 and later, Sonnet 5 and later and the other newest models use 1M by default. Remove the suffix to go back to the standard window.

Related

Search all Claude Code errors

Keep exploring