---
title: "What one headless agent run actually costs"
canonical: https://maxtokens.ai/posts/headless-agent-run-cost/
date: 2026-07-09
tags: [cost, agents]
description: "A publishing bot run feels free on a flat Claude plan. API pricing shows where the subsidy hides."
---
One run of my publishing bot feels almost free because it currently rides inside a flat Claude subscription. That feeling is useful for shipping, but it is not physics. The same headless run has an API-metered cost, and the only honest way to manage the pipeline is to price it before the subsidy disappears.

Anthropic has already shown the switch behind that subsidy. On June 15, 2026, usage from the Claude Agent SDK, `claude -p`, and third-party apps was announced as moving out of subscription limits and into a separate monthly credit bucket. The plan was paused the same day, and the [Claude support page](https://support.claude.com/en/articles/15036540-use-the-claude-agent-sdk-with-your-claude-plan) still says the old behavior remains in place: Claude Agent SDK, `claude -p`, and third-party app usage still draw from subscription usage limits.

That pause is not a guarantee that the subsidy lasts forever. It is a warning label.

## A run is a pipeline, not one prompt

When I say "one run" of the bot, I do not mean one clean model call. I mean a whole publishing pass: a fresh worktree, a Researcher pass, a Writer pass that produces Russian and English drafts, an Editor loop that checks tone and house style through several iterations, a gate with build and tests, then preview and promotion.

A blog post may look like a single artifact at the end, but tokens accumulate by stage and the billable shape is a chain of contexts. Research pulls in source material. Writing loads the brief, style rules, and draft state. Editing reloads the article and the standards it must satisfy. The gate may look cheap in human terms, but the agent still has to read enough project context to decide what to do.

My working hypothesis is blunt: the Writer is not the expensive part. Research, repeated context loading, and the Editor loop burn the tokens.

## The harness has a price before the task starts

Half the price of a headless run can be the harness: system prompt, `CLAUDE.md`, tool definitions, repository instructions, current task framing, and the accumulated context needed to act safely. A trivial command is not zero-cost because the model first has to load the room: instructions, tools, repository rules, and task context.

That is why "small task" and "cheap task" are not synonyms in agent work. The payload may be tiny. The context envelope is not.

This is the piece flat-rate usage hides best. In the chat product, the marginal cost feels like a click. In headless automation, every click is a staged execution environment with rules, memory, tools, and guardrails. If the same run were charged at API rates, the harness would show up as input tokens, cache writes, cache reads, and output tokens.

## What one headless agent run actually costs

The paused Anthropic change would have created a separate monthly Agent SDK credit bucket priced at the subscription fee — $20 for Pro, $100 for Max 5x, $200 for Max 20x — instead of that usage counting inside plan limits.

The arithmetic is then mechanical. Count tokens by stage. Apply model rates. Separate input, output, cache write, and cache hit.

The run is not single-vendor, which is what makes the bill worth reading. Research and the Editor loop run on Claude Opus 4.8 through `claude -p`. The Writer runs on GPT-5.5 through a separate Codex agent. One publishing pass, two providers, two subscriptions.

For Claude Opus 4.8, [Anthropic pricing](https://platform.claude.com/docs/en/about-claude/pricing) is $5 per million input tokens, $10 per million for 1-hour cache writes, $0.50 per million for cache hits, and $25 per million output tokens.

For GPT-5.5, [OpenAI pricing](https://developers.openai.com/api/docs/pricing) is $5 per million input tokens, $0.50 per million for cached input, and $30 per million output tokens.

Those numbers turn a vague feeling into a table:

| Stage | Model | Input | Output | Cache write | Cache hit | Cost |
| --- | --- | ---: | ---: | ---: | ---: | ---: |
| Research | Opus 4.8 | 52k | 18k | 98k | 462k | $1.93 |
| Writer | GPT-5.5 | 121k | 17k | — | 787k | $1.52 |
| Editor loop | Opus 4.8 | 134k | 131k | 464k | 1.65M | $9.40 |
| Total run | Opus + GPT-5.5 | 307k | 166k | 562k | 2.90M | $12.85 |

The gate is build and tests, not a model call, so it burns no tokens and does not appear in the table. The Writer's input column shows only uncached tokens; its 787k cached tokens sit in the cache-hit column at a tenth of the price.

The sticker version is simple: on the subscription, the run feels free.

The real version is the last cell: about $12.85 for one article. And the shape settles the hypothesis. The Writer is the cheap part at $1.52, twelve percent of the bill. The Editor loop is $9.40, seventy-three percent. Research is the remaining fifteen. The prose model is not where the money goes. The review model is.

<img src="/posts/headless-agent-run-cost/cost-by-stage-en.svg" alt="Cost of one run by stage: Research 15% ($1.93, Opus 4.8), Writer 12% ($1.52, GPT-5.5), Editor loop 73% ($9.40, Opus 4.8), about $12.85 total" width="760" height="290" loading="lazy" decoding="async" />

There is a second reading in the vendor column. Research and editing run on Anthropic, writing on OpenAI, so the paused June 15 subsidy only ever covered about 88 percent of this run. The Writer was never on that meter.

## The editor loop is where flat rate teaches bad habits

Flat pricing encourages a lazy shape: ask the Editor again, reload the same context again, nudge the tone again, rerun the gate again. The output improves, so the habit feels rational.

Sometimes it is rational. Quality control is the point of the bot.

The problem is that the subscription UI does not show the price of each extra pass. One more Editor iteration may be cheap when it reuses cache. It may be expensive when it rewrites context, reloads both drafts, and produces long critique. Without stage-level accounting, I cannot tell whether the pipeline is improving the article or paying repeatedly for the same instruction stack.

In this run the Editor loop is not hypothetically expensive. Across its iterations it produced 131k output tokens and 464k tokens of one-hour cache writes. Output at $25 per million and cache writes at $10 are the two priciest columns, and the Editor loop sits in both. That one stage costs nearly three times research and writing combined.

The first optimization target is not "use a cheaper model everywhere." It is the stage that wastes tokens. After that, the decision is concrete: shorten context, split the check, cache better, lower the model tier, or kill an iteration.

## Price your own run before the meter moves

Measure one real headless run now.

Log token usage per stage. Keep input, output, cache write, and cache hit separate. Price the run with current API rates for the models you use. Then keep both numbers in your head: the sticker price under the plan and the metered price under API billing.

For my bot, one measured run looks like this:

| View | Amount |
| --- | ---: |
| Subscription sticker price | $0 incremental, inside plan limits |
| API-priced total | ~$12.85 |
| Research (Opus 4.8) | $1.93 |
| Writer (GPT-5.5) | $1.52 |
| Editor loop (Opus 4.8) | $9.40 |

Flat-rate access is a subsidy. It may stay for a while. It may change again. Either way, knowing the real price of a run tells you where the agent is doing work and where the pipeline is just burning context because nobody put a meter on it.