TheBotCreator
← All guides
AI

How to make an AI chatbot for Telegram with ChatGPT (no code)

· 5 min read

An AI chatbot can answer questions, write replies and help customers at any hour. With TheBotCreator you connect your own OpenAI key, tell the AI how to behave and decide exactly when it replies, so you keep control of both the answers and the cost.

How it works

An AI reply step sends a prompt to an OpenAI model, such as gpt-4o-mini, and stores the answer in a variable. A Send message step then sends that answer to the user.

The calls run on your own OpenAI API key and are billed to your OpenAI account, so you choose the model and pay OpenAI’s price with no markup.

Build it

  1. Create a bot and paste your BotFather token.
  2. Open Settings and paste your OpenAI API key. It is stored encrypted.
  3. Create a flow and set it as the Fallback flow at the bottom of the Triggers panel, so it runs for every message that matches no other trigger.
  4. Add an AI reply step. In Instructions describe the bot, for example "You are the assistant of Ada’s Bakery. Answer briefly. Only talk about our products, prices and opening hours."
  5. Set the Prompt to {{update.text}} and Store reply as to answer.
  6. Add a Send message step with {{vars.answer}}, then test and publish.

Keep it reliable

Set Store error as to a variable such as ai_error. It stays empty on success, otherwise it holds a code such as no_api_key, quota_exceeded or timeout. A Condition step can then send a friendly fallback message instead of going silent.

Each AI reply step answers one message and does not remember earlier ones. Put the facts it needs, such as prices and opening hours, in the Instructions, and add saved variables like {{vars.name}} to the prompt when you want it to know more about the user.

Mix AI with buttons and people

Keep buttons for the most common questions, so they get the same answer every time and cost nothing. Use AI for everything else, and add a "Talk to a human" button with a Live chat step for anything the AI should not handle.

Frequently asked questions

Do I need a ChatGPT Plus subscription?

No. You need an OpenAI API key from platform.openai.com. API usage is billed separately by OpenAI, per message.

Which models can I use?

The AI reply step offers gpt-4o-mini, gpt-4.1-mini, gpt-4.1-nano, gpt-4o and gpt-4.1. gpt-4o-mini is a good, low-cost default.

Can the AI answer from my own documents?

Not yet. For now, put the key facts in the step’s Instructions, which hold up to 2,000 characters.

Step-by-step tutorials

More guides