Skip to main content
Watch: I Built an AI App Without Leaving Databricks

Claude Code error

Claude Code: API Error: Usage credits required for 1M context · run /usage-credits...

Error message
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

Status: By designLast verified 4 documented fixes2 sources

What it means

The selected model uses the 1M-token extended context window and your plan only includes it through usage credits. This is an entitlement check, not quota exhaustion, and fires even when session and weekly allowances have capacity.

Causes

  • Explicitly selecting a [1m] model on a plan that includes 1M context only via usage credits
  • A 1M model ID set elsewhere in configuration

How to fix it

  1. Fix 1.

    Run /model and select the variant without the [1m] suffix.

    Slash command
    /model
  2. Fix 2.

    Run /usage-credits to turn on metered billing for the 1M variant (Pro and Max) or request credits from your admin, then restart Claude Code.

    Slash command
    /usage-credits
  3. Fix 3.

    To remove 1M variants from the model picker entirely, set CLAUDE_CODE_DISABLE_1M_CONTEXT=1.

    TOML
    CLAUDE_CODE_DISABLE_1M_CONTEXT=1
  4. Fix 4.

    On versions before v2.1.172, the error repeated on every request including /compact; run /clear on those versions.

    Slash command
    /clear

More Claude Code errors

All 18 Claude Code errors

FAQ

What does "API Error: Usage credits required for 1M context · run /usage-credits..." mean in Claude Code?

The selected model uses the 1M-token extended context window and your plan only includes it through usage credits. This is an entitlement check, not quota exhaustion, and fires even when session and weekly allowances have capacity.

How do I fix "API Error: Usage credits required for 1M context · run /usage-credits..."?

There are 4 documented fixes. Start with the first: Run /model and select the variant without the [1m] suffix.

Is this Claude Code error fixed?

Status: By design. Expected behavior, not a bug. The documented fixes change the setup that triggers it. Affected versions: Before v2.1.172 the error looped mid-conversation; message wording updated in v2.1.268; v2.1.113 fixed compacting a resumed long-context session failing with "Extra usage is required for long context requests".

Sources

Last verified against 2 sources: official docs, maintainer replies and release notes.

Newsletter

Fixes for the tools you use, weekly

One email per week. New coding agent releases, what broke, and how developers are working around it.