AI DevelopmentMethodology22 min readPublished August 22, 2026

18 runs · 8 agents · 2.58M tokens · $1.92 at list price · about $0.03 actually spent

Eight Headless Coding Agents, One Task: Tokens and Cost

One fixed Python task — a CSV deduplicator and its unittest suite, standard library only — sent to eight headless coding-agent CLIs, twice each, in empty directories, all launched at once. Every token count is the CLI’s own report (Kimi’s from its session log), wall-clock is measured by the harness, and every pass/fail is our own test run. Eighteen rows, two cost columns, and five findings about the harnesses themselves.

DA
Digital Applied Team
Senior strategists · Published Aug 22, 2026
PublishedAug 22, 2026
Read time22 min
Sources11 primary pages
Run-rows in the dataset
18
8 agents × 2 runs + 2 Gemini re-runs
Passed on first attempt
7/8
agents, both runs, our own unittest
CLI cost vs list, DeepSeek shim
27×
Claude Code total_cost_usd, both runs
Real marginal spend
≈$0.03
DeepSeek only, two runs, off-peak

This is a headless coding-agent cost-per-task benchmark: one small, fixed Python task run through eight agent CLIs — Claude Opus 5, GPT-5.6 Sol, Gemini 3.7 Flash, Grok 4.6, Kimi K3, Qwen3.8-Max, GLM-5.3 and DeepSeek V4 Flash — twice each, with the tokens each CLI reported, the seconds each took, whether the result actually passed its tests, and what those tokens cost at the vendor’s published rate.

It is an original measurement, not a survey. Nothing here was estimated: every token count was read from the CLI’s own output (or, for one CLI that prints none, from its local session log), and every pass/fail comes from us running python3 -m unittest -v in the agent’s directory rather than trusting the agent’s “DONE”. The complete 18-row dataset is in section 03; the prose around it is packaging.

Two things turned out to matter more than the headline cost figures. First, the harnesses themselves report cost inconsistently — one CLI’s dollar figure matches our rate-card calculation to the cent on its own vendor and is 27× wrong on a third-party endpoint, another’s is exactly 17% of its published rate card with no explanation found. Second, the cheapest-looking agent produced no usable output on the invocation most people would write. Both are in the table, not footnoted out of it.

Key takeaways
  1. 01
    Seven of eight agents shipped a passing deliverable on both runs.Opus 5, GPT-5.6 Sol, Grok 4.6, Kimi K3, Qwen3.8-Max, GLM-5.3 and DeepSeek V4 Flash each produced dedupe.py and test_dedupe.py that passed our independent unittest run, twice. Gemini 3.7 Flash passed in three of four attempts but only once into the working directory.
  2. 02
    List price per run spans $0.0165 to $0.3039 — an 18× spread.DeepSeek V4 Flash at off-peak rates sits at the bottom; Claude Opus 5 at the top, with cache writes — priced at the $10 rate in Table 2 — accounting for 76% and 71% of its two list-price figures. The chart in section 03 shows every run as its own bar rather than an average.
  3. 03
    Cache reads were 46.0% to 95.4% of input tokens in every run.Uncached input ran from 4 to 61K tokens; cache reads from 22K to 203K. Pricing all input at the uncached rate would have overstated the full-run list price by between 1.4× and 4.8× across these 18 rows.
  4. 04
    Two CLI cost fields disagree with the rate card, in opposite directions.Claude Code’s total_cost_usd matched Anthropic list price to the cent for Opus 5 but overstated DeepSeek by ~27× and Z.ai by ~2.8–2.9× through the Anthropic-compatible shim. Grok’s CLI-reported cost was exactly 0.17 of the rate-card figure in both runs — an open discrepancy we do not explain.
  5. 05
    Free is the plan, not the model.Six agents ran on flat subscriptions, Qwen on a prepaid plan at 10% of standard rate, and only DeepSeek was pay-as-you-go — about $0.03 for two runs. The list-price column is what the same tokens would cost on the vendor’s API; the plan column is what was actually paid.

01The instrumentOne task, eight CLIs, empty directories.

The task was chosen to be small, unambiguous and self-verifying: a command-line CSV deduplicator plus a three-test unittest suite, standard library only, with an exact stdout contract. It fits in two files of roughly 140 lines and has a binary outcome — either python3 -m unittest -v passes three tests in the agent’s directory or it does not. The prompt, verbatim:

You are in an empty directory. Build a small Python 3 command-line tool and its tests, using ONLY the standard library.

1. Create dedupe.py. When run as `python3 dedupe.py contacts.csv deduped.csv` it must:
   - read the input CSV, which has a header row with exactly the columns name,email,phone
   - normalise email (strip surrounding whitespace, lowercase) and phone (keep digits only)
   - drop duplicate rows by normalised email, keeping the first occurrence
   - write the surviving rows with their normalised email and phone to the output CSV, with the same header
   - print one line to stdout: read=<rows read> written=<rows written> removed=<rows removed>
2. Create test_dedupe.py using unittest (not pytest) with three tests: (a) emails differing only by case or surrounding whitespace collapse to one row, (b) a phone like "+1 (555) 010-2020" becomes "15550102020", (c) an input file with only the header produces an output file with only the header and prints read=0 written=0 removed=0. Tests must create their own temporary input files.
3. Run `python3 -m unittest -v` and make all three tests pass.

