๐ฌ Telegram bot with ChatGPT & Claude Python-based, using OpenAI's API.
See the code
ChatGPT, re-created as a Telegram bot โ and it works great.
GPT-5.5 ยท Anthropic Claude (Opus / Sonnet / Haiku) ยท Vision ยท Voice ยท Image generation
Fast replies, no daily limits, message streaming and 15 special chat modes.
Web chatbots are great โ but they're often laggy, rate-limited, and locked behind a browser tab. This project puts the best models from OpenAI and Anthropic right inside Telegram, with your own API keys and no daily limits.
๐ Try the live bot: @jadvebot ยท ๐ Web: jadve.com โ or deploy your own in two commands (Quick start โ).
gpt-image-1 (switch to ๐ฉโ๐จ Artist mode).config/chat_modes.yml./help_group_chat for setup instructions./balance.Models are config-driven โ add or remove any in config/models.yml with no code changes.
| Model | Provider | Vision | Smart | Fast | Cheap | In / Out per 1K tokens |
|---|---|---|---|---|---|---|
| GPT-4o mini (default) | OpenAI | โ | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข๐ข | $0.00015 / $0.0006 |
| GPT-4o | OpenAI | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | $0.0025 / $0.01 |
| GPT-5.5 | OpenRouter | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข | ๐ข๐ข | $0.005 / $0.03 |
| Claude Opus 4.8 | OpenRouter | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข | ๐ข๐ข | $0.005 / $0.025 |
| Claude Sonnet | OpenRouter | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข | $0.003 / $0.015 |
| Claude Haiku | OpenRouter | โ | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | $0.001 / $0.005 |
Plus gpt-image-1 for image generation and Whisper for voice transcription.
๐ก OpenAI models use the native API. Claude and GPT-5.5 are routed through OpenRouter โ just set
openrouter_api_keyand pick the model in/settings. Any other OpenRouter-routed model works too: declareprovider: openrouterinconfig/models.yml.
| ๐ฉ๐ผโ๐ General Assistant | ๐ฉ๐ผโ๐ป Code Assistant | ๐ฉโ๐จ Artist |
| ๐ฌ๐ง English Tutor | ๐ก Startup Idea Generator | ๐ Text Improver |
| ๐ง Psychologist | ๐ Elon Musk | ๐ Motivator |
| ๐ฐ Money Maker | ๐ SQL Assistant | ๐งณ Travel Guide |
| ๐ฅ Rick Sanchez | ๐งฎ Accountant | ๐ฌ Movie Expert |
Create your own by editing config/chat_modes.yml.
1. Get an OpenAI API key.
2. (optional) Get an OpenRouter API key to use Claude and GPT-5.5.
3. Get a Telegram bot token from @BotFather.
4. Fill in your tokens and rename the config files:
mv config/config.example.yml config/config.yml
mv config/config.example.env config/config.env
# then edit config/config.yml โ set telegram_token, openai_api_key (and openrouter_api_key for Claude/GPT-5.5)
5. ๐ฅ Run it:
docker-compose --env-file config/config.env up --build
That's it โ message your bot on Telegram.
Main options in config/config.yml:
| Option | Description |
|---|---|
telegram_token | Bot token from @BotFather |
openai_api_key | Your OpenAI API key |
openai_api_base | Custom base URL (e.g. LocalAI); leave null for default |
openrouter_api_key | Needed only for provider: openrouter models (Claude, GPT-5.5) |
allowed_telegram_usernames | Whitelist of users/IDs; empty = open to everyone |
new_dialog_timeout | Seconds before a new dialog starts automatically |
image_size | gpt-image-1 output size (1024x1024, 1536x1024, 1024x1536, auto) |
enable_message_streaming | Stream answers word-by-word |
Per-model pricing and capabilities live in config/models.yml.
| Command | Description |
|---|---|
/new | Start a new dialog |
/mode | Select a chat mode |
/retry | Regenerate the last answer |
/settings | Choose model and settings |
/balance | Show $ spent on the API |
/help | Show help |
bot/
bot.py # Telegram handlers, streaming, commands
openai_utils.py # model dispatch (OpenAI + OpenRouter), token counting, vision
config.py # loads config.yml / models.yml / chat_modes.yml
database.py # MongoDB storage for users & dialogs
config/
config.yml # your tokens & settings
models.yml # model catalog, pricing, capabilities
chat_modes.yml # chat-mode prompts
python-telegram-bot 20.x ยท OpenAI Python SDK 1.x ยท MongoDB ยท Docker ยท Python 3.12
See the full history in CHANGELOG.md.
You can be on this list:
MIT โ do whatever you want, just keep the notice.
1,871 followers ยท starred Mar 2023
1,436 followers ยท starred Mar 2024
367 followers ยท starred Mar 2023
118 followers ยท starred May 2024
๐ฌ Telegram bot with ChatGPT & Claude Python-based, using OpenAI's API.
See the code
ChatGPT, re-created as a Telegram bot โ and it works great.
GPT-5.5 ยท Anthropic Claude (Opus / Sonnet / Haiku) ยท Vision ยท Voice ยท Image generation
Fast replies, no daily limits, message streaming and 15 special chat modes.
Web chatbots are great โ but they're often laggy, rate-limited, and locked behind a browser tab. This project puts the best models from OpenAI and Anthropic right inside Telegram, with your own API keys and no daily limits.
๐ Try the live bot: @jadvebot ยท ๐ Web: jadve.com โ or deploy your own in two commands (Quick start โ).
gpt-image-1 (switch to ๐ฉโ๐จ Artist mode).config/chat_modes.yml./help_group_chat for setup instructions./balance.Models are config-driven โ add or remove any in config/models.yml with no code changes.
| Model | Provider | Vision | Smart | Fast | Cheap | In / Out per 1K tokens |
|---|---|---|---|---|---|---|
| GPT-4o mini (default) | OpenAI | โ | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข๐ข | $0.00015 / $0.0006 |
| GPT-4o | OpenAI | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | $0.0025 / $0.01 |
| GPT-5.5 | OpenRouter | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข | ๐ข๐ข | $0.005 / $0.03 |
| Claude Opus 4.8 | OpenRouter | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข | ๐ข๐ข | $0.005 / $0.025 |
| Claude Sonnet | OpenRouter | โ | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข | $0.003 / $0.015 |
| Claude Haiku | OpenRouter | โ | ๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข๐ข | ๐ข๐ข๐ข๐ข | $0.001 / $0.005 |
Plus gpt-image-1 for image generation and Whisper for voice transcription.
๐ก OpenAI models use the native API. Claude and GPT-5.5 are routed through OpenRouter โ just set
openrouter_api_keyand pick the model in/settings. Any other OpenRouter-routed model works too: declareprovider: openrouterinconfig/models.yml.
| ๐ฉ๐ผโ๐ General Assistant | ๐ฉ๐ผโ๐ป Code Assistant | ๐ฉโ๐จ Artist |
| ๐ฌ๐ง English Tutor | ๐ก Startup Idea Generator | ๐ Text Improver |
| ๐ง Psychologist | ๐ Elon Musk | ๐ Motivator |
| ๐ฐ Money Maker | ๐ SQL Assistant | ๐งณ Travel Guide |
| ๐ฅ Rick Sanchez | ๐งฎ Accountant | ๐ฌ Movie Expert |
Create your own by editing config/chat_modes.yml.
1. Get an OpenAI API key.
2. (optional) Get an OpenRouter API key to use Claude and GPT-5.5.
3. Get a Telegram bot token from @BotFather.
4. Fill in your tokens and rename the config files:
mv config/config.example.yml config/config.yml
mv config/config.example.env config/config.env
# then edit config/config.yml โ set telegram_token, openai_api_key (and openrouter_api_key for Claude/GPT-5.5)
5. ๐ฅ Run it:
docker-compose --env-file config/config.env up --build
That's it โ message your bot on Telegram.
Main options in config/config.yml:
| Option | Description |
|---|---|
telegram_token | Bot token from @BotFather |
openai_api_key | Your OpenAI API key |
openai_api_base | Custom base URL (e.g. LocalAI); leave null for default |
openrouter_api_key | Needed only for provider: openrouter models (Claude, GPT-5.5) |
allowed_telegram_usernames | Whitelist of users/IDs; empty = open to everyone |
new_dialog_timeout | Seconds before a new dialog starts automatically |
image_size | gpt-image-1 output size (1024x1024, 1536x1024, 1024x1536, auto) |
enable_message_streaming | Stream answers word-by-word |
Per-model pricing and capabilities live in config/models.yml.
| Command | Description |
|---|---|
/new | Start a new dialog |
/mode | Select a chat mode |
/retry | Regenerate the last answer |
/settings | Choose model and settings |
/balance | Show $ spent on the API |
/help | Show help |
bot/
bot.py # Telegram handlers, streaming, commands
openai_utils.py # model dispatch (OpenAI + OpenRouter), token counting, vision
config.py # loads config.yml / models.yml / chat_modes.yml
database.py # MongoDB storage for users & dialogs
config/
config.yml # your tokens & settings
models.yml # model catalog, pricing, capabilities
chat_modes.yml # chat-mode prompts
python-telegram-bot 20.x ยท OpenAI Python SDK 1.x ยท MongoDB ยท Docker ยท Python 3.12
See the full history in CHANGELOG.md.
You can be on this list:
MIT โ do whatever you want, just keep the notice.
1,871 followers ยท starred Mar 2023
1,436 followers ยท starred Mar 2024
367 followers ยท starred Mar 2023
118 followers ยท starred May 2024