Headroom

Does claude -p use your subscription limits?

Yes if you are signed in with a Claude plan and no API key is set. If an API key is present, claude -p always uses it and bills the API. Here are the details.

ยท 5 min read

Yes, when you are signed in with a Claude plan. Anthropic says that claude -p and the Agent SDK "still draw from your plan's usage limits" in that case. The catch is the API key: in -p mode, if an ANTHROPIC_API_KEY is present, the key is always used, and you are billed at API rates instead of drawing on your plan.

The default: plan limits

claude -p is print mode: it runs one prompt non-interactively and prints the answer, which is how scripts, cron jobs and CI call Claude Code. According to the Help Center article on monthly API credits, when you are signed in with a Claude plan, claude -p and the Agent SDK draw from your plan's usage limits. Runs started by the Claude Code GitHub Action, an IDE extension or the desktop app count as Claude Code usage too.

Those are the same shared limits as everything else. If a script burns through your session limit, your interactive session hits the same wall. The mechanics of the limits are in session vs weekly limits.

The exception: an API key always wins in -p

In interactive mode Claude Code asks once whether to use an ANTHROPIC_API_KEY and remembers your answer, which you can change with the "Use custom API key" toggle in /config. In non-interactive mode there is no question. The authentication docs say that with -p, "the key is always used when present".

Anthropic's Help Center puts the consequence plainly: with an ANTHROPIC_API_KEY set, Claude Code uses the key instead of your subscription, "resulting in API usage charges rather than using your subscription's included usage."

Users have reported exactly this surprise with -p runs (GitHub issue 43333). That is a user report, but it matches the documented behaviour.

To check a shell without printing the key itself:

if [ -n "${ANTHROPIC_API_KEY:-}" ]; then echo "ANTHROPIC_API_KEY is set"; else echo "ANTHROPIC_API_KEY is not set"; fi

Remember that a script run from cron, launchd or CI has its own environment, so check there too, and that a key can also arrive through an env block in a Claude Code settings file. To fall back to your subscription, unset ANTHROPIC_API_KEY and remove it from your shell profiles. More in why an API key overrides your subscription.

Using your plan from CI

A CI runner has no browser for /login. For that case the authentication docs describe claude setup-token, which runs the browser sign-in once on your machine and prints a one-year OAuth token (it requires a Claude subscription and does not save the token anywhere). You set it as CLAUDE_CODE_OAUTH_TOKEN in the runner. Keep the precedence in mind: ANTHROPIC_API_KEY ranks above CLAUDE_CODE_OAUTH_TOKEN, so if both are set, the key wins and the run bills the API. Read the terms section below before putting a subscription on a schedule.

Do the monthly API credits cover claude -p?

Max, Ultra and Team plans include monthly Claude Platform credits (as of November 2026). They do not cover interactive Claude Code, or usage credits. They cover claude -p only when it runs with an API key from the linked Console organization, per the same Help Center article. So signed in with your plan, -p uses plan limits; with a key from your linked Console organization, it can use those monthly credits. Pro and Enterprise are not eligible. The difference between the two kinds of credit is in monthly API credits vs usage credits.

Fable in -p mode can bill without asking

Interactively, when a Fable request would bill to usage credits, Claude Code shows a consent prompt. In -p mode it cannot. The model docs say: "Claude Code never asks for consent. When a Fable request there would bill to usage credits, Claude Code bills it without asking."

So if you pass --model fable in a script on a plan where Fable runs on usage credits and you have usage credits turned on, those requests are billed with no confirmation. As of November 2026 that covers Pro and Team Standard seats once the Fable 5.2 launch offer ends on November 16, and Max, Ultra and premium seats once their Fable weekly limit is used up, because Fable can then continue on usage credits. Pin the model deliberately in scripts. How to do it is in how to switch models in Claude Code.

Automatic continue is not offered

Interactive sessions can wait out a limit and continue by themselves. Anthropic's interactive mode docs say this is not offered in background sessions, -p runs, or with API keys. So a -p run that hits a limit will not sit and wait for the reset. See automatic continue after a limit. Design scripts to detect the failure and retry later instead of assuming it will wait.

Automation and the terms

One more point worth reading before you schedule anything. Anthropic's Consumer Terms say you may not, "Except when you are accessing our Services via an Anthropic API Key or where we otherwise explicitly permit it, ... access the Services through automated or non-human means, whether through a bot, script, or otherwise." Separately, Claude Code's legal and compliance page says: "Advertised usage limits for Pro, Max, and Ultra plans assume ordinary, individual usage of Claude Code and the Agent SDK." Anthropic's own docs describe claude -p drawing on plan limits. Whether a particular scheduled workload fits those terms is something to judge by reading them yourself.

An earlier announcement that was paused

Anthropic announced a change to bill Agent SDK and claude -p usage separately, then paused it. The Help Center notes: "Update June 15, 2026: We've paused the previously-announced changes to Claude Agent SDK usage. For now, nothing has changed." Because Anthropic changes limits and billing often, re-check the Agent SDK article before building on this.

Watching what scripts cost you

If scripts run under a subscription, they move the same session and weekly bars you use by hand. Headroom is a free menu bar app, independent and not made or endorsed by Anthropic, that shows those bars for every Claude Code account signed in on your Mac. It reads the sign-in Claude Code already saved on your Mac and never sends a prompt. It cannot see API-key billing, so it will not show spend from a -p run that is using a key. Download Headroom.