Do not create any other files. When finished, reply with exactly one line: DONE

Each agent received the identical prompt as a single headless invocation, in its own freshly created empty directory, with its permission checks defeated so nothing would block on approval. All eight were launched at the same moment. Two full rounds were run (run1, run2), plus two additional Gemini-only re-runs that isolate a harness-configuration finding described in section 07. The eight invocations, exactly as executed:

The eight agents, CLI versions, exact headless invocation strings, effort settings and the plan each ran on. Effort was not equalised: six agents ran at an explicit high setting, Kimi and Qwen at their CLI defaults.
Agent / modelCLI · versionExact headless command (cwd = agent’s empty dir)EffortPlan it ran on
Claude Opus 5Claude Code · claude 2.1.241claude -p "$TASK" --model opus --effort high --dangerously-skip-permissions --output-format jsonhighClaude Max subscription ($200/mo)
GPT-5.6 SolCodex CLI · codex-cli 0.149.0codex exec --json -s workspace-write --skip-git-repo-check --ephemeral -c model="gpt-5.6-sol" -c model_reasoning_effort="high" "$TASK"highChatGPT subscription (Codex)
Gemini 3.7 FlashAntigravity CLI · agy 1.1.19agy -p "$TASK" --model gemini-3.7-flash-high --dangerously-skip-permissions [--add-dir "$cwd"] --output-format jsonhigh (model suffix)Google Workspace / Antigravity plan
Grok 4.6Grok Build · grok 1.0.5grok -p "$TASK" -m grok-4.6 --effort high --output-format jsonhighSuperGrok subscription
Kimi K3Kimi Code · kimi 0.38.0kimi -p "$TASK" --output-format stream-json (headless = auto permission; no flag exists)default (always-thinking)Kimi Allegro subscription (monthly quota)
Qwen3.8-MaxQwen Code · qwen 0.22.0QWEN_CODE_SUPPRESS_YOLO_WARNING=1 qwen -y -o json -p "$TASK"defaultQwenCloud Token Plan (prepaid, 10% of standard pricing)
GLM-5.3Claude Code → Z.ai Anthropic-compatible endpoint · claude 2.1.241ANTHROPIC_BASE_URL=https://api.z.ai/api/anthropic … claude -p "$TASK" --model glm-5.3 --effort high --dangerously-skip-permissions --output-format jsonhighZ.ai Coding Plan subscription
DeepSeek V4 FlashClaude Code → DeepSeek Anthropic-compatible endpoint · claude 2.1.241ANTHROPIC_BASE_URL=https://api.deepseek.com/anthropic … claude -p "$TASK" --model deepseek-v4-flash --effort high --dangerously-skip-permissions --output-format jsonhighPay-as-you-go API key

Effort is therefore not equalised. Six agents ran at their explicit “high”; Kimi and Qwen ran at their CLI defaults, because neither exposes a comparable headless effort flag in the form used here. Kimi is always-thinking. That asymmetry is stated rather than hidden, and it is one reason this page does not rank models — our earlier reasoning-effort cost-vs-quality benchmarks show how much the effort dial alone moves token counts.

02MethodologyWhat was read, what was calculated, and what was left out.

Methodology

What was collected. One fixed coding task (reproduced in full in section 01), identical prompt sent to eight headless coding-agent CLIs, each in its own empty directory, each on its own subscription or API key. Per run: wall-clock seconds (measured by the harness from process start to exit, not self-reported); turns or API calls where the CLI reports them; input tokens split into uncached / cache-read / cache-write, output tokens and thinking tokens, all as reported by the CLI itself; the files present in the working directory afterwards; and whether the deliverable works, verified by us running python3 -m unittest -v in the agent’s directory. The agent’s own “DONE” claim was ignored.

From which sources. Each CLI’s own headless JSON or stream output — Claude Code --output-format json, Codex --json, Antigravity --output-format json, Grok --output-format json, Qwen -o json — or, for Kimi only, its local session log under ~/.kimi-code/sessions/, because the Kimi CLI printed no usage on stdout at all.

On what date. Runs executed 23 August 2026 (UTC), 11:16–11:23, on one machine (an Apple-silicon MacBook Pro), all eight agents launched concurrently. That is the dataset’s as-of date, distinct from this post’s publish date. Vendor rates were read from each vendor’s own pricing page on the same day, with one exception flagged in its own row: the Qwen3.8-Max rate rests on a routing note plus secondary trackers (section 04). The run window sits outside both of DeepSeek’s published peak bands (01:00–04:00 and 06:00–10:00 UTC), so DeepSeek is priced at its off-peak rate.

How many items. 18 run-rows: 8 agents × 2 full runs (run1, run2), plus 2 additional Gemini-only re-runs (run1-gemini-retry, run1-gemini-retry2) that isolate a harness-configuration finding (section 07).

What was excluded and why. No third run per agent (budget). No attempt to equalise reasoning effort across CLIs: Kimi has no headless effort flag and runs always-thinking, Qwen exposes no comparable flag either, so six of eight ran at an explicit “high” and two ran at their CLI default. No quality scoring beyond pass/fail — the task has a binary outcome and was scored as one.

