A Chrome extension that visualizes your AI chat usage as a water footprint. It runs on ChatGPT and Gemini, estimates token consumption from your conversations (including context and file uploads), and displays the equivalent water usage in mL, L, or kL.
- Water footprint — Converts estimated token usage into a water-equivalent volume (based on energy and water-use efficiency).
- Total vs session — View all-time usage or just the current session.
- Context awareness — Counts the “re-read” cost: the model reading all previous messages to generate each new response.
- File uploads — Rough token estimates for images and text files you attach.
- Session reset — Session stats reset when you switch conversations or click “Reset this session” in the popup.
- Clone or download this repo and open the
token-ocean-extensionfolder. - In Chrome, go to chrome://extensions.
- Turn on Developer mode (top right).
- Click Load unpacked and select the
token-ocean-extensionfolder. - The Token Ocean icon should appear in your toolbar. Use it on ChatGPT or Gemini to start tracking.
- Visit ChatGPT or Gemini and have a conversation (or open an existing one).
- Click the Token Ocean icon in the toolbar to open the popup.
- See your water usage (total or this session), context size, and message count.
- Use Total / This session to switch views; use Reset this session to zero out the current session.
- Token estimation — Text is approximated at ~4 characters per token; file uploads use size- and type-based heuristics (e.g. images by size, text/JSON/CSV by byte count).
- Energy — Uses simple per-token energy constants for “prefill” (reading context) and “decode” (generating output).
- Water — Converts energy (Wh) to water volume (mL) via a water-use efficiency factor. The result is shown in mL, L, or kL depending on magnitude.
Data is stored locally in Chrome (chrome.storage.local); nothing is sent to external servers.
- storage — Used to persist water usage, context size, message count, and view preference (total vs session) locally.
| File | Purpose |
|---|---|
manifest.json |
Extension config, permissions, content scripts |
popup.html |
Popup UI structure |
popup.js |
Popup logic: view toggle, reset, formatting, display |
style.css |
Popup and (if any) injected styles |
content.js |
Injected on ChatGPT/Gemini: DOM scanning, footprint |
utils.js |
Shared: selectors, token/energy/water constants |
file-listener.js |
Main-world script for file upload detection |
icon.png |
Toolbar icon |
- Set
DEBUG_MESSAGES = trueinutils.jsand open DevTools (Inspect) on a ChatGPT or Gemini tab to see console logs from the content script. - After changing the extension, go to chrome://extensions and click the refresh icon on Token Ocean.
Use and modify as you like. Built for QHacks 2026.