<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Habeeb Rahman</title>
    <description>The latest articles on DEV Community by Habeeb Rahman (@mdhbr).</description>
    <link>https://dev.to/mdhbr</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3838756%2Fb64eacbd-1730-4392-8ace-1875c2df9a1d.png</url>
      <title>DEV Community: Habeeb Rahman</title>
      <link>https://dev.to/mdhbr</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mdhbr"/>
    <language>en</language>
    <item>
      <title>How to See What Your OpenClaw AI Assistant Actually Costs Per Conversation</title>
      <dc:creator>Habeeb Rahman</dc:creator>
      <pubDate>Thu, 26 Mar 2026 21:04:08 +0000</pubDate>
      <link>https://dev.to/mdhbr/how-to-see-what-your-openclaw-ai-assistant-actually-costs-per-conversation-47gi</link>
      <guid>https://dev.to/mdhbr/how-to-see-what-your-openclaw-ai-assistant-actually-costs-per-conversation-47gi</guid>
      <description>&lt;p&gt;I've been running OpenClaw for a few months — it's become my daily AI assistant across WhatsApp and Telegram, handling emails, research, calendar stuff. It's genuinely great.&lt;/p&gt;

&lt;p&gt;But at the end of month one, I opened my Anthropic billing dashboard and saw $43.&lt;/p&gt;

&lt;p&gt;I had no idea where it came from. Which conversations? Which agent? The long research session, or just daily chit-chat? No clue.&lt;/p&gt;

&lt;p&gt;This is a known issue in the OpenClaw community — there are open feature requests for native token tracking and a CLI usage command that haven't shipped yet. So I went looking for a workaround.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem With API Billing Dashboards
&lt;/h2&gt;

&lt;p&gt;The Anthropic and OpenAI dashboards show your total spend, but they're aggregated (no per-conversation breakdown), delayed (often 24+ hours behind), and only model-level (you can see "Claude Sonnet cost $31" but not which feature or session drove that).&lt;/p&gt;

&lt;p&gt;If you're running a personal AI assistant that touches multiple models — Anthropic for complex tasks, a local Ollama model for simple ones — you have zero visibility into what's costing money vs what's free.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Fix: One Import
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/burn0-dev/burn0" rel="noopener noreferrer"&gt;burn0&lt;/a&gt; is a tiny Node.js library that solves this. It patches fetch and node:http at the runtime level, so it sees every outbound API call your app makes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @burn0/burn0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then at the top of your entry file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;@burn0/burn0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now every API call to Anthropic, OpenAI, Ollama, or any of 50+ other services gets intercepted, and you see real-time cost breakdowns in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;burn0 &amp;gt; $0.04 today (12 calls) -- anthropic: $0.031 | openai: $0.009
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Why This Works Well With OpenClaw
&lt;/h2&gt;

&lt;p&gt;OpenClaw is Node.js — burn0 slots right in.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It tracks local models too.&lt;/strong&gt; OpenClaw supports Ollama and other local models. burn0 shows these as $0.00, so you can see the real dollar savings from routing locally vs cloud.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It reads actual token counts, not estimates.&lt;/strong&gt; Token counts come directly from each API response's metadata — exact numbers, not guesses based on character counts.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Zero changes to OpenClaw.&lt;/strong&gt; Works at the HTTP layer, no fork needed. When native tracking ships, remove the import.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Privacy-first.&lt;/strong&gt; Runs entirely locally. Never reads request or response bodies — only metadata. Nothing leaves your machine.&lt;/p&gt;

&lt;h2&gt;
  
  
  What It Looks Like in Practice
&lt;/h2&gt;

&lt;p&gt;During a typical OpenClaw session:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;burn0 &amp;gt; anthropic/claude-sonnet  -&amp;gt;  $0.023  (in: 1847 / out: 312)
burn0 &amp;gt; anthropic/claude-haiku   -&amp;gt;  $0.001  (in: 423 / out: 89)
burn0 &amp;gt; openai/gpt-4o-mini       -&amp;gt;  $0.0004 (in: 156 / out: 44)
burn0 &amp;gt; localhost (ollama)        -&amp;gt;  $0.000  (in: 891 / out: 203)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The Sonnet call cost 23x more than Haiku, and the Ollama call was free. Over a week, this makes it obvious which workflows are worth routing to cheaper models.&lt;/p&gt;

