Track Expenses Automatically with Telegram Bot using GPT-4o, OCR and Voice Recognition
Personal Expense Tracker Bot π°
AI-powered Telegram bot for effortless expense tracking. Send receipts, voice messages, or text - the bot automatically extracts and categorizes your expenses.
β¨ Key Features
πΈ Receipt & Invoice OCR** - Send photos of receipts or PDF invoices, AI extracts expense data automatically π€ Voice Messages** - Speak your expenses naturally, audio is transcribed and processed π¬ Natural Language** - Just type "spent 50 on groceries" or any text format π Multilingual** - Processes documents in any language (EN, DE, PT, etc.) π Smart Statistics** - Get monthly totals, category breakdowns, multi-month comparisons π Private & Secure** - Single-user authorization, only you can access your data β‘ Zero Confirmation** - Expenses are added instantly, no annoying "confirm?" prompts
π― How It Works
Send expense data via Telegram: Photo of receipt PDF invoice Voice message Text message
AI processes automatically: Extracts amount, date, vendor Categorizes expense Stores in organized format
Query your expenses: "Show my expenses for November" "How much did I spend on groceries?" "Compare last 3 months"
π Expense Categories
Groceries, Transportation, Housing, Utilities, Healthcare, Entertainment, Dining Out, Clothing, Education, Subscriptions, Personal Care, Gifts, Travel, Sports, Other
π§ Setup Requirements
- Telegram Bot Create a Telegram bot via @BotFather and get your API token.
Configure credentials for nodes: Input, WelcomeMessage, GetAudioFile, GetAttachedFile, GetAttachedPhoto ReplyText, NotAuthorizedMessage, DeleteProcessing
- OpenRouter API Get API key from OpenRouter for AI processing.
Configure credentials for: Gpt4o (main processing) Sonnet45 (expense assistant)
- Ainoflow API Get API key from Ainoflow for storage and OCR.
Configure Bearer credentials for: GetConfig, SaveConfig ExtractFileText, ExtractImageText TranscribeRecording JsonStorageMcp (MCP tool)
ποΈ Workflow Architecture
| Section | Description | |---------|-------------| | Message Trigger | Receives all Telegram messages | | Bot Privacy | Locks bot to first user, rejects unauthorized access | | Chat Message / Audio | Routes text and voice messages to AI | | Document / Photo | Extracts text from files via OCR and forwards to AI | | Root Agent | Routes messages to Expense Assistant, validates responses | | Expense Assistant | Core logic: stores expenses, calculates statistics | | Result / Reply | Sends formatted response back to Telegram | | Cleanup / Reset | Manual trigger to delete all data (β οΈ use with caution) |
π¬ Usage Examples
Adding Expenses πΈ [Send receipt photo] β Added: 45.50 EUR - Groceries (Lidl)
π€ "Bought coffee for five euros"
β Added: 5.00 EUR - Dining Out (coffee)
π¬ "50 uber" β Added: 50.00 EUR - Transportation (uber)
Querying Expenses "Show my expenses" β November 2025: 1,250.50 EUR (23 expenses) Top: Groceries 450β¬, Transportation 280β¬, Dining 220β¬
"How much on entertainment this month?" β Entertainment: 85.00 EUR (3 expenses)
"Compare October and November"
β Oct: 980β¬ | Nov: 1,250β¬ (+27%)
π¦ Data Storage
Expenses are stored in JSON format organized by month (YYYY-MM): { "id": "uuid", "amount": 45.50, "currency": "EUR", "category": "Groceries", "description": "Store name", "date": "2025-11-10T14:30:00Z", "created_at": "2025-11-10T14:35:22Z" }
β οΈ Important Notes
First user locks the bot** - Run /start to claim ownership Default currency is EUR** - AI auto-detects other currencies Cleanup deletes ALL data** - Use manual trigger with caution No confirmation for adding** - Only delete operations ask for confirmation
π οΈ Customization
Change default currency in agent prompts Add/modify expense categories in ExpenseAssistant Extend Root Agent with additional assistants Adjust AI models (swap GPT-4o/Sonnet as needed)
π Related Resources
Create Telegram Bot OpenRouter Credentials Ainoflow Platform
πΌ Need Customization?
Want to adapt this template for your specific needs? Custom integrations, additional features, or enterprise deployment?
Contact us at Ainova Systems - We build AI automation solutions for businesses.
Tags: telegram, expense-tracker, ai-agent, ocr, voice-to-text, openrouter, mcp-tools, personal-finance
Tags
Related Templates
Use OpenRouter in n8n versions <1.78
What it is: In version 1.78, n8n introduced a dedicated node to use the OpenRouter service, which lets you to use a lot...
Task Deadline Reminders with Google Sheets, ChatGPT, and Gmail
Intro This template is for project managers, team leads, or anyone who wants to automatically remind teammates of tasks ...
π€ Build Resilient AI Workflows with Automatic GPT and Gemini Failover Chain
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. How it works This...
π Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments