https://github.com/lifailon/openrouter-bot
This project allows to launch your Telegram bot in a few minutes to communicate with free or paid AI models via OpenRouter.
https://github.com/lifailon/openrouter-bot
ai ai-integration chat-bot go gpt llm llm-inference openrouter telegrambot
Last synced: about 1 month ago
JSON representation
This project allows to launch your Telegram bot in a few minutes to communicate with free or paid AI models via OpenRouter.
- Host: GitHub
- URL: https://github.com/lifailon/openrouter-bot
- Owner: Lifailon
- License: mit
- Created: 2025-07-01T22:49:32.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2025-08-21T08:30:40.000Z (about 2 months ago)
- Last Synced: 2025-08-28T16:59:33.442Z (about 1 month ago)
- Topics: ai, ai-integration, chat-bot, go, gpt, llm, llm-inference, openrouter, telegrambot
- Language: Go
- Homepage: https://hub.docker.com/r/lifailon/openrouter-bot
- Size: 331 KB
- Stars: 39
- Watchers: 0
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
![]()
OpenRouter
Bot
English (๐บ๐ธ) | ะ ัััะบะธะน (๐ท๐บ)This project allows you to launch your Telegram bot in a few minutes to communicate with free and paid AI models via [OpenRouter](https://openrouter.ai), or local LLMs, for example, via [LM Studio](https://lmstudio.ai).
> [!NOTE]
> This repository is a fork of the [openrouter-gpt-telegram-bot](https://github.com/deinfinite/openrouter-gpt-telegram-bot) project, which adds new features (such as switch current model and `Markdown` formatting in bot responses) and optimizes the container startup process.Example
![]()
## Preparation
- Register with [OpenRouter](https://openrouter.ai) and get an [API key](https://openrouter.ai/settings/keys).
- Create your Telegram bot using [@BotFather](https://telegram.me/BotFather) and get its API token.
- Get your telegram id using [@getmyid_bot](https://t.me/getmyid_bot).
> [!TIP]
> When you launch the bot, you will be able to see the IDs of other users in the log, to whom you can also grant access to the bot in the future.## Installation
To run locally on Windows or Linux system, download the pre-built binary (without dependencies) from the [releases](https://github.com/Lifailon/openrouter-bot/releases) page.
### Running in Docker
- Create a working directory:
```bash
mkdir openrouter-bot
cd openrouter-bot
```- Create `.env` file and fill in the basic parameters:
```bash
# OpenRouter api key
API_KEY=
# Free modeles: https://openrouter.ai/models?max_price=0
MODEL=deepseek/deepseek-r1:free
# Telegram api key
TELEGRAM_BOT_TOKEN=
# Your Telegram id
ADMIN_IDS=
# List of users to access the bot, separated by commas
ALLOWED_USER_IDS=
# Disable guest access (enabled by default)
GUEST_BUDGET=0
# Language used for bot responses (supported: EN/RU)
LANG=EN
```The list of all available parameters is listed in the [.env.example](https://github.com/Lifailon/openrouter-bot/blob/main/.env.example) file
- Run a container using the image from [Docker Hub](https://hub.docker.com/r/lifailon/openrouter-bot):
```bash
docker run -d --name OpenRouter-Bot \
-v ./.env:/openrouter-bot/.env \
--restart unless-stopped \
lifailon/openrouter-bot:latest
```The image is build for `amd64` and `arm64` (Raspberry Pi) platforms using [docker buildx](https://github.com/docker/buildx).
## Build
```bash
git clone https://github.com/Lifailon/openrouter-bot
cd openrouter-bot
docker-compose up -d --build
```