Skip to content

ChatGPT-Telegram-Workers

Telegram bot that answers private and group chats with OpenAI, Anthropic or Workers AI models, set up in a Mini App

Telegram chat where the bot offers Claude models under /models and identifies a dog in an uploaded photo

ChatGPT-Telegram-Workers runs a Telegram AI bot on one Cloudflare Worker with a single KV namespace. Model providers, prompts, permissions, plugins and custom commands are managed in an admin panel instead of environment variables.

Message the bot privately or add it to a group, and it streams answers from the model you configured, keeps history for each chat and can generate images. It speaks four API formats: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Cloudflare Workers AI. Any OpenAI-compatible endpoint, such as DeepSeek, Groq or Mistral, works as well. Since version 2.0.0 (September 2026), almost all configuration lives in the admin panel. Send /admin and the panel opens in Telegram as a Mini App, authorized against your Telegram user ID; an optional password also opens it in a normal browser. There you add chat and image providers, each with a base URL, API key, API format and model list, and set the system prompt and history limits. The same panel holds request-template plugins and custom commands that switch the default provider or model. A KV namespace stores chat history, caches and the global config JSON. The shipped wrangler.jsonc declares a Workers AI binding, so Workers AI models run without an account ID or API token. The code also builds for Vercel, Docker and a local Node server. The Deploy to Cloudflare button clones the repository, creates the KV namespace and asks for TELEGRAM_TOKEN and ADMIN_ID, with ADMIN_PASSWORD as an option.

Built for: Individuals and small groups who want their own AI chat bot in Telegram, paid for with their own model API keys

What you can use it for

  • Run a private AI assistant inside Telegram
  • Give a Telegram group a shared model, with permissions set in the admin panel
  • Switch between OpenAI, Anthropic, DeepSeek and Workers AI models with /models
  • Generate images in a chat with /img and an OpenAI or Workers AI image model
  • Add request-template commands through the plugin system

Deploy

  • One-click · main path

    Branch master

  • CLI

    Branch master

    Before deploying, put the KV namespace ID and a vars block with TELEGRAM_TOKEN and ADMIN_ID into wrangler.jsonc, as doc/en/DEPLOY.md shows. Then open the Worker URL and click Bind Webhook.

    git clone https://github.com/TBXark/ChatGPT-Telegram-Workers.git
    cd ChatGPT-Telegram-Workers
    pnpm install
    pnpm wrangler login
    pnpm wrangler kv namespace create DATABASE
    pnpm run deploy

Create a bot with BotFather and find your Telegram user ID. After the button deploy, click Bind Webhook on the Worker URL, then add a model provider in the admin panel.

What it needs to run

  • Workers AIAI
  • KV namespacesDATABASE

Also uses

  • Anthropic API (optional): Claude models through the Anthropic Messages API format
  • OpenAI API (optional): API key for OpenAI or another OpenAI-compatible provider such as DeepSeek, Groq or Mistral; Workers AI models need no keySource

Good to know

Telegram is the only chat channel. Every model except Workers AI needs your own provider API key. In groups, the bot sees @mentions only after privacy mode is disabled in BotFather, and public groups also need it added as an administrator. Version 2.0.0 dropped the old environment-variable configuration, so 1.x deployments have to migrate by following MIGRATION.md. Much of the issue tracker is in Chinese.

Cost on Cloudflare

Likely fits the free plan

The bot needs one Worker and one KV namespace. Workers Free allows 100,000 requests per day, and KV Free allows 100,000 reads and 1,000 writes per day. Chat history is written to KV, so busy group chats can use up the 1,000 daily writes. Workers AI includes 10,000 Neurons per day; other model providers bill you directly.

Source

The estimate is based on Cloudflare’s documented limits and the app’s configuration. What you pay depends on your usage and plan.

Where this comes from

Listing history

  • Oct 2, 2026 · ChatGPT-Telegram-Workers listed
  • Cloudflare OS workspace with the agent chat beside a six-slide Q3 planning deck it generated

    Agent workspace for companies, with AI-built mini apps and approval controls on outside actions with side effects

    Deploy
    One-click
    License
    Apache-2.0
    GitHub stars
    11.2k stars
    Last commit
  • Moltworker assistant in Slack answering a route request with a Google Maps screenshot taken through Browser Run

    Cloudflare's proof of concept for hosting the OpenClaw personal AI assistant in a Sandbox container

    Deploy
    One-click
    License
    Apache-2.0
    GitHub stars
    9.9k stars
    Last commit
  • Company Brain Proactivity settings: All channels or Only its own channel, with a picker for channel exceptions

    Slack assistant that remembers team conversations, answers from them and acts in GitHub, Linear and Notion

    Deploy
    One-click
    License
    Apache-2.0
    GitHub stars
    963 stars
    Last commit