๐Ÿ“Š AI Token Tracker for WhatsApp & Telegram โ€“ Save AI Usage to Google Sheets

Go to Workflow
464 views
Built by Amanda Benks Amanda Benks
Created on June 05, 2026

Description

๐Ÿ’ธ GPT-4o Token Tracker โ€“ Measure AI Usage and Cost via WhatsApp or Telegram

Hi! I'm Amanda โ€” I create smart, useful AI automations for n8n and Make.
This workflow helps you monitor how many tokens are consumed per conversation with AI Agent Tokens, and logs that usage into Google Sheets โ€” so you can track expenses and make smarter decisions about your AI usage.

You can connect it to Telegram or WhatsApp (via Evolution API), and it will automatically capture:
Prompt and completion tokens
Total tokens
Time of interaction
The user/channel
(Optional) Cost estimate in USD

๐Ÿ“Š What this workflow does

Logs token usage from LangChain agents
Calculates token totals for each request
Appends the data to a structured Google Sheet
Works with WhatsApp (Evolution API) or Telegram bots
Ideal for tracking AI Agent Tokens usage over time and controlling costs

๐Ÿงช Free Spreadsheet Template

You can duplicate and use this template for logging token usage:
๐Ÿ‘‰ Google Sheets Template

Includes columns like:
Date
Input
Output
Tokens (Prompt / Completion / Total)
Tool name or use case
Estimated cost

๐Ÿ› ๏ธ Setup Instructions

Import the workflow to your n8n (Cloud or self-hosted)
Connect your Google Sheets account
Choose your trigger:
WhatsApp (Evolution API webhook)
Telegram (Bot webhook or message input)
Fill out:
AI Agent model used (e.g. gpt-4o)
Cost per 1K tokens (optional, for USD estimation)
Update spreadsheet ID and tab name in the Google Sheets node
(Optional) Connect as a sub-tool to an AI agent for automatic logging

๐Ÿงฐ Tech Used

OpenRouter
LangChain
Google Sheets
Telegram or WhatsApp webhook (Evolution API)
Nodes: HTTP Request, Set, If, Google Sheets, Merge

โœ… Who This Is For

Developers or agencies that want to monitor AI Agent Tokens usage
Freelancers managing AI bots for clients
Teams that need billing visibility and cost control
Anyone who wants transparency in AI token spending

โœ… Requirements

OpenAI GPT-4o access
Google Sheets credential
Telegram Bot Token (or Evolution API access for WhatsApp)
n8n (Cloud or self-hosted)

๐ŸŒ Want this template?

โค๏ธ Buy more workflows at: https://iloveflows.com
โ˜๏ธ Try n8n Cloud: https://n8n.partnerlinks.io/amanda

Nodes Used (7)

AI Agent
@n8n/n8n-nodes-langchain.agent
Code
n8n-nodes-base.code
Google Sheets
n8n-nodes-base.googleSheets
HTTP Request
n8n-nodes-base.httpRequest
OpenAI
@n8n/n8n-nodes-langchain.openAi
OpenRouter Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenRouter
Telegram
n8n-nodes-base.telegram