<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yosiney M on Medium]]></title>
        <description><![CDATA[Stories by Yosiney M on Medium]]></description>
        <link>https://medium.com/@ymora_36481?source=rss-dbbc57d77eb6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*yYJh4vnD9cLlqUE1</url>
            <title>Stories by Yosiney M on Medium</title>
            <link>https://medium.com/@ymora_36481?source=rss-dbbc57d77eb6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 01:09:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ymora_36481/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How Much Does Each Question to Our Bot Cost? What We Learned by Measuring It]]></title>
            <link>https://medium.com/@ymora_36481/how-much-does-each-question-to-our-bot-cost-what-we-learned-by-measuring-it-794abafe4064?source=rss-dbbc57d77eb6------2</link>
            <guid isPermaLink="false">https://medium.com/p/794abafe4064</guid>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[slack]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[cost-optimization]]></category>
            <dc:creator><![CDATA[Yosiney M]]></dc:creator>
            <pubDate>Fri, 27 Nov 2026 16:00:28 GMT</pubDate>
            <atom:updated>2026-11-27T16:00:28.265Z</atom:updated>
            <content:encoded><![CDATA[<p>A research week on tokens, caching and model routing, and why it pays to measure before you optimize.</p><h3>Why we needed a number</h3><p>At Pernix we are building a Slack bot that answers our team’s questions from our Notion documentation. It works like an office: a receptionist (Claude Haiku, fast and cheap) decides where each question goes, and a specialist (Claude Sonnet, smarter and pricier) writes the answer only when needed.</p><p>Before production we wanted to know what each question costs, and whether the optimizations in our backlog, like prompt caching or the Batch API, were worth doing. We assumed they were. Nobody had measured it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LhwX77Ih2ftIbSXcw7GV4g.png" /></figure><h3>Counting tokens before reading price tags</h3><p>Esteban Secaida and I researched separately, then merged our findings.</p><p>Models charge by tokens, chunks of text about half a word long, for what they read and write. We started with the code, not the pricing page: only two steps call a model. Then we measured three ways:</p><ul><li><strong>count_tokens</strong>, Anthropic’s free endpoint, to size each prompt.</li><li><strong>LangSmith traces:</strong> 70 calls from an experiment plus a dozen development runs.</li><li><strong>A paid test:</strong> 16 real calls, capped at US$0.10. It cost US$0.035.</li></ul><p>We ruled out using Sonnet for both steps (54% more expensive) and caching the retrieved documents, which change with every question.</p><h3>Less than a cent per question</h3><p><strong>The cost was tiny.</strong> One question costs about US$0.009. At the 100 to 200 questions per month we expect from 30 people, that is US$0.92 to US$1.83 per month. No optimization saved enough to matter, so the conversation shifted to quality and speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hYL6vUovb46k_JU_c54dnQ.png" /></figure><p><strong>Caching doesn’t always save.</strong> It’s like leaving a document open on your desk: rereading is cheap, but opening costs extra, and it closes after 5 minutes. With 5 to 9 questions a day, it would close before the next one arrives. Also, prompts under 512 tokens are silently not cached; our specialist’s is 444.</p><p><strong>Defaults nobody had reviewed.</strong> The router had no response limit, so it asked for 128,000 tokens, a blank check. And “thinking” was on by default: in one answer it was 53% of the output we paid for.</p><p><strong>Testing costs as much as production.</strong> One run of our 91-question evaluation set costs US$1.29, about a month of real usage.</p><h3>What changes in our backlog</h3><p>Budget US$1 to US$2 per month, planning for a US$3.4 to US$6.9 worst case until we have real metrics. In the backlog:</p><ul><li><strong>Postpone prompt caching;</strong> if it returns, only on the router.</li><li><strong>Keep model routing, for quality:</strong> next we test whether Haiku answers as well as Sonnet.</li><li><strong>New work:</strong> measure cost per route, set reasoning levels and limits, and run evaluations through the Batch API at half price.</li></ul><h3>Measure first</h3><p>I expected a list of savings. I got something more useful: a habit. A free endpoint, a few traces and three and a half cents of real calls showed that the expensive part of our bot isn’t the tokens, it’s the decisions we make without data.</p><p><em>Prices: Anthropic API list prices for Claude Haiku 5.5 (US$0.10 input / US$0.50 output per million tokens) and Claude Sonnet 5.5 (US$2 / US$10), checked on November 17 and 18, 2026. All costs above are computed from these prices and our measured token counts. Sources: </em><a href="https://platform.claude.com/docs/en/about-claude/pricing"><em>Pricing</em></a><em>, </em><a href="https://platform.claude.com/docs/en/build-with-claude/prompt-caching"><em>Prompt caching</em></a><em>, </em><a href="https://platform.claude.com/docs/en/build-with-claude/batch-processing"><em>Batch processing</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=794abafe4064" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>