What was READ and what was CALCULATED. Every token count, turn count, files-in-cwd entry and pass/fail result in the table is READ directly from the CLI’s own output or (Kimi) its session log — none is inferred or estimated. The wall-clock column is MEASURED by the harness around each subprocess, not read from the CLI. The list-price USD column is CALCULATED: uncached input × input rate + cache-read tokens × cache-read rate + cache-write tokens × cache-write rate + output tokens × output rate, using the rates in section 04; thinking tokens are not separately priced, and every published list-price cell reproduces from that formula to four decimal places. The CLI-reported USD column is READ verbatim where the CLI prints a cost, and says NOT REPORTED where it prints none.

Known limitations (as written in the dataset’s methodology file):

  • One task, two runs per agent, run concurrently at one time of day on one machine. This is a measurement of this task on this day, not a ranking of models. Variance between run1 and run2 is visible in every column.
  • The task is small (two files, ~140 lines) and deliberately standard-library-only, so it rewards fast, direct agents; it says nothing about long-horizon work.
  • Effort settings are not equalised (see the fleet table). Kimi is always-thinking; Qwen’s thinking tokens are reported separately.
  • Kimi’s token figures come from its session log, not its stdout, and may exclude any background calls; Qwen’s stats block may exclude its background memory-extractor call (documented as a second API call per run).
  • Prices are the registry values as of the run date and were re-verified on each vendor’s own pricing page (section 04); DeepSeek is priced at off-peak (runs fell outside its 01–04 / 06–10 UTC peak). One rate, Qwen3.8-Max, rests on a routing note plus secondary trackers rather than a row on the vendor’s own pricing table. Opus 5’s cache writes are priced at the $10 1-hour tier because that is the rate at which Claude Code’s own cost figure reproduces; the invocation requested no cache TTL, so the tier is inferred rather than observed.
  • Wall-clock includes CLI start-up and, for Codex, skill/plugin loading; API-side duration is recorded separately where the CLI reports it. Because all eight launched at once, wall-clock also includes whatever API-side queueing each vendor applied at that moment.

Reproducibility. A stranger can redo this exactly: the same task text, the same eight invocation strings, the same two verification steps (an independent unittest run plus token counts lifted from the CLI output), and the same vendor pricing pages, dated to the day they redo it.

"This is a measurement of this task on this day, not a ranking of models."— Limitations section of this dataset’s methodology

03The datasetAll eighteen rows, every column.

The table is the asset. Rows are ordered as the runs were recorded: the eight run1 rows, the two Gemini re-runs, then the eight run2 rows. “NOT REPORTED” means the CLI printed no such figure; it is not zero. “NO FILES IN CWD” means the agent replied DONE but nothing existed in its working directory for us to test. Token counts are as reported by each CLI; list price is calculated from them at the rates in section 04.

