Claude
Anthropic's Claude API for building custom apps and bots (e.g. Telegram).
When to use it
-
You need a conversational AI in your app or a custom Telegram/Discord/Slack bot.
-
You want long context, good instruction-following, and optional vision/tool use via the API.
Hands-on
-
Prerequisites — Anthropic API key; Node or Python.
-
API — docs.anthropic.com. Use the Messages API for chat-style completion.
-
Playgrounds —
playgrounds/claude-api-quickstart/(minimal API call),playgrounds/telegram-ai-bot/(Claude + Telegram).
Telegram
Use the custom bot pattern: Telegram → your server → Claude API → reply. No native Claude Telegram app; we provide a skeleton.
-
Playground —
playgrounds/telegram-ai-bot/: Python +python-telegram-bot; env vars forTELEGRAM_BOT_TOKENandANTHROPIC_API_KEY. Optional: file handling, SQLite for conversation history. -
When to choose — Use this when you want minimal custom logic and full control. Use OpenClaw when you want one local gateway for Telegram and other channels.
See Telegram hub for comparison and security notes.
Quick product recipe
Claude API + Telegram bot that answers from a PDF or URL (~15 min).
- Clone this repo;
cd playgrounds/telegram-ai-bot. - Set
TELEGRAM_BOT_TOKENandANTHROPIC_API_KEYin env (or.env). - Install deps:
pip install -r requirements.txt(or see README). - Run the bot:
python bot.py(or the command in the README). - Send a message in Telegram; the bot replies via Claude. Optionally extend the bot to accept a URL and summarize it with Claude.
Playground: playgrounds/telegram-ai-bot/.