How Do Coding Agents Spend Your Money? Analyzing and Predicting Token Consumptions in Agentic Coding Tasks
Its authors withdrew this paper, so there is no full text to read or summarize.
Abstract
AI agents offer substantial opportunities to boost human productivity across many settings. However, their use in complex workflows also drives rapid growth in LLM token consumption. When agents are deployed on tasks that can require millions of tokens, a natural question arises: where does token consumption come from in agentic coding tasks, and can we predict how many tokens a task will require? In this paper, we use Openhands agent as a case study and present the first empirical analysis of agent token consumption patterns using agent trajectories on SWE-bench, and we further explore the possibility of predicting token costs at the beginning of task execution. We find that (1) more complex tasks tend to consume more tokens, yet token usage also exhibits large variance across runs (some runs use up to 10$\times$ more tokens than others); (2) unlike chat and reasoning tasks, input tokens dominate overall consumption and cost, even with token caching; and (3) while predicting total token consumption before execution is very challenging (Pearson’s $r<0.15$), predicting output-token amounts and the range of total consumption achieves weak-to-moderate correlation, offering limited but nontrivial predictive signal. Understanding and predicting agentic token consumption is a key step toward transparent and reliable agent pricing. Our study provides important empirical evidence on the inherent challenges of token consumption prediction and could inspire new studies in this direction.
BibTeX
@misc{bai2026how,
author = {Longju Bai and Zhemin Huang and Xingyao Wang and Jiao Sun and Rada Mihalcea and Erik Brynjolfsson and Alex Pentland and Jiaxin Pei},
title = {{How Do Coding Agents Spend Your Money? Analyzing and Predicting Token Consumptions in Agentic Coding Tasks}},
year = {2026},
url = {https://openreview.net/forum?id=1bUeVB3fov},
howpublished = {OpenReview},
note = {Submitted to ICLR 2026},
}Ask Althea to put this paper to the test.
Loading related content...