BlogUpdated

Why cheaper AI tokens can make a coding task more expensive

Compare coding models by cost per accepted change, counting retries, cache categories and review time, not just the price per input token.

On this page

The lowest price per token doesn't guarantee the cheapest finished feature. A model that needs repeated attempts, fixes and review can cost more than a stronger model that gets an accepted change first time. On a simple task, the reverse can hold. Measure the whole job.

Canopy usage view with token and estimated-cost summaries
Canopy usage view with token and estimated-cost summaries · Illustrative data; displayed costs are estimates, not provider bills.

Measure to one accepted outcome

Give both models the same repository state, task, checks and review standard. For example: fix a login redirect, pass the auth tests, show the final diff. A first response that fails in the browser isn't an outcome. Count every attempt until the change is accepted or abandoned, and record model settings, tools and permissions.

A cheaper attempt can cost more per patch

Take two hypothetical paths in arbitrary units. Path A spends 2 units on each of four attempts, then 6 on review: 14 units. Path B spends 7 on one attempt and 3 on review: 10 units. Both end with one accepted patch, so the cheaper attempt cost more. If A works first time, its 8 units win. These are illustrations, not provider rates or Canopy measurements.

Illustrative units only; include all attempts through acceptance.
PathImplementationReviewTotalResult
A: lower cost per attempt4 × 2 = 8614Accepted after four tries
B: higher cost per attempt1 × 7 = 7310Accepted after one try
A if it works first try1 × 2 = 268Accepted after one try

Count each token category and billing path

Input, cached input, cache writes and output can carry different API rates. OpenAI's usage API reports input, cached input, output and requests, and caching depends on reusable prompt prefixes. Anthropic also counts cache reads and writes separately. With a subscription CLI, an API-equivalent estimate is a comparison aid, not a charge. Use the provider's billing and plan views for real money and limits.

Add the cost the token chart can't see

Record human time spent re-explaining, resolving conflicts, reproducing failures and reading the diff. Note whether the change passed checks, survived review and needed a follow-up. A minutes column is enough; you don't need a dollar rate. Ten extra minutes of review can be worth it if it stops a bad merge. A low-token run with nothing to inspect isn't a cheap success.

Run a small local comparison

Pick a bounded task with a deterministic check. Use separate worktrees from one commit, one model each, and identical criteria. Keep each session's usage, model, timestamps, retries, diff, test result and review findings. Canopy's usage screen groups supported CLI signals by session and model, and the agent workspace links work to branches. Check for missing or stale usage first. One or two trials report what happened, not a universal winner.

Want to check the arithmetic? Enter your own token counts and rates in the session cost calculator →

Copyable resources

Cost per accepted change trial

One card per model path; compare outcomes before prices.

Task, repository, starting commit: [ ]
Acceptance checks and reviewer: [ ]
CLI, model, account/plan, settings: [ ]
Attempts and reason for each retry: [ ]
Input / cached input / cache writes / output: [ ]
Estimated API-equivalent cost and rate date: [ ]
Actual provider charge or plan usage, if known: [ ]
Human review and correction minutes: [ ]
Final tests, diff, accepted/rejected: [ ]

Frequently asked questions

Is the least expensive model always cheaper for simple coding tasks?

It can be. If it passes the same checks with little rework, the lower rate wins. Measure a bounded task rather than assuming either way.

Should cached tokens be priced like new input?

No. Providers publish separate cache rates and usage categories. Use the right model, date and billing path; a CLI subscription can follow different rules.

Can Canopy tell me which model produced the best code?

No. Canopy shows supported usage and project evidence. A person judges the running behavior, tests, diff and review findings.

Can one trial prove a model is better?

No. It shows one outcome under recorded conditions. Repeat across representative tasks before setting team policy.

More questions and answers →

Sources and further reading