&lt;h2&gt;
  
  
  Getting Started
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; @burn0/burn0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add one line to your entry point and you're done.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;GitHub: &lt;a href="https://github.com/burn0-dev/burn0" rel="noopener noreferrer"&gt;burn0&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Website: &lt;a href="https://burn0.dev" rel="noopener noreferrer"&gt;burn0.dev&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;MIT licensed, free forever, no account required&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're running OpenClaw and curious what it's actually costing you per day, give it a try. Would love to hear what you find.&lt;/p&gt;

</description>
      <category>ai</category>
      <category>opensource</category>
      <category>javascript</category>
    </item>
    <item>
      <title>How I accidentally built a cost tracking tool for LLMs</title>
      <dc:creator>Habeeb Rahman</dc:creator>
      <pubDate>Tue, 24 Mar 2026 00:13:09 +0000</pubDate>
      <link>https://dev.to/mdhbr/how-i-accidentally-built-a-cost-tracking-tool-for-llms-43oc</link>
      <guid>https://dev.to/mdhbr/how-i-accidentally-built-a-cost-tracking-tool-for-llms-43oc</guid>
      <description>&lt;p&gt;Last month I got an API bill that made me physically flinch. $2,847. I had no idea where it came from.&lt;/p&gt;

&lt;p&gt;I was building a side project — a fairly standard app with OpenAI for chat, Anthropic for summarization, Stripe for payments, Supabase for the database, and SendGrid for emails. Five services, each with their own dashboard, their own billing page, their own definition of "usage."&lt;/p&gt;

&lt;p&gt;I found myself opening five tabs every morning just to check if something had spiked overnight. It was miserable. So I wrote a quick script to intercept outgoing API calls and log the cost next to each one. Just a &lt;code&gt;console.log&lt;/code&gt; with a dollar amount. Nothing fancy.&lt;/p&gt;

&lt;p&gt;But then something interesting happened. I saw that my onboarding flow was making 14 LLM calls per new user. Fourteen. I'd built a multi-step wizard where each step called GPT-4o separately, when a single call could have handled it. That one fix cut my daily OpenAI spend by 60%.&lt;/p&gt;

&lt;p&gt;I started showing the script to friends who were building with LLMs. They all had the same reaction: "Wait, I can see the cost &lt;em&gt;per request&lt;/em&gt;?" Turns out nobody was tracking this. Everyone just waited for the monthly bill and hoped for the best.&lt;/p&gt;

&lt;p&gt;So I cleaned it up and turned it into &lt;a href="https://burn0.dev" rel="noopener noreferrer"&gt;burn0&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  What it does
&lt;/h2&gt;

&lt;p&gt;You add one line to your entry point:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;burn0&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it. burn0 auto-detects 50+ services — OpenAI, Anthropic, Stripe, Supabase, Twilio, SendGrid, and more — and tracks costs per request in your terminal. No agents to deploy, no complex setup.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;burn0 scan&lt;/code&gt; to see every API service in your codebase. Run &lt;code&gt;burn0 report&lt;/code&gt; to get a cost breakdown with model names, endpoints, and a running total. You can even attribute costs to specific features with &lt;code&gt;burn0 track &amp;lt;feature&amp;gt;&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Beyond the CLI
&lt;/h2&gt;

&lt;p&gt;What started as a terminal tool kept growing. You can create custom API entries for any internal or third-party service burn0 doesn't recognize yet, and monitor your production APIs' costs from a dashboard. It gives you a single pane of glass for your entire stack — LLMs, payment processors, databases, messaging services, everything — so you can finally answer "what does this user session actually cost?" in real time.&lt;/p&gt;

&lt;h2&gt;
  
  
  What surprised me
&lt;/h2&gt;

&lt;p&gt;The tool I built for myself turned out to solve a problem almost every developer building with APIs has — especially anyone working with LLMs, where a single bad prompt template can burn through hundreds of dollars overnight.&lt;/p&gt;

&lt;p&gt;If your API bill has ever surprised you, give it a try:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;npx @burn0/burn0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Everything runs locally. No data leaves your machine. It's free and open source.&lt;/p&gt;

&lt;p&gt;I'd love to hear what you find — especially the "oh no" moments when you see what a feature actually costs.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>llm</category>
      <category>infrastructure</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