Table 1 — Headless coding-agent cost-per-task benchmark, all 18 run-rows, as of 23 August 2026. Token counts, and turns where a CLI reports them, are read from each CLI’s own output (Kimi: session log); wall-clock is measured by the harness from process start to exit; the “Tests” column is our own unittest run; list-price USD is calculated from the tokens at the vendor rates in Table 2 (DeepSeek at off-peak; Opus 5 cache writes at the $10 1-hour rate, a tier inferred rather than read off the invocation — see the note in Table 2); CLI-reported USD is printed verbatim where a CLI prints one.
AgentRunWall sTurnsInput (uncached)Cache readCache writeOutputThinkingTotal tokFiles in cwdTests (our run)List-price USDCLI-reported USDPlan / marginal cost
run1 — eight agents, launched concurrently
Anthropic · Claude Opus 5 (Claude Code)run120.22449,43921,2191,622072,284dedupe.py, test_dedupe.pyPASS0.27750.2774795Claude Max subscription ($200/mo) — $0 marginal
OpenAI · GPT-5.6 Sol (Codex CLI)run134.3NOT REPORTED25,83422,01601,2737049,123dedupe.py, test_dedupe.pyPASS0.1376NOT REPORTEDChatGPT subscription (Codex) — $0 marginal
Google · Gemini 3.7 Flash (Antigravity CLI)run164.5150,061146,47406,1353,563202,670(none)NO FILES IN CWD (status=ERROR; files never reached cwd)0.0715NOT REPORTEDGoogle Workspace / Antigravity plan — $0 marginal
xAI · Grok 4.6 (Grok Build)run124.2321,64234,17601,34412657,162dedupe.py, test_dedupe.pyPASS0.06840.01163412SuperGrok subscription — $0 marginal; the CLI prints its own total_cost_usd
Moonshot · Kimi K3 (Kimi Code)run144.9NOT REPORTED7,252126,97602,046NOT REPORTED136,274dedupe.py, test_dedupe.pyPASS0.0905NOT REPORTEDKimi Allegro subscription (monthly quota) — $0 marginal
Alibaba · Qwen3.8-Max (Qwen Code)run1107.1438,887110,22305,2983,768154,408dedupe.py, test_dedupe.pyPASS0.1371NOT REPORTEDQwenCloud Token Plan (prepaid, 10% of standard pricing) — effectively $0 marginal until quota expiry
Z.ai · GLM-5.3 (Claude Code → Z.ai shim)run139.5538,677203,39201,4510243,520dedupe.py, test_dedupe.pyPASS0.11340.331356Z.ai Coding Plan subscription — $0 marginal
DeepSeek · V4 Flash (Claude Code → DeepSeek shim)run124.9461,389129,02403,6570194,070dedupe.py, test_dedupe.pyPASS0.01680.462882Pay-as-you-go API key — REAL marginal spend (the only one)
Gemini-only re-runs — isolating the --add-dir finding
Google · Gemini 3.7 Flash (Antigravity CLI)run1-gemini-retry86.8153,221130,12601,338816184,685(none)NO FILES IN CWD (status=SUCCESS, “DONE”, but files landed in ~/.gemini/antigravity-cli/scratch/, not the cwd)0.0547NOT REPORTEDGoogle Workspace / Antigravity plan — $0 marginal
Google · Gemini 3.7 Flash (Antigravity CLI)run1-gemini-retry271.1143,980154,55505,4193,271203,954dedupe.py, test_dedupe.pyPASS (with --add-dir "$cwd")0.0649NOT REPORTEDGoogle Workspace / Antigravity plan — $0 marginal
run2 — eight agents, launched concurrently
Anthropic · Claude Opus 5 (Claude Code)run226.43686,60821,4621,83959109,915dedupe.py, test_dedupe.pyPASS0.30390.303929Claude Max subscription ($200/mo) — $0 marginal
OpenAI · GPT-5.6 Sol (Codex CLI)run253.0NOT REPORTED24,19398,81601,853227124,862dedupe.py, test_dedupe.pyPASS0.1734NOT REPORTEDChatGPT subscription (Codex) — $0 marginal
Google · Gemini 3.7 Flash (Antigravity CLI)run258.9132,66865,11301,4741,23199,255(none)NO FILES IN CWD (no --add-dir; reproduced the global-scratch behaviour)0.0349NOT REPORTEDGoogle Workspace / Antigravity plan — $0 marginal
xAI · Grok 4.6 (Grok Build)run237.169,450108,92802,403346120,781dedupe.py, test_dedupe.pyPASS0.08780.01492294SuperGrok subscription — $0 marginal; the CLI prints its own total_cost_usd
Moonshot · Kimi K3 (Kimi Code)run226.7NOT REPORTED7,052126,97602,076NOT REPORTED136,104dedupe.py, test_dedupe.pyPASS0.0904NOT REPORTEDKimi Allegro subscription (monthly quota) — $0 marginal
Alibaba · Qwen3.8-Max (Qwen Code)run291.2337,56970,48404,0862,765112,139dedupe.py, test_dedupe.pyPASS0.1173NOT REPORTEDQwenCloud Token Plan (prepaid, 10% of standard pricing) — effectively $0 marginal until quota expiry
Z.ai · GLM-5.3 (Claude Code → Z.ai shim)run243.648,368174,84802,3820185,598dedupe.py, test_dedupe.pyPASS0.06770.188814Z.ai Coding Plan subscription — $0 marginal
DeepSeek · V4 Flash (Claude Code → DeepSeek shim)run222.0461,461128,12803,2080192,797dedupe.py, test_dedupe.pyPASS0.01650.451569Pay-as-you-go API key — REAL marginal spend (the only one)

One chart, one column. List price per run is the single figure every reader can compare apples-to-apples across all eight agents: CLI-reported USD is NOT REPORTED for four of eight and wrong for two, and wall-clock is confounded by the concurrent launch. Run1 and run2 are shown side by side rather than averaged, so the run-to-run variance stays visible. The three Gemini runs that left no files in the working directory are drawn as dashed outlines rather than omitted: their cost was real even though the deliverable was not.

List-price USD per run, eight headless coding agents, 18 runsHorizontal bars showing the list-price cost in US dollars of each of the 18 benchmark runs, grouped by agent. Solid bars are runs whose tests passed in the working directory; dashed outlines are the three Gemini runs that left no files in the working directory. Values range from $0.0165 (DeepSeek V4 Flash run2) to $0.3039 (Claude Opus 5 run2).LIST-PRICE USD PER RUN · TOKENS × VERIFIED VENDOR RATES$0.1$0.2$0.3Opus 5 · run1$0.2775Opus 5 · run2$0.3039GPT-5.6 Sol · run1$0.1376GPT-5.6 Sol · run2$0.1734Gemini 3.7 Flash · run1$0.0715 · no files in cwdGemini 3.7 Flash · run1 retry$0.0547 · no files in cwdGemini 3.7 Flash · run1 retry2 (--add-dir)$0.0649Gemini 3.7 Flash · run2$0.0349 · no files in cwdGrok 4.6 · run1$0.0684Grok 4.6 · run2$0.0878Kimi K3 · run1$0.0905Kimi K3 · run2$0.0904Qwen3.8-Max · run1$0.1371Qwen3.8-Max · run2$0.1173GLM-5.3 · run1$0.1134GLM-5.3 · run2$0.0677DeepSeek V4 Flash · run1$0.0168DeepSeek V4 Flash · run2$0.0165Tests passed in the working directory (our own unittest run)No files reached the working directory
Figure 1 — List-price USD per run, from Table 1, column “List-price USD”. Each bar is one run; nothing is averaged. Bars are drawn to a common scale with gridlines at $0.10, $0.20 and $0.30.

Reading across the rows rather than down the cost column: every agent that wrote files into its directory passed, on both runs. The fastest completion was Opus 5 at 20.2 s; the slowest was Qwen3.8-Max at 107.1 s. Opus 5 used almost no uncached input (4 and 6 tokens) but wrote 21K tokens to cache on each run, and at the $10 cache-write rate Table 2 uses, those writes were 76% and 71% of its two list-price figures. GLM-5.3 read the most from cache (203,392 tokens in run1). The two DeepSeek runs were within 2% of each other on price and within 3 s on wall-clock.

