← All guides

Updated October 2026

Run your own AI agent as a Telegram bot

You can message an AI agent on Telegram and have it work on your computer: research something, update a file, check your calendar or kick off a scheduled job. With CoWork OS the bot runs from your own machine or server, uses the model you choose, and only answers people you approve.

What you need

  • CoWork OS installed on a computer that stays on while you want the bot available, or the headless daemon on a Linux server.
  • A Telegram account.
  • A working model connection in CoWork OS (cloud or local).

1. Create a bot with BotFather

In Telegram, open a chat with @BotFather, send /newbot, choose a name and username, and copy the token it gives you.

2. Connect the bot in CoWork OS

  1. Open Settings → Channels and choose Telegram.
  2. Click Add Telegram Bot and paste the token.
  3. Set Security Mode to Pairing Code (Recommended).

3. Pair your Telegram account

Click Generate DM Pairing Code, then send that code to your bot in Telegram. Until someone pairs, the bot replies that they are not authorised and asks for a code. Codes are six characters, and five wrong attempts lock a sender out for 15 minutes.

Security modeWho can use the bot
Pairing Code (Recommended)Only people who enter a code you generated
Allowlist OnlyOnly accounts you list
Open (Anyone can use)Anyone who finds the bot; avoid this for an agent with access to your files

4. Send it a task

Try "Summarise the PDFs in my Reports folder and send me the key points." Tasks from Telegram follow the same access profile as tasks on the desktop, so actions that need approval still wait for you.

Why not a hosted Telegram AI bot?

A hosted bot sends your messages and files to someone else's server and usually locks you to one model. Running it yourself keeps your workspace and history on your machine and lets you switch models, including local ones. The full reference is in the channels documentation.

Frequently asked questions

How do I make a self-hosted AI Telegram bot?

Create a bot with @BotFather, copy the token, add it in CoWork OS under Settings → Channels with Add Telegram Bot, and pair your account with a pairing code. The bot then runs from your own computer or server.

Can strangers use my Telegram AI bot?

Not with the recommended Pairing Code mode. Only people who enter a code you generate can use it, and repeated wrong codes lock the sender out for 15 minutes.

Does the Telegram bot need my computer to stay on?

Yes, the bot runs where CoWork OS runs. For an always-on bot, run the CoWork OS headless daemon on a Linux server.

Can the Telegram bot use a local model?

Yes. The bot uses whichever model CoWork OS is set to, including Ollama or MLX running on your own machine.

CoWork OS itself is free and open source. Model providers, gateways, connected services, and account plans may charge separately and apply their own eligibility and usage rules.

Last reviewed 2026-10-20 against official documentation. Features, plans and prices change; check the linked sources before deciding. CoWork OS is not affiliated with Telegram.