A Telegram bot that allows users to chat with AI models via OpenRouter API. Most code written with help of claude 3.7, so dont really look on overall quality. Function wise bot is pretty good!
- Chat with any model available on OpenRouter
- Password protection for bot access
- Customizable model list
- Credits balance checking
- Support for reasoning models with step-by-step thinking
- Proper formatting of responses in Telegram
- Git
- Docker/Go
make deploy BOT_PASSWORD=<password that you and your friend can know>
The bot will automatically restart if it crashes or if the server reboots.
- Set required environment variables:
export TELEGRAM_TOKEN="your_telegram_token_here" export BOT_PASSWORD="your_secure_password_here"
- Run the bot:
go run .
- Start a chat with the bot on Telegram
- Enter the password to authorize (set in BOT_PASSWORD environment variable) (only one time)
- Set your OpenRouter API token using /settoken <your_token> (only one time)
- Choose a model with /setmodel <model_name>
- Start chatting with the AI!
/help - Show help message
/settoken - Set your OpenRouter API token
/model - Show current AI model
/models - List available AI models
/setmodel - Set current AI model by name
/addmodel - Add a new model to your list
/removemodel - Remove a model from your list
/getcredits - Check your OpenRouter credits balance
/debug - Toggle debug logging mode
- Bot doesn't start: Check that TELEGRAM_TOKEN and BOT_PASSWORD are set correctly
- Bot doesn't respond: Check the logs for errors (
make logs
) - Formatting issues: The bot tries to handle various formatting, but some complex markdown might not render correctly (
make logs
)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under DO WHAT DO YOU WANT, I DONT CARE license