Demo Telegram Bot YandexGPT

Updated March 31, 2026

A Telegram bot on the Yandex Cloud serverless stack assisted by YandexGPT to reply to questions from users.

Features

  • Written in Python with the python-telegram-bot library.
  • Does not maintain conversation context.
  • Supports skill updates.

What goes into the cost of using the bot

Deployment instructions
  1. Register your bot in Telegram and get a token:

    1. Start the @BotFather bot and select the /newbot command.
    2. Name your bot, e.g., Serverless Echo Telegram Bot. This is the name users will see when talking to the bot.
    3. Name your bot, e.g., ServerlessHelloTelegramBot. You can use it to find the bot in Telegram. The username must end with Bot or _bot.

    In case of success, you will get a welcome message and the bot’s token.

  2. Create a service account and assign it the admin role for the folder.

  3. Create a Yandex Lockbox secret with keys for the bot and YandexGPT:

    1. Under Create secret, in the Name field, specify the secret name, e.g., tg_bot_token.

    2. Under Secret data:

      1. Select Custom as the secret type.
      2. To create a key for the bot, specify BOT_TOKEN in the Key field.
      3. In the Value field, specify the bot token you got earlier.
      4. To create two keys for YandexGPT, specify GPT_FOLDER_ID and GPT_API_KEY in the Key field.
      5. In the Value field, specify FOLDER_ID and API_KEY, respectively.

      Learn how to get an API_KEY for YandexGPT in Authentication with the Yandex Foundation Models API.

  4. In the management console, go to the folder where you want to deploy the application.

  5. Select Cloud Apps.

  6. I n the left-hand panel, select Marketplace.

  7. Select Demo Telegram Bot YandexGPT and click Use.

  8. Specify the following:

    • Application name.
    • Optionally, application description.
    • Service account with the admin role for the folder, or select Auto to have the service account created when installing the application. This service account will be used to create the application resources.
    • ID of the Yandex Lockbox secret you created earlier.
  9. Click Install.

  10. In the Checking changes window that opens, click Confirm and wait for the installation to complete.

  11. On the Overview page, find the API gateway under Application resources, go to the gateway page, and copy the service domain link.

  12. To bind the function to the Telegram bot, run a request. Replace <bot_token> with your Telegram bot token, and <API_gateway_domain> with a link to your API gateway’s service domain.

    • For Linux/macOS

      curl \
        --request POST \
        --url https://api.telegram.org/bot<bot_token>/setWebhook?url=https://<API_gateway_domain>/echo
      
    • For Windows (cmd)

      curl ^
        --request POST ^
        --url "https://api.telegram.org/bot<bot_token>/setWebhook?url=https://<API_gateway_domain>/echo"
      
    • For Windows (PowerShell)

      curl.exe `
        --request POST `
        --url https://api.telegram.org/bot<bot_token>/setWebhook?url=https://<API_gateway_domain>/echo
      

    Result:

    {"ok":true,"result":true,"description":"Webhook was set"}
    
  13. Send the /start command to the bot in Telegram. Now you can start asking it questions.

  14. You can conveniently continue developing the bot by cloning the SourceCraft repository cloudapp-tgbot-yandexg and setting up integration with the deployed Cloud App according to the instructions in README.md

Free

The usage cost for the product and the minimum required resource configuration
As of May 1, 2026, new prices apply to certain Yandex Cloud services.Learn more in the blog
Create an application
Billing type
Free
Type
Cloud Apps
Category
Developer tools
ML & AI
Publisher
Yandex Cloud
Use cases
  • Sending questions to a Telegram bot and getting answers from YandexGPT.
Technical support

Yandex Cloud technical support is available 24/7. The types of requests you can submit and the relevant response times depend on your pricing plan. You can switch to the paid support plan in the management console. You can learn more about the technical support terms and conditions here.

Product IDs
Product:
f2ete5nsqkarag5hifbi
Application resources
Resource typeQuantity
Service accounts4
Service account static access key1
Access rights for folder7
Message queue1
Serverless function1
Cloud Functions trigger1
API gateway1
Terms
By using this product you agree to the Yandex Cloud Marketplace Terms of Service

Free

The usage cost for the product and the minimum required resource configuration
As of May 1, 2026, new prices apply to certain Yandex Cloud services.Learn more in the blog
Create an application
Billing type
Free
Type
Cloud Apps
Category
Developer tools
ML & AI
Publisher
Yandex Cloud