<?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: Dhruv</title>
    <description>The latest articles on DEV Community by Dhruv (@dhruv_puri).</description>
    <link>https://dev.to/dhruv_puri</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%2F3846303%2F5590b2c4-bea6-41e8-8fc7-6535bae23a24.jpg</url>
      <title>DEV Community: Dhruv</title>
      <link>https://dev.to/dhruv_puri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dhruv_puri"/>
    <language>en</language>
    <item>
      <title>I built a Chrome extension that shows your ChatGPT token usage in real-time</title>
      <dc:creator>Dhruv</dc:creator>
      <pubDate>Sun, 31 May 2026 05:20:51 +0000</pubDate>
      <link>https://dev.to/dhruv_puri/i-built-a-chrome-extension-that-shows-your-chatgpt-token-usage-in-real-time-2lgn</link>
      <guid>https://dev.to/dhruv_puri/i-built-a-chrome-extension-that-shows-your-chatgpt-token-usage-in-real-time-2lgn</guid>
      <description>&lt;p&gt;Ever wonder how many tokens you've actually used in ChatGPT today? I did — and I couldn't find anything that tracked it properly, so I built one.&lt;br&gt;
ChatGPT Counter is a lightweight Chrome extension that sits at the top of every ChatGPT page and tracks your daily token usage live as you chat.&lt;br&gt;
What it does&lt;/p&gt;

&lt;p&gt;📊 Real-time progress bar that updates as you type and receive responses&lt;br&gt;
🎨 Color-coded warnings — Blue (normal) → Orange (approaching limit) → Red (danger zone)&lt;br&gt;
🤖 Model detection — knows which model you're using (GPT-4o, o1, etc.)&lt;br&gt;
📅 Plan-aware limits — tracks against your actual daily limit&lt;br&gt;
🔄 Auto-resets at midnight&lt;/p&gt;

&lt;p&gt;How it works&lt;br&gt;
The extension intercepts ChatGPT's internal SSE (Server-Sent Events) API responses using a page-world injected script, reads the token counts from the stream, and accumulates them with delta-tracking so the count is always accurate across the session.&lt;br&gt;
The trickiest part was getting the fetch interception to work inside ChatGPT's sandboxed environment without breaking the page — took a few iterations to get right.&lt;br&gt;
Tech used&lt;/p&gt;

&lt;p&gt;Vanilla JavaScript&lt;br&gt;
Chrome Extensions Manifest V3&lt;br&gt;
o200k_base tokenizer (same one OpenAI uses)&lt;br&gt;
CSS for the overlay UI&lt;/p&gt;

&lt;p&gt;Try it&lt;br&gt;
⭐ GitHub: &lt;a href="https://github.com/Dhruvg0/Chatgpt-token-counter" rel="noopener noreferrer"&gt;github.com/Dhruvg0/Chatgpt-token-counter&lt;/a&gt;&lt;br&gt;
Would love any feedback or contributions!&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiq9ivqns8odetlfl8xm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjiq9ivqns8odetlfl8xm.png" alt=" " width="800" height="133"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>chatgpt</category>
      <category>chromeextension</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
