<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr" -->

---
title: I Measured 23,968 Agent Turns. The Prompt Was 309× the...
description: An analysis of 166 real coding-agent sessions (23,968 billed turns, $5,816 spent) shows the prompt-to-output token ratio is 309:1, because the stateless API...
canonical: https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: I Measured 23,968 Agent Turns. The Prompt Was 309× the Output. | daily.dev
og:description: An analysis of 166 real coding-agent sessions (23,968 billed turns, $5,816 spent) shows the prompt-to-output token ratio is 309:1, because the stateless API...
og:url: https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr
og:image: https://api.daily.dev/og/posts/liVgzSNPR.png
og:image:alt: I Measured 23,968 Agent Turns. The Prompt Was 309× the Output.
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# I Measured 23,968 Agent Turns. The Prompt Was 309× the Output.

**[The Infinity](https://daily.dev/sources/theinfinity-dev)** · [@serdarbuyukdereli](https://daily.dev/serdarbuyukdereli) · 12 min read · 2 upvotes · 0 comments

## Summary

An analysis of 166 real coding-agent sessions (23,968 billed turns, $5,816 spent) shows the prompt-to-output token ratio is 309:1, because the stateless API resends the entire conversation history on every turn. Cost per turn grows roughly quadratically with step count — identical work costs 3.8x more at turn 190 than turn 5. Prompt caching cuts costs 7.3x (98% of tokens served from cache), but doesn't change the underlying quadratic growth; one changed byte in the prefix invalidates the whole cache. Repeated tool calls (loop signals) are individually cheap (0.86x average) but structurally expensive because they add turns late in the session and permanently inflate context. Context compaction cuts token count ~92% but destroys detail the agent may need to rediscover. Recommended dashboard metrics: prompt-to-output ratio, repeated tool call counts, and cache read share.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://theinfinity.dev/articles/agent-token-cost-measured>

## Questions this post answers

### Why does an AI agent cost more per turn as a conversation gets longer?

Because the model API is stateless, so every turn resends the entire conversation history, not just the new message. On turn 40 an agent might generate 300 tokens, but the prompt carrying them includes all 39 previous turns and gets billed in full. Measured across 23,968 real turns, an identically-sized turn cost 3.8x more at turn position 190 than at position 5.

_Anyone budgeting for agent workloads can use daily.dev to track how token economics research like this evolves._

### How much money does prompt caching actually save on LLM agent workloads?

About 7.3x in one measured dataset: $5,816 in actual spend across 166 sessions versus a projected $42,649 for the same work without caching, since 98% of all prompt tokens were served from cache at roughly a tenth of list price. Caching does not change the underlying quadratic growth in prompt size, it only divides the cost coefficient of that growth by about ten.

_Teams weighing caching strategies for agent cost control can follow this kind of analysis on daily.dev._

### Are repeated tool calls in an AI agent loop actually expensive?

Not individually, which makes them easy to miss. Measured against the average turn in the same session, repeated tool calls cost about 0.86x, slightly cheaper than typical turns, because rerunning a command produces less output than reasoning does. The real cost is structural: loops add turns late in a session where cost per turn is already high, and their output permanently inflates every later turn's context.

_Developers debugging runaway agent bills can track cost-observability techniques like this on daily.dev._

## Similar posts on daily.dev

- [Why your AI pipeline costs 10x more after the demo](https://daily.dev/posts/why-your-ai-pipeline-costs-10x-more-after-the-demo-loavt2qiu) · The New Stack · 0 upvotes · 0 comments
- [The Subagent Tax, Measured: 23,747 Turns of Real Billing Data](https://daily.dev/posts/the-subagent-tax-measured-23-747-turns-of-real-billing-data-fbixu1ehv) · The Infinity · 2 upvotes · 0 comments
- [The true cost of saying "Hi" to an AI agent](https://daily.dev/posts/the-true-cost-of-saying-hi-to-an-ai-agent-7f8awuhpa) · Quesma · 2 upvotes · 0 comments
- [The Hidden Cache You’re Paying For But Not Using](https://daily.dev/posts/the-hidden-cache-you-re-paying-for-but-not-using-0w5qklioj) · Medium · 0 upvotes · 0 comments
- [AI Agent Token Costs: How to Cut Your Bill by 60-80%](https://daily.dev/posts/ai-agent-token-costs-how-to-cut-your-bill-by-60-80--nglqddiuw) · Alex CloudStar · 1 upvotes · 0 comments

---

Tags: [#llm](https://daily.dev/tags/llm), [#ai-agents](https://daily.dev/tags/ai-agents), [#observability](https://daily.dev/tags/observability), [#claude](https://daily.dev/tags/claude), [#ai-inference](https://daily.dev/tags/ai-inference)

[View this post on daily.dev](https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"I Measured 23,968 Agent Turns. The Prompt Was 309× the Output.","url":"https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr"},"datePublished":"2026-08-16T11:39:51.052Z","dateModified":"2026-09-13T19:00:19.509Z","description":"An analysis of 166 real coding-agent sessions (23,968 billed turns, $5,816 spent) shows the prompt-to-output token ratio is 309:1, because the stateless API...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/28b0e7a5f303546fe5b9aaf279f9994b?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/28b0e7a5f303546fe5b9aaf279f9994b?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"The Infinity","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Person","name":"Serdarcan Buyukdereli","url":"https://daily.dev/serdarbuyukdereli","image":"https://media.daily.dev/image/upload/s--tTV8hAPq--/f_auto/v1778701721/avatars/avatar_Su5HqluAE4wLRb1naHjtv?_a=BAMAMiWQ0","description":"Senior Devops and Cloud Engineer\n","interactionStatistic":{"@type":"InteractionCounter","interactionType":{"@type":"EndorseAction"},"userInteractionCount":21430}},"commentCount":0,"discussionUrl":"https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":2},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"llm,ai-agents,observability,claude,ai-inference","timeRequired":"PT12M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"The Infinity","item":"https://daily.dev/sources/theinfinity-dev"},{"@type":"ListItem","position":3,"name":"I Measured 23,968 Agent Turns. The Prompt Was 309× the Output."}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/i-measured-23-968-agent-turns-the-prompt-was-309-the-output--livgzsnpr#faq","mainEntity":[{"@type":"Question","name":"Why does an AI agent cost more per turn as a conversation gets longer?","acceptedAnswer":{"@type":"Answer","text":"Because the model API is stateless, so every turn resends the entire conversation history, not just the new message. On turn 40 an agent might generate 300 tokens, but the prompt carrying them includes all 39 previous turns and gets billed in full. Measured across 23,968 real turns, an identically-sized turn cost 3.8x more at turn position 190 than at position 5. Anyone budgeting for agent workloads can use daily.dev to track how token economics research like this evolves."}},{"@type":"Question","name":"How much money does prompt caching actually save on LLM agent workloads?","acceptedAnswer":{"@type":"Answer","text":"About 7.3x in one measured dataset: $5,816 in actual spend across 166 sessions versus a projected $42,649 for the same work without caching, since 98% of all prompt tokens were served from cache at roughly a tenth of list price. Caching does not change the underlying quadratic growth in prompt size, it only divides the cost coefficient of that growth by about ten. Teams weighing caching strategies for agent cost control can follow this kind of analysis on daily.dev."}},{"@type":"Question","name":"Are repeated tool calls in an AI agent loop actually expensive?","acceptedAnswer":{"@type":"Answer","text":"Not individually, which makes them easy to miss. Measured against the average turn in the same session, repeated tool calls cost about 0.86x, slightly cheaper than typical turns, because rerunning a command produces less output than reasoning does. The real cost is structural: loops add turns late in a session where cost per turn is already high, and their output permanently inflates every later turn's context. Developers debugging runaway agent bills can track cost-observability techniques like this on daily.dev."}}]}
```