04Rate cardThe eight rates the list-price column uses.

Seven of the eight rates below were read from the vendor’s own pricing or model page on the dataset’s as-of date; the eighth, Qwen3.8-Max, rests on a routing note plus secondary trackers and is marked as weaker in its own row. Where the page states a promotional or introductory period, the end date is recorded; where a rate depends on a threshold the runs did not cross, the tier that applied is named.

Table 2 — Vendor list prices used to calculate Table 1’s list-price column, in USD per million tokens, as read from each vendor’s own page on the dataset’s as-of date — except the Qwen3.8-Max row, which rests on a routing note plus secondary trackers and says so. “Cache write” is the per-token write rate only where the vendor publishes one and the runs recorded cache writes; only the Opus 5 runs did.
Vendor / modelInputCache readCache writeOutputSource pageNote
Anthropic · Claude Opus 55.000.5010.0025.00platform.claude.com pricing$10 is the 1-hour cache-write rate (2× input); the 5-minute rate is $6.25. We price at $10 because Claude Code’s own cost figure reproduces to the cent only at that rate — the invocation in the fleet table carries no cache-TTL flag, so the tier is inferred from the CLI’s figure rather than read off the run.
OpenAI · GPT-5.6 Sol4.000.40none recorded20.00developers.openai.com model pageOpenAI’s own list price from August 21, 2026; the page describes it as promotional pricing guaranteed through November 21, 2026. It is OpenAI’s cut, not a gateway discount.
Google · Gemini 3.7 Flash0.750.075none recorded3.75ai.google.dev pricingIntroductory rate the page states as running through December 31, 2026, with roughly double thereafter.
xAI · Grok 4.62.000.50not published6.00docs.x.ai modelsUnder-200K-token tier. The page lists $4 / $1 / $12 at or above 200K tokens; no run here came near that threshold.
Moonshot · Kimi K33.000.30not published15.00platform.kimi.ai K3 pricingCache-miss input, cache-hit input, output. The moonshot.ai pricing URL redirects to this page.
Alibaba · Qwen3.8-Max2.000.25not published6.00alibabacloud.com routing noteCAVEAT: Alibaba’s own pricing table had no qwen3.8 row on the as-of date. The routing note states that qwen3.8-max-preview requests route to qwen3.8-max and bill at its rate; three independent trackers agree on $2 / $0.25 / $6. Weaker than the other seven rows.
Z.ai · GLM-5.31.400.26storage free, limited time4.40docs.z.ai pricingUnchanged from GLM-5.2. The page shows no last-updated or effective date.
DeepSeek · V4 Flash (off-peak)0.220.007not published0.66api-docs.deepseek.com pricingPeak hours are 01:00–04:00 and 06:00–10:00 UTC at 2× these rates; the run window fell outside both bands.

Three of these eight rates are explicitly promotional or time-bounded on the vendor’s own page — Sol’s promotional rate is guaranteed only through November 21, 2026, Gemini 3.7 Flash’s introductory rate runs through December 31, 2026, and Z.ai’s free cache storage is “for a limited time”. Anyone re-pricing these tokens later should expect at least the Gemini row to move. Our LLM API pricing index carries the broader rate card; the eight rows above are only the ones this dataset needs.

05Finding 1 · ReportingSix CLIs, six different ideas of what usage means.

The first finding is about the instruments, not the models. Getting a comparable token split out of eight headless runs meant reading five different output schemas, and a sixth CLI offered none at all. The NOT REPORTED cells in Table 1 are the direct consequence.

Claude Code
--output-format json
uncached · cache-read · cache-write · output · thinking

Also reports turns, API duration and a total_cost_usd. Used for three of the eight agents here — Opus 5 natively, GLM-5.3 and DeepSeek V4 Flash through each vendor’s Anthropic-compatible endpoint. The cost field is the subject of section 06.

Opus 5 · GLM-5.3 · DeepSeek V4 Flash
Codex CLI
--json
input (total, with a cached count) · output · reasoning

Token counts arrive on the turn-completion event of a JSON-Lines stream. No cost field and no turn count are emitted, which is why the Sol rows show NOT REPORTED in both columns. The cached count was subtracted from total input to produce the uncached figure.

GPT-5.6 Sol
Antigravity CLI
--output-format json
input · output · thinking · cache-read · duration

Reports a status field alongside usage. Run1 returned status=ERROR after 60 s yet still replied DONE; the two retries returned SUCCESS. No cost field.

Gemini 3.7 Flash
Grok Build
--output-format json
full token split · total_cost_usd (server-side)

The only non-Anthropic CLI that prints a dollar figure. xAI’s cost-tracking documentation describes the underlying field as the billed amount, not a client-side estimate — which makes the gap in section 06 an open question rather than a bug.

Grok 4.6
Qwen Code
-o json
per-model tokens incl. cached and thoughts · tool calls · lines added

A full stats block. A documented background memory-extractor call per run may not be included in these counts — listed as a limitation, not corrected for.

Qwen3.8-Max
Kimi Code
--output-format stream-json
nothing on stdout

