See what your AI agent really costs

Why the same model costs up to 3x more in different coding agents

Updated 2026-10-25. Research sources linked below; API prices from models.json.

Picking a cheap model is only half of your coding agent bill. The harness, meaning the agent tool around the model (Claude Code, OpenCode, Codex and others), decides how many tokens go in on every step. A new study shows that choice alone can triple the cost of the same task.

What the study found

The paper "What Does a Harness Buy? Tokens, Mostly." (arXiv 2610.04433) runs the same models through Claude Code, OpenCode and mini-SWE-agent on SWE-bench Verified.

  • With one price list, cost per task differs by up to 3× across harnesses.
  • Pass rates are equivalent within noise. OpenCode trails by up to 9 points.
  • The fixed system-prompt and tool-schema preamble is 16,581 tokens for Claude Code, 7,025 for OpenCode and 829 for mini-SWE-agent.

Coverage: VentureBeat: "A coding agent's harness can triple its cost without making it more accurate, study finds".

Illustration: the preamble alone, per 1,000 agent turns

If a harness sends its fixed preamble on each model call, this is what that preamble alone costs over 1,000 turns: preamble tokens × 1,000 × price per 1M tokens / 1,000,000. Shown at the full input price and, in brackets, at the cached-input price (when every preamble read is a cache hit).

ModelInput / cached $ per 1MClaude Code (16,581 tokens)OpenCode (7,025 tokens)mini-SWE-agent (829 tokens)
Claude Opus 5.5$4 / $0.2$66.32 ($3.32 cached)$28.10 ($1.41 cached)$3.32 ($0.166 cached)
Claude Sonnet 5.5$2 / $0.1$33.16 ($1.66 cached)$14.05 ($0.703 cached)$1.66 ($0.083 cached)
GPT-6.1 Sol$2 / $0.1$33.16 ($1.66 cached)$14.05 ($0.703 cached)$1.66 ($0.083 cached)
Claude Haiku 5.5$0.1 / $0.01$1.66 ($0.166 cached)$0.703 ($0.070 cached)$0.083 ($0.008 cached)
DeepSeek Flash (V4.1 Flash 1017)$0.3 / $0.006$4.97 ($0.099 cached)$2.11 ($0.042 cached)$0.249 ($0.005 cached)

Preamble-only illustration, not a per-task cost. It leaves out file context, tool results, conversation history, output tokens and cache-write fees, and it applies each preamble size to every model even though the paper measured specific model and harness pairs. Prices are standard tier, short context, from models.json (last updated 2026-10-25).

Measured cost per task by harness: Artificial Analysis

The Artificial Analysis Coding Agent Index v2.0 reports mean API cost per task for model and harness pairs. Rows where the same model appears in two harnesses:

ModelHarnessIndexCost per task
DeepSeek V4.1 FlashCodex47.3$0.39
DeepSeek V4.1 Flash 1017DeepSeek Harness46.3$0.30
Opus 5.5 MaxClaude Code61.7$11.42
Opus 5.5 Max + GPT-6 LunaDevin Fusion61.5$8.00

The Devin Fusion row mixes two models, so it isn't a clean same-model comparison.

Other rows from the same index:

HarnessModelIndexCost per task
Claude CodeSonnet 5.559.3$13.30
Claude CodeHaiku 5.537.3$2.67
Claude CodeFable 5.157.6$11.53
CodexGPT-6.1 Sol54.1$1.50
CodexGPT-6 Astra54.7$7.04
CodexGPT-6 Luna31.1$0.16
Antigravity CLIGemini 4 Argon53.2$5.86
Grok BuildGrok 4.746.6$9.48
OpenCodeGLM-5.348.9$5.23

Source: artificialanalysis.ai/agents/coding, read Oct 24, 2026. See also our coding agent cost per task page.

What this means for your bill

FAQ

Why does the same model cost more in one coding agent than another?

The harness (the agent tool wrapped around the model) decides how many tokens are sent per task. The arXiv paper 2610.04433 found that with one price list, cost per task differed by up to 3x across Claude Code, OpenCode and mini-SWE-agent running the same models.

Does a more expensive harness solve more tasks?

Not in that study. Pass rates on SWE-bench Verified were equivalent within noise across the harnesses, with OpenCode trailing by up to 9 points.

How big is the fixed prompt each coding agent sends?

The paper measured the fixed system-prompt and tool-schema preamble at 16,581 tokens for Claude Code, 7,025 for OpenCode and 829 for mini-SWE-agent.

Does prompt caching reduce harness overhead?

A repeated preamble is a good fit for prompt caching, which bills cache hits at the lower cached-input price. Our table shows both prices; use the prompt caching calculator to model your own hit rate.

Run your own numbers

Open the TokenTab calculator Prompt caching calculator

Related: Claude Code cost per month · Claude Code vs Codex cost.

Get the TokenTab newsletter

Model price changes and agent cost tips, straight to your inbox. Unsubscribe anytime; we only use your email for this newsletter.