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.
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).
| Model | Input / cached $ per 1M | Claude 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:
| Model | Harness | Index | Cost per task |
|---|---|---|---|
| DeepSeek V4.1 Flash | Codex | 47.3 | $0.39 |
| DeepSeek V4.1 Flash 1017 | DeepSeek Harness | 46.3 | $0.30 |
| Opus 5.5 Max | Claude Code | 61.7 | $11.42 |
| Opus 5.5 Max + GPT-6 Luna | Devin Fusion | 61.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:
| Harness | Model | Index | Cost per task |
|---|---|---|---|
| Claude Code | Sonnet 5.5 | 59.3 | $13.30 |
| Claude Code | Haiku 5.5 | 37.3 | $2.67 |
| Claude Code | Fable 5.1 | 57.6 | $11.53 |
| Codex | GPT-6.1 Sol | 54.1 | $1.50 |
| Codex | GPT-6 Astra | 54.7 | $7.04 |
| Codex | GPT-6 Luna | 31.1 | $0.16 |
| Antigravity CLI | Gemini 4 Argon | 53.2 | $5.86 |
| Grok Build | Grok 4.7 | 46.6 | $9.48 |
| OpenCode | GLM-5.3 | 48.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
- Compare cost per task for the model and harness you'll actually use, not just the price per token.
- A large fixed preamble is resent often, so cache hits matter. Model your hit rate in the prompt caching calculator.
- Add your own token counts in the TokenTab calculator, or add harness overhead in the subscription vs API calculator.
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.