Kimi printed no usage at all. Per-call usage (inputOther, output, inputCacheRead, inputCacheCreation) was recovered from the session log under ~/.kimi-code/sessions/ — six API calls per run — and may exclude background calls.

Kimi K3

The practical consequence for anyone building a cost dashboard on top of headless agents: there is no common field to read. Token splits have to be normalised per CLI, “input” means total input in some schemas and uncached input in others, thinking tokens are sometimes a separate count and sometimes folded into output, and a cost figure — where one exists — is not necessarily the vendor’s. Our per-task, per-user agent cost framework assumes you can get a clean per-task token count; this table is what obtaining one actually looked like.

06Finding 2 · Cost fieldsOne cost field is 27× too high; another is 0.17 of the rate card.

Two CLIs print a dollar figure. Neither should be read without knowing what produced it. The comparison that makes this visible is already in Table 1: the CLI-reported USD column next to the list-price column, row by row.

Same vendor
Opus 5 · Claude Code on Anthropic
1.00×

Run1: CLI said $0.2774795, list price $0.2775. Run2: CLI said $0.303929, list price $0.3039. Claude Code’s total_cost_usd agrees with our calculation to the cent when the endpoint is Anthropic’s own — but only with cache writes priced at $10, and we chose that tier because it is the one that reproduces the CLI’s figure. The invocation carries no cache-TTL flag, and Anthropic’s 5-minute write rate is $6.25. Read the row as the same-vendor case agreeing with itself, not as an independent check.

agreement, not independent confirmation
Through the shim
DeepSeek V4 Flash · Claude Code → DeepSeek
27×

Run1: CLI said $0.462882, DeepSeek off-peak list price $0.0168 (27.5×). Run2: $0.451569 vs $0.0165 (27.4×). GLM-5.3 through the Z.ai endpoint: $0.331356 vs $0.1134 (2.9×) and $0.188814 vs $0.0677 (2.8×). The CLI priced third-party tokens with Anthropic’s table.

Anthropic rates applied to non-Anthropic models
Open question
Grok 4.6 · CLI-reported vs rate card
0.17×

Run1: CLI said $0.01163412; tokens × published rates = $0.068436. Run2: $0.01492294 vs $0.087782. In both runs the CLI figure is exactly 0.17 of the rate-card computation (0.068436 × 0.17 = 0.01163412; 0.087782 × 0.17 = 0.01492294). We do not know why.

reported as open, no cause asserted

Claude Code through a third-party endpoint. Pointed at Z.ai or DeepSeek via the Anthropic-compatible base URL, Claude Code still prints a total_cost_usd — computed with Anthropic’s price table, and it logs unrecognized_model while doing so. This is consistent with how Anthropic documents the field. Claude Code’s headless-mode documentation says of total_cost_usd and the per-model cost breakdown that “Both figures are client-side estimates and can differ from your actual bill.” The figure was never claimed to be a bill; on Anthropic’s own models it happens to be exact, and on someone else’s models it is Anthropic’s rate applied to someone else’s tokens. A closed issue on the Claude Code repository (#53371, filed April 25, 2026) separately reports the field returning roughly 10× too high for a same-vendor call — a different failure mode from ours, but corroboration that the field is documented as an estimate rather than a ledger. Anyone reading /cost against a third-party endpoint is reading a number that can be off by an order of magnitude. The column stays in Table 1 for exactly that reason.

Grok’s field is a different kind of number. xAI’s cost-tracking documentation describes the underlying cost field as “the actual amount billed, after all applicable discounts (including prompt caching reductions) have been applied, and inclusive of all token costs and server-side tool invocation costs” — a server-computed billed figure, not a client-side estimate. That is what makes the 0.17 ratio worth reporting rather than dismissing. A promotional or subscription-linked discount, an undisclosed caching credit, or a rate-card page that lags the billing system would each produce a gap like this; none of them is documented on any page we read, and the consistency across two independent runs rules out random variance. The page states the discrepancy with its exact numbers and does not pick a cause.

What this means for a cost dashboard
A CLI’s dollar field is only as good as its provenance. Before aggregating total_cost_usd across agents, classify each source as client-side estimate (Claude Code, by Anthropic’s own description) or server-side billed figure (Grok, by xAI’s), and recompute from tokens × the vendor’s current rate card as the comparable baseline. Where the two disagree, that gap is itself a finding to record, not to average away.

07Findings 3 & 4 · Cache and cwdCache reads outweigh fresh input in 17 of 18 rows; the cheapest-looking agent wrote nowhere useful.

Cache reads are most of the input in all but one row. Across the 18 rows, uncached input ran from 4 tokens (Opus 5, run1) to 61,461 (DeepSeek, run2), while cache reads ran from 22,016 (Sol, run1) to 203,392 (GLM-5.3, run1). Expressed as a share of all input tokens (uncached + cache read + cache write), cache reads were between 46.0% and 95.4% in every run, and above half in seventeen of the eighteen — the exception is GPT-5.6 Sol’s run1 at 46.0%. The bars below show run1 per agent; run2 is in the sub-label.

Cache reads as a share of all input tokens · run1, by agent

Source: Table 1 — cache-read tokens ÷ (uncached + cache-read + cache-write), run1; run2 share in the sub-label
Kimi K3run1 126,976 of 134,228 input tokens · run2 94.7%
94.6%
GLM-5.3run1 203,392 of 242,069 · run2 95.4%
84.0%
Gemini 3.7 Flashrun1 146,474 of 196,535 · run2 66.6%
74.5%
Qwen3.8-Maxrun1 110,223 of 149,110 · run2 65.2%
73.9%
Claude Opus 5run1 49,439 of 70,662 (incl. 21,219 cache write) · run2 80.1%
70.0%
DeepSeek V4 Flashrun1 129,024 of 190,413 · run2 67.6%
67.8%
Grok 4.6run1 34,176 of 55,818 · run2 92.0%
61.2%
GPT-5.6 Solrun1 22,016 of 47,850 · run2 80.3%
46.0%

The pricing consequence follows directly. Re-pricing each row with every input token at the uncached rate — the mistake a naive “input tokens × input price” estimate makes — would have overstated the full-run list price by between 1.4× (Opus 5, run1) and 4.8× (both Kimi runs) across these 18 rows. Table 1 prices cache reads at the vendor’s published cache-read rate wherever one exists, which is all eight vendors here.

The cheapest-looking agent and the working directory. Gemini 3.7 Flash’s list-price rows are among the lowest on the page: $0.0715, $0.0547, $0.0649 and $0.0349. Three of those four runs produced nothing in the directory the agent was launched in. Run1, with the cwd not in the CLI’s trusted-workspace list, errored after 60 s and 202K tokens with a message that artifacts must live under ~/.gemini/antigravity-cli/brain/<conversation>/ — status ERROR, final response still “DONE”. The first retry, with the cwd pre-trusted, returned SUCCESS and “DONE” with zero files in the cwd: the files had been written to ~/.gemini/antigravity-cli/scratch/, where they did pass the tests. Only the second retry, with --add-dir pointing at the cwd, put the files where the task said and passed in 71.1 s. Run2, launched without --add-dir, reproduced the global-scratch behaviour.

For a cost benchmark the consequence is that the cheapest-looking agent produced nothing usable, twice, on the invocation most people would write. Those rows stay in the table and in Figure 1, drawn as outlines: the tokens were consumed and would have been billed on a metered plan whether or not the deliverable arrived. A reader who wants a single Gemini figure for this task should take the --add-dir run, $0.0649, and note that it took the third attempt to obtain.

08Finding 5 · Plans“Free” is the plan, not the model.

Table 1 carries two cost columns on purpose. List price is what the same tokens would cost on the vendor’s metered API. The plan column is what was actually paid, and for seven of eight agents the answer was nothing at the margin.

Flat subscription
Six agents, $0 marginal

Claude Max ($200/mo), ChatGPT (Codex), a Google Workspace / Antigravity plan, SuperGrok, Kimi Allegro (monthly quota) and the Z.ai Coding Plan. The tokens in Table 1 drew down quota or nothing at all; they did not generate a bill.

Opus 5 · Sol · Gemini · Grok · Kimi · GLM
Prepaid token plan
One agent, effectively $0 until expiry

Qwen3.8-Max ran on a QwenCloud Token Plan that Alibaba’s promotional note describes as billing as low as 10% of the standard rate. Prepaid and expiring, so the marginal cost of a run is the quota it consumes, not a charge.

Qwen3.8-Max
Pay-as-you-go
One agent, real spend

DeepSeek V4 Flash on an API key, priced at off-peak: $0.0168 and $0.0165 per run, about $0.03 for both. This was the only money that left an account during the whole exercise.

DeepSeek V4 Flash

Summed across all 18 rows, the list-price column comes to $1.92 for 2,579,601 tokens; the amount actually paid was about $0.03. That gap is the reason the page refuses to call any agent “cheap” or “expensive” without naming the plan. A team on flat subscriptions experiences cost as quota pressure and rate limits; a team on metered keys experiences it as a bill; the same token counts sit under both. The off-peak detail matters too — DeepSeek’s rate doubles inside its published peak bands, so the same two runs inside a peak window would have cost about $0.07 rather than $0.03. Our earlier post on DeepSeek and GLM off-peak pricing windows defines the windows; this dataset is a dated data point inside one.

09LimitsHow to read this without over-reading it.

The limitations in the Methodology block are not boilerplate; each one rules out a conclusion a reader might be tempted to draw. One task, two runs, one time of day, one machine, concurrent launch. Wall-clock in particular is confounded: eight agents hitting eight vendors at the same second means each wall-clock figure includes whatever queueing that vendor applied at that moment, so a 20 s versus 107 s gap is a fact about this run, not a latency ranking. Effort was not equalised, and our effort benchmarks show that dial alone can move token counts by multiples.

What the dataset does support is narrower and, we think, more useful than a ranking. It shows the shape of a small headless coding task in 2026: a few thousand output tokens, uncached input running from single digits to tens of thousands, and cache reads that outweigh fresh input in seventeen of the eighteen rows. Because a cache read is billed at a fraction of the uncached rate, cache reads dominate the token count by more than they dominate the bill — which is why re-pricing them as fresh input inflates these rows by 1.4× to 4.8× rather than by an order of magnitude, and why that re-pricing is the estimating mistake worth catching first. It shows that the cost fields CLIs print are not interchangeable with each other or with a bill. And it shows that a DONE reply is not a deliverable: the one agent whose output we could not test said DONE every time.

Projecting forward, the part of this table most likely to change is not the token counts but the rate card under them. Two of eight rates are explicitly promotional with stated end dates and a third is free “for a limited time” with no end date given, one rests on a routing note rather than a pricing-table row, and one vendor doubles its rate by the clock. A refresh of this dataset will re-price the same tokens against whatever the pages say on that day, and the difference between the two list-price columns will be a measurement of rate-card drift rather than of the models. The harness findings are likelier to age the other way: a CLI that prints no usage, or prices third-party tokens with its own vendor’s table, tends to get fixed once enough people notice.

Two companion pieces frame where this sits. We defined the metric — cost per successful task, not cost per token — in our cost-per-successful-task post, with worked hypothetical comparisons; this page is the first real measurement behind it: on this task seven agents succeeded on every attempt, and the eighth needed a third attempt to deliver into the working directory. And every CLI here ran with its permission checks defeated — the census of coding-agent permission defaults records what each of these CLIs does when you do not. Teams deciding which of these agents to route which work to are the usual starting point of our AI transformation engagements, which begin with a measurement like this one on the team’s own tasks rather than ours.

Cite this
Digital Applied, “Eight Headless Coding Agents, One Task: Tokens and Cost,” Digital Applied Blog, August 22, 2026, https://www.digitalapplied.com/blog/headless-agent-cost-per-task-benchmarkThe dataset reflects one task run on the date stated in the Methodology block, priced at the vendor rates read on that date. Vendor rates change without notice; cite the as-of date alongside any figure, and note that this page is maintained in place and re-dated via its modified time when refreshed.

10ConclusionThe instruments are the finding.

One task, eighteen rows

The token counts were easy to read. The cost was not.

Seven of eight headless coding agents built the tool and passed the tests on both runs, at list prices from $0.0165 to $0.3039 per run. Every one of those figures is reproducible from the token counts in Table 1 and the rates in Table 2, and every token count is the CLI’s own report or, for Kimi, its own session log. That is the part of this page a citing writer can lean on.

The harder part is that the dollar figures the CLIs themselves print are not a substitute for that calculation. One is exact on its own vendor and 27× high on another’s; one is described by its vendor as the billed amount and comes to exactly 0.17 of the rate card, for reasons no page we read explains; four print no cost at all. Cache reads, not fresh input, are where most of the tokens sit in seventeen of the eighteen rows, and one agent’s cheap rows bought nothing in the working directory three times out of four.

None of that ranks a model. It describes what it took to measure one small task honestly across eight harnesses on one day, and it leaves the rows in place that make the measurement look less tidy. The dataset is maintained; the numbers will be re-read against the vendor pages when it is refreshed, and the as-of date will move with them.

Measure your own tasks

The cheapest agent is the one whose cost you can actually reproduce.

We measure before we route: which agents, on which plans, for which of your tasks — with the tokens, pass rates and rate-card arithmetic written down so the decision can be re-run.

Free consultationExpert guidanceTailored solutions
What we work on

Agent cost and routing

  • Per-task token and cost measurement across agent CLIs
  • Plan vs list-price modelling for subscription and metered mixes
  • Headless harness configuration and verification steps
  • Cache-aware cost dashboards that recompute from tokens
  • Routing rules by task class, re-checked as rate cards move
FAQ · Headless agent cost benchmark

Questions a citing writer would ask.

The task was a Python 3 command-line CSV deduplicator (dedupe.py) plus a three-test unittest suite (test_dedupe.py), standard library only, with an exact stdout contract and an instruction to create no other files. It was chosen because it is unambiguous and self-verifying: either python3 -m unittest -v passes three tests in the agent’s directory or it does not, and we can run that check ourselves without trusting the agent’s DONE. The size is a deliberate limitation — two files of roughly 140 lines rewards fast, direct agents and says nothing about long-horizon work. The full prompt is reproduced verbatim in section 01 so anyone can re-run it.
Related dispatches

Continue exploring agent economics.

AI Development

What Coding Agents Do Without Asking: A Permission-Defaults Census

Headless permission defaults for 12 coding-agent CLIs: which write files without asking, which refuse until you pass a flag, and which actually sandbox.

August 22, 2026 · 23 minRead
AI Development

Two Agent CLIs Shipped. Here Is What Actually Changed

Claude Code v2.1.234 hardened the remaining pre-approval NTLM path accesses. Codex CLI 0.148.0 added Bedrock and session forking. What changed for operators.

August 18, 2026 · 14 minRead
AI Development

We Audited What MCP Servers Put in Your Agent's Context

We checked 19 widely deployed MCP servers for documented instruction surfaces beyond tool descriptions. Only one discloses one. Undocumented is the finding.

August 22, 2026 · 18 minRead
AI Development

MCP Promoted Its Rust SDK to Tier 1. Here Is What That Means

MCP promoted its Rust SDK to Tier 1 on August 21 with 67/67 server and 50/50 client conformance. No new protocol version shipped alongside it.

August 21, 2026 · 14 minRead
AI Development

Computer-Use Agents: Microsoft vs Anthropic vs Google

Microsoft GA, Anthropic public beta, and Google Gemini preview — OSWorld scores now 78% across frontier models above the ~72% human baseline. Routing guide.

May 22, 2026 · 16 minRead
AI Development

Agent Computer Use: Enterprise Automation Playbook

Enterprise playbook for deploying computer-use agents — a 40-point guardrails checklist spanning identity, audit, action boundaries, failures, and compliance.

May 22, 2026 · 17 minRead