Latenode

Telegram bot that generates images from ChatGPT prompts

This template listens for Telegram bot messages, asks ChatGPT to tighten the prompt, generates a still with OpenAI Image Generation, and sends the photo back in the same chat. Put the bot token on the Telegram connection. ChatGPT and image generation are Latenode AI steps, so you do not paste an OpenAI key.

Updated Sep 16, 2026Est. run: 29sEst. cost: $0.0018
How Latenode estimates time and cost

Latenode bills workflow runtime in CPU seconds. The first 10,000 CPU seconds are free each month, then usage follows pay-as-you-go CPU-second pricing. 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 CPU seconds work →

Workflow preview

What this template does

  • Turns a Telegram message into a generated image in the same chat
  • Writes a stronger prompt with ChatGPT
  • Renders the still with OpenAI Image Generation
  • Keeps the bot token on the Telegram connection

How it works

1
Trigger

Listen for Telegram prompts

The scenario starts when the bot receives a text message. JavaScript reads that prompt and the chat id.

2
AI

Write the image prompt

ChatGPT turns the message into a clear image prompt. ChatGPT is Latenode AI, so you do not paste an OpenAI key.

3
AI

Generate the image

OpenAI Image Generation renders a still picture from that prompt.

4
Action

Send the photo

Telegram sends the file back to the same chat.

Setup guide

1

Connect Telegram

Add a Telegram connection with your bot token. Add the bot to the chat that will send prompts.

2

Add ChatGPT and image generation

Read the Telegram text in JavaScript. Ask ChatGPT to rewrite it as an image prompt, then generate the picture with OpenAI Image Generation. ChatGPT and image generation are Latenode AI nodes.

3

Send the photo

Send the generated file as a Telegram photo. Map the chat id from the trigger. Send a test prompt and confirm the picture returns in chat.

Requirements

A Telegram bot token stored on the Telegram connection
A chat the bot can read and send photos to
ChatGPT and OpenAI Image Generation available as Latenode AI steps

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. Plug-and-Play AI nodes are billed separately.