AI Token Tracker for WhatsApp & Telegram – Monitor Your AI Usage in Google Sheets
detail.loadingPreview
Effortlessly track your AI token usage directly from your WhatsApp and Telegram conversations. This workflow processes both text and audio messages, transcribes them, and logs your AI interactions into a Google Sheet for clear oversight and cost management.
About This Workflow
Gain unparalleled visibility into your AI service consumption with this powerful n8n workflow. Designed for users leveraging AI agents in their daily messaging, it automatically captures inputs from WhatsApp (via Evolution API webhook) and Telegram. Whether you send text or voice notes, the workflow intelligently transcribes audio using OpenAI and feeds all interactions through an AI agent (LangChain). Every engagement, including associated token counts or usage metrics, is then meticulously logged into a dedicated Google Sheet. This provides a central, accessible dashboard for monitoring, analyzing, and optimizing your AI spend, ensuring you're always in control of your usage and budget. Real-time responses are sent back to the messaging apps, ensuring a seamless user experience.
Key Features
- Multi-Channel AI Tracking: Supports both WhatsApp (via Evolution API webhook) and Telegram for comprehensive usage capture.
- Audio-to-Text Transcription: Automatically transcribes voice messages using OpenAI to process spoken inputs for AI analysis.
- Intelligent AI Agent Integration: Routes all user inputs through a LangChain AI agent for processing and usage measurement.
- Automated Google Sheet Logging: Records detailed AI interaction data, including token usage, timestamps, and user information, into a Google Sheet.
- Real-time User Feedback: Delivers immediate success or error responses back to the user's messaging app (Telegram, and implicitly WhatsApp).
How To Use
- Configure WhatsApp/Telegram Triggers: Set up the
Evolution APIwebhook for WhatsApp and theTelegramtrigger node with your respective API keys and webhook URLs. - Integrate OpenAI for Transcription: Connect the
Audio Transcriptionnode to your OpenAI credentials, ensuring Whisper API access for voice message processing. - Set Up AI Agent (LangChain): Configure the
AI Agentnode with your LangChain agent details and any necessary API keys for your chosen LLM. - Connect Google Sheets: Authenticate the
LogandErrorsGoogle Sheets nodes with your Google account and specify the spreadsheet and sheet names where you want to record data. - Define Cleaning Logic: Customize the
Clean Upcode nodes to extract and format the specific data points you wish to log (e.g., user ID, message content, token count, timestamp). - Configure Responses: Ensure the
ResponseandError ResponseTelegram nodes (and potentially WhatsApp response logic within the Evolution API path) are set up to send appropriate feedback to users.
Apps Used
Workflow JSON
{
"id": "7ccfa363-e42c-4519-973f-4d5fc0ed07d7",
"name": "AI Token Tracker for WhatsApp & Telegram – Monitor Your AI Usage in Google Sheets",
"nodes": 9,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 7ccfa363-e42c...
About the Author
SaaS_Connector
Integration Guru
Connecting CRM, Notion, and Slack to automate your life.
Statistics
Related Workflows
Discover more workflows you might like
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.
On-Demand Microsoft SQL Query Execution
This workflow allows you to manually trigger and execute any SQL query against your Microsoft SQL Server database. Perfect for ad-hoc data lookups, administrative tasks, or quick tests, giving you direct control over your database operations.