Latenode

Telegram AI Image Generator with Quota Tracking in Google Sheets

This Latenode automation allows Telegram users to generate high-quality AI-powered images by sending message prompts to a bot. The workflow first checks the user's daily request quota, then enhances the prompt using GPT-4o before generating the image using the Flux Pro AI model.

The final image is sent back to the user in the Telegram chat, and all requests are logged in a Google Sheets spreadsheet for usage tracking. This integration aims to provide an easy-to-use, AI-powered image generation tool directly within the Telegram messaging platform.

Updated Apr 6, 2026Est. run: 26sEst. cost: $0.0703
How Latenode estimates time and cost

Latenode bills workflow runs in credits: 1 credit = 30 seconds of processing. Minimum charge per run depends on your plan. Plug-and-Play (PnP) AI nodes are billed separately—each PnP token is $1 USD, charged pay-as-you-go at vendor cost plus a small processing fee, with no API keys required.

Full pricing — how credits work →
Messaging & bots

Workflow preview

What this template does

  • Checks user's daily request quota before generating images
  • Enhances user prompts using GPT-4o to improve output quality
  • Generates high-quality images using the Flux Pro AI model
  • Sends the final image directly to the user in the Telegram chat
  • Logs all requests in a Google Sheets spreadsheet for usage tracking

How it works

1
Trigger

Receive Telegram Message

The workflow is triggered when a Telegram user sends a message to the bot, containing a prompt for generating an AI-powered image.

2
Logic

Check Daily Limit

The system fetches the user's usage logs from a Google Sheets spreadsheet to check if they have exceeded their daily limit of 5 image requests.

3
Logic

Calculate Today's Requests

The system counts the total number of requests made by the user today to determine if the daily limit has been reached.

4
Logic

Set Daily Limit

The system is configured to limit each user to a maximum of 5 image requests per day.

5
AI

Enhance Prompt with GPT-4o

The system uses the GPT-4o large language model to analyze and enhance the user's image prompt, improving its quality and specificity.

6
AI

Generate Image with Flux Pro

The enhanced prompt is then used to generate a high-quality AI-powered image using the Flux Pro AI model.

7
AI

Describe Generated Image

The system uses GPT-4o to generate a descriptive caption for the created image.

8
Action

Send Image to User

The generated image, along with its description, is then sent back to the Telegram user within the chat.

9
Action

Log Generation in Google Sheets

The details of the user's image request, including the query and the result URL, are recorded in a Google Sheets spreadsheet for usage tracking.

Setup guide

1

Add Telegram Bot Credentials

1. In the Latenode Credentials panel, add a new Telegram credential. Enter your bot token and chat ID.

2

Configure Google Sheets Integration

1. In the Latenode Credentials panel, add a new Google Sheets credential. Authorize Latenode to access your Google account and select the Google Sheets document and sheet you want to use for logging requests. 2. Add a Google Sheets node to your workflow and configure it to write data to the selected sheet.

3

Set up OpenAI GPT-4o Integration

1. In the Latenode Credentials panel, add a new OpenAI credential. Enter your API key for the GPT-4o model. 2. Add an OpenAI node to your workflow and configure it to use the GPT-4o model for prompt enhancement.

4

Configure Flux Pro Image Generation

1. In the Latenode Credentials panel, add a new AIMLAPI credential. Enter your API key for the Flux Pro image generation model. 2. Add an AIMLAPI node to your workflow and configure it to use the Flux Pro model for image generation.

5

Set Daily Request Limit

1. In the Latenode node settings, configure the daily request limit per user (e.g., 5 requests). 2. Add a node to check the user's current request count and compare it to the daily limit before proceeding with image generation.

Requirements

Telegram bot API token to authenticate the bot and receive/send messages
OpenAI API key to access the GPT-4o language model for prompt enhancement
Flux Pro API key to generate high-quality AI images using their model
Google Sheets API credentials to log all requests and track usage in a spreadsheet

FAQ

Common questions about this template

Each run uses credits on your Latenode plan. We charge for processing time (1 credit = 30 seconds). Your actual cost depends on your plan and how long the run takes. See pricing plans for plans and how credits work.

More templates

You might also like

Browse all templates →
Messaging & bots

Automate WhatsApp Sales with AI Chatbots and Product Data

This Latenode automation allows users to build a WhatsApp chatbot that acts as a sales agent, providing automated responses to customer inquiries. The chatbot is powered by a product catalog vector store and an AI language model, allowing it to understand and respond to user messages in real-time. The workflow involves importing a product brochure, extracting the text, creating a vector store, and using the OpenAI language model and a memory buffer to generate relevant responses to WhatsApp users. The chatbot can handle both text messages and non-text messages, with the latter triggering a standard response. This automation is designed for businesses looking to enhance their customer support and sales efforts through a conversational WhatsApp interface.

26s$0.0703
Messaging & bots

Instantly sync Facebook Messenger to your WhatsApp for real-time alerts

This automation allows users to automatically send incoming Facebook Messenger messages to a specified WhatsApp account as real-time notifications. It is designed for users who need to stay on top of their Facebook Messenger communications while on the go, allowing them to respond quickly via WhatsApp. The automation integrates with Facebook Messenger and WhatsApp to monitor for new messages and forward them to the designated WhatsApp contact.

26s$0.0703
Messaging & bots

Automate Telegram Chatbots with AI-Powered Responses

This AI-powered Telegram bot aims to provide instant, relevant replies to user messages by integrating with advanced AI models. The bot will analyze incoming messages and generate appropriate responses tailored to the user's queries, drawing from the capabilities of language models and other AI technologies. This solution is designed to streamline communication and enhance the user experience within the Telegram messaging platform, offering an intelligent and conversational interface that can handle a wide range of user inquiries efficiently.

26s$0.0703