Guide · Costs

What a coding agent run really costs (and how to spend less)

The price per token is the smallest lever. What drives cost is how many runs it takes to get a mergeable PR — set mostly by the story, the size of the task and how fast the agent gets feedback. Plus the hidden bills.

Mio Nilsson, creator of AerunitBy · Last updated

Glowing crystal coins and a stream of light particles narrowing through a prism
The invoice

How agents are billed

Per token at API rates

Cursor: "Cloud Agents are charged at API pricing for the selected model … a larger context window can increase token usage and costs." [1]

Included in a plan, with shared limits

OpenAI Codex is included in ChatGPT plans and shares usage with ChatGPT [6]; Claude Code cloud sessions share rate limits with all other Claude usage on your account. [10]

Plan plus metered usage

GitHub Copilot cloud agent "uses GitHub Actions minutes and AI credits." [8]

Whatever the model, bigger contexts cost more. On Anthropic's API, for example, input, output and cache reads are priced separately per million tokens. [2]

Measure the right thing

The real unit: cost per merged PR

A cheap run that gets thrown away costs more than an expensive one that merges. So measure what you actually want:

Cost per merged PR
cost per merged PR =
  (agent spend + CI spend + review hours × hourly cost)
  ÷ PRs merged

Example (illustrative):
  Story A, vague:  4 runs × $3 + 4 CI runs × $0.40 + 60 min review  → 1 PR
  Story B, sharp:  1 run  × $5 + 1 CI run  × $0.40 + 15 min review  → 1 PR

The numbers are made up; the shape isn't. Story B's run was more expensive, and it's still far cheaper — mostly because of the review line.

What drives it up

The multipliers

Vague stories

Each misunderstanding is a rework run. See our guide to stories for coding agents.

Tasks too big for one run

Long runs fill the context, and quality drops as it fills.

Slow feedback

The agent pushes, waits for CI, fixes, pushes again — every loop is tokens plus CI minutes.

Overlapping parallel work

Two agents in the same files means conflict-resolution runs nobody planned for.

On the context point, Claude Code's docs are direct: "Claude's context window fills up fast, and performance degrades as it fills." [4] More on writing work that runs right the first time in our guide to stories for coding agents.

What works

Cost levers that work

Sharp stories

Acceptance criteria and non-goals cut rework runs more than any pricing change.

Smaller slices

One story, one run, one reviewable PR.

Fast local checks

Let the agent find problems before it pushes — see our guide to instant feedback.

Reuse context

Prompt caching makes repeated context much cheaper: on Anthropic's API, cache reads are priced at a fraction (0.1×) of base input. [3] Clearing context between unrelated tasks keeps runs lean. [4]

Right-size the model

Use the strongest model where judgment matters and a cheaper one for mechanical changes.

Off the invoice

The hidden bills

CI minutes scale with agent PR volume. GitHub gives each account a quota of free minutes, and "any usage beyond the included amounts is billed to your account." [7] Two tactics help: cancel runs that a newer push has superseded, and run the expensive suites only when a PR is marked ready to merge.

.github/workflows/ci.yml (excerpt)
on:
  pull_request:
    # 'labeled' is needed so adding the label triggers the run
    types: [opened, synchronize, labeled]

concurrency:
  group: ci-${{ github.ref }}
  cancel-in-progress: true

jobs:
  e2e:
    if: contains(github.event.pull_request.labels.*.name, 'ready-to-merge')

GitHub documents cancel-in-progress for exactly this. [9] The largest line item of all doesn't appear on any invoice: review time. It grows with every PR, which is why the levers above matter more than the price per token.

In our own repositories, agent pull request volume rose about 2.4× in one month. Cancelling superseded runs, trimming CI jobs and running end-to-end tests only on ready-to-merge PRs cut CI cost per PR by about 27–30% — but the monthly total still went up, because there were so many more PRs. Budget per PR, not per month.

Teams

Budgeting for a team

Three models dominate: prepaid credits, subscriptions with usage limits, and per-seat plans. The trade-off is between predictability and waste. Per-seat and subscription plans are predictable but pay for idle seats and hit limits at the worst moment. Prepaid credits track real use. A shared team pool lets the person running five agents this week borrow from the person on holiday; per-person limits protect against one runaway run.

Whatever you pick, budget per merged PR, not per seat.
Where we come in

Where Aerunit fits

Aerunit is billed the way this guide recommends thinking about cost: prepaid, pay-as-you-go credits in one pool per team, with no subscription. Agent runs themselves are billed by Cursor on your own Cursor account; Aerunit credits cover Aerunit's work — writing stories, dispatching and reviewing.

It also works on the biggest multiplier — rework runs. The story writer proposes Linear issues with scope, acceptance criteria and non-goals, and dependency-aware dispatch only starts a slice once the issue blocking it has merged, so agents don't build on code that isn't there yet. Automatic PR review sends findings back to the agent's session before you spend review time on it.

Pay as you go

Prepaid credits, one pool per team, no subscription.

Fewer rework runs

Sharper stories and dispatch in dependency order.

Review before you spend

Automatic review sends findings back to the agent before your review time goes in.

Quick answers

Common questions

How much does a coding agent cost per month?

It varies widely by tool and usage. As one data point, Anthropic reports that across enterprise deployments Claude Code averages around $13 per developer per active day and $150–250 per developer per month. Cursor Cloud Agents bill at API pricing for the model you pick, so cost tracks tokens used. [5] [1]

Is a cheaper model always cheaper?

No. If a cheaper model needs three runs to produce a mergeable PR and a stronger one needs one, the stronger one is cheaper per merged PR — and it costs you less review time too. Right-size the model to the task.

What's the biggest hidden cost?

Review time. It grows with PR volume and never shows on an invoice. CI minutes come next: they're metered beyond your plan's included quota, and every agent push can trigger a run. [7]

Aerunit

Keep the agents busy. You do the thinking.

Sign-up is open — create an account and start with pay-as-you-go credits. No subscriptions, and teams share one credit pool at no extra cost.

Create account