Templates / Create a multi-model AI chatbot with Telegram, AIMLAPI, and Google Sheets

Create a multi-model AI chatbot with Telegram, AIMLAPI, and Google Sheets

Unknown

by AI/ML API | D1m7asis βœ“ Β· 1,071 views Β· created 2025-08-06 Β· Personal Productivity, AI Chatbot

Unknown. This template uses community nodes we can't verify statically. Uses community nodes that can't be verified statically (unverified community packages are off by default in 3.0). Static check, last run 2026-10-19.

Community nodes

These come from third-party npm packages. In n8n 3.0 unverified community packages are off by default (N8N_UNVERIFIED_PACKAGES_ENABLED=false).

Nodes used (10)

TelegramGoogle Sheets

What it does

πŸ“² AI Multi-Model Telegram Chatbot (n8n + AIMLAPI) This n8n workflow enables Telegram users to interact with multiple AI models dynamically using modelid commands. It also supports a /models command to list all available models. Each user has a daily usage limit, tracked via Google Sheets. --- πŸš€ Key Features Dynamic Model Selection: Users choose models on-the-fly via modelid (e.g., openai/gpt-4o). /models Command: Lists all available models grouped by provider. Daily Limit Per User: Enforced using Google Sheets. Prompt Parsing: Extracts model and message from user input. Logging: Logs every request & result into Google Sheets for usage tracking. Seamless Telegram Delivery: Responses are sent directly back to the chat. --- πŸ›  Setup Guide 1. πŸ“² Create a Telegram Bot Go to @BotFather Use /newbot β†’ Set name & username. Copy the generated API token. 2. πŸ” Add Telegram Credentials to n8n Go to n8n > Credentials > Telegram API. Create a new credential with the BotFather token. 3. πŸ“— Google Sheets Setup Create a Google Sheet named Sheet1. Add columns: userid | date | query | result Share the sheet with your Service Account or OAuth Email (depending on auth method). 4. πŸ”Œ Connect AIMLAPI Get your API key from AIMLAPI. In n8n > Credentials, add AI/ML API: API Key: yourkeyhere. 5. βš™οΈ Customize Limits & Enhancements Adjust daily limits in the Set Daily Limit node. Optional: Add NSFW content filtering. Implement alias commands. Extend with /help, /usage, /history. Add inline button UX (advanced). --- πŸ’‘ How It Works ➑️ Command Examples: 1. Start a chat with a specific model: openai/gpt-4o Write a motivational quote. 2. Request available models list: /models ➑️ Workflow Logic: 1. Receives a Telegram message. 2. Switch node checks if the message is /models or a prompt. 3. For /models, it fetches and sends a grouped list of models. 4. For prompts: Checks usage limits. Parses modelid and prompt text. Dynamically routes the request to the chosen model. Sends the AI's response back to the user. Logs the query & result to Google Sheets. 5. If daily limit exceeded β†’ sends a limit exceeded message. --- πŸ§ͺ Testing & Debugging Tips Test via a separate Telegram chat. Use Console/Set nodes to debug payloads. Always test commands by messaging the bot (not via "Execute Node"). Validate cases: Missing modelid. Invalid modelid. Limit exceeded handling.

View the original on n8n.io β†’ Check your own copy

Get the weekly β€œwhat broke” email

New templates, newly broken ones, and n8n release changes. One short email a week.

Form not loading? Subscribe here.