camelRun by camelAI · Telegram

Build a Telegram AI bot

Paste a BotFather token into camelRun, the hosted runtime for AI agents, and every Telegram chat gets its own durable agent — no relay server to host. Replies stream natively, voice notes and photos land in the workspace, approvals show as buttons, and idle chats sleep at $0.

09:00
ChatsErrandsbot
October 19

what's on my list this week?08:12

Three things: the dry cleaning on Saturday, your library books by Monday the 26th, and Miso's checkup at the vet, no date yet.08:12

Yesterday
Voice message, 0:0721:14

Done. I scheduled a 9:00 reminder tomorrow to call the vet about Miso. You also have the dry cleaning to pick up.21:14

Today

Morning, Ada. Time to call the vet about Miso. They open at 9.09:00

Message
errands · @adaWoke at 9:00 via schedule · asleep againch_7f3a…_t_6029147385_f5fc

Native Telegram channel

From BotFather token to AI agent

Open Integrations › Channels in the console, pick Telegram, and paste your BotFather token. camelRun verifies it with getMe, registers your webhook with a random secret_token, and returns a pairUrl so you tap Start to claim ownership — zero bot server required.

21:02
ChatsBotFatherbot

/newbot21:02

Alright, a new bot. How are we going to call it? Please choose a name for your bot.21:02

Errands21:02

Good. Now let's choose a username for your bot. It must end in bot.21:02

errands_ai_bot21:03

Done! Congratulations on your new bot. You will find it at t.me/errands_ai_bot.Use this token to access the HTTP API:7425190364:AAGW3kQKeep your token secure and store it safely, it can be used by anyone to control your bot.21:03

MenuMessage
run.camelai.com/console/integrations/channels

New Telegram channel

Bot token••••••••••••••••••
CancelCreate channel
21:05
ChatsErrandsbot

/start21:05

Paired. You're the owner of this bot; your messages now reach the agent.21:05

hi! what can you do?21:05

I can check your Errands list, save files you send, and message you when a scheduled reminder fires.21:05

Message
errands · @adaSleeping at $0 until her next message

Or create the channel in one API call

Send your botToken and definition slug to POST /v2/channels, with optional scope, access (owner, allowlist, or anyone with confirm: true), and limits. You get back a masked token, webhookUrl, and QR-ready pairUrl.

Channel docs
Terminal
curl -X POST https://run.camelai.com/v2/channels \
  -H "Authorization: Bearer $CAMELRUN_API_KEY" -H "Content-Type: application/json" \
  -d '{"kind":"telegram","credentials":{"botToken":"$TELEGRAM_BOT_TOKEN"},
       "definition":"errands"}'

Every Telegram chat has its own AI agent

With scope: "thread" (the default), each chat or group forum topic gets a deterministic agent keyed ch_<channel>_<conversation>_<hash> — or switch to chat, user, shared, or your own keyTemplate. Inbound media up to 20 MB lands in channel-files/, vision models read photos directly, and send_channel_message delivers photos and documents back.

Ada's phone
21:14
ChatsErrandsbot
Voice message, 0:0721:14

Done. I scheduled a 9:00 reminder tomorrow to call the vet about Miso. You also have the dry cleaning to pick up.21:14

Message
errands · @adach_7f3a…_t_6029147385_f5fcAsleep
Kenji's phone
18:40
ChatsErrandstyping…

can you remind me the day before?18:40

Message
errands · @kenji_mch_7f3a…_t_5873310264_6af6Running
Priya's phone
07:56
ChatsErrandsbot

send me this week's list as a file07:55

Your week: five errands, two of them on Saturday.07:56

errands-week.md1.1 KB07:56
Message
errands · @priya_rch_7f3a…_t_7105948832_c484Asleep
Tomás's phone
12:31
ChatsErrandsbot

what's left for today?12:31

Two things: pick up your prescription, and give Sam his drill back.12:31

Message
errands · @tomas_gch_7f3a…_t_6640217751_ba38Asleep

Tools, identity & approvals

Let your Telegram AI bot call your own API

Remote MCP servers with auth: { type: "runtime" } receive short-lived Ed25519-signed JWTs carrying sub, act, and origin, while HTTPS webhook tools get X-CamelRun-Agent, X-CamelRun-Run, and origin in the request body. Approval-gated calls pause on native Telegram Approve / Deny buttons, and scheduled wakeups post back through send_channel_message.

webhook-tool.ts
// Your HTTPS webhook tool — credentials stay on your server.
export async function POST(req: Request) {
  if (req.headers.get("x-tool-secret") !== process.env.TOOL_SECRET) {
    return new Response("Unauthorized", { status: 401 });
  }
  const { name, args, origin } = await req.json();
  const telegramUserId = origin?.from?.verified ? origin.from.id : null;
  if (!telegramUserId) return new Response("Forbidden", { status: 403 });
  if (name === "list_todos") return Response.json(await db.todos(telegramUserId));
  return Response.json(await scheduleReminder(telegramUserId, args));
}
run.camelai.com/console/agents/agt_7f3a…
Agents

errands · @ada

Asleep

Asleepazure/gpt-6.1-terra· telegram· definition errands

ChatRunsFilesSchedulesSettings
Telegram voice note (saved to channel-files/)
voice.oggaudio/ogg · 11.8 KB“Remind me to call the vet about Miso tomorrow morning. They open at nine.”
app__list_todos({})
▸ Result of app__list_todos
app__add_reminder({"prompt":"Remind Ada to call the vet about Miso. They open at 9.","runAt":"2026-10-24T09:00:00+01:00"})
▸ Result of app__add_reminder

Done. I scheduled a 9:00 reminder tomorrow to call the vet about Miso. You also have the dry cleaning to pick up.

Fork from here

Menu

What people ask about Telegram AI bots

How do I connect a Telegram bot to camelRun?

Make a new bot through @BotFather, then paste its token under Integrations › Channels or call POST /v2/channels. camelRun validates the token via getMe, configures the webhook automatically, masks the credential, and generates a pairing link (t.me/<bot>?start=<code>) — open it or scan a QR code to pair as owner with no relay server to host. The channel docs cover every access and scope option.

Does every Telegram chat remember past conversations?

Yes. By default each direct chat or group forum topic gets its own deterministic agent (ch_<channel>_<conversation>_<hash>) that keeps the whole history and workspace files until you delete it. You can also switch scope to chat, user, shared, or a custom keyTemplate.

How do streaming, groups, and approvals work in Telegram?

Private chats stream natively through Telegram's sendMessageDraft while group chats post once and edit roughly every second, with replies formatted as Telegram HTML and split cleanly at 4,096 characters. In groups the bot responds to @mentions and replies to its own messages, and ask_human or approval-gated tools render native Approve and Deny buttons right in the chat.

Can my Telegram bot handle voice notes, photos, and files?

Yes. Photos, documents, audio, voice notes, and videos up to 20 MB are saved automatically into channel-files/ inside the agent's workspace, with voice notes transcribed and photos routed to vision-capable models. When the agent shares files back through send_channel_message, photos go out up to 10 MB and other documents up to 50 MB.

How does a Telegram bot call my own API or MCP servers?

Connect remote MCP servers using runtime auth so every call arrives with a short-lived Ed25519 JWT naming the agent (sub), actor (act), and Telegram sender (origin), or point custom HTTPS webhook tools at your backend where each POST carries origin alongside the X-CamelRun-Agent and X-CamelRun-Run headers. Your database credentials stay strictly on your own server. See the tools docs for both patterns.

Can a Telegram agent message first or be tested privately?

Yes. Combine agent schedules with the built-in send_channel_message tool so wakeups post proactive reminders straight into the chat (capped by limits.proactivePerDay, default 100 per day). Before going live, run POST /v2/channels/:id/test privately without posting to Telegram, and inspect 14 days of delivery outcomes at GET /v2/channels/:id/events without storing message bodies.

How much does a Telegram AI bot cost on camelRun?

Active agent runs bill at $0.05 per active agent-hour, and active Linux container bash bills at $0.00005 per second ($0.18/hr) with free pre-warming. Idle, queued, parked, and waiting chats cost $0, storage is unmetered right now, and model tokens are $0 from camelRun on BYOK or pass-through on direct providers.

What can this bot do?

Launch your Telegram AI bot

Paste your BotFather token into Integrations › Channels, tap Start on your pairing link, and message your bot. Your first conversation spins up a durable agent on the spot.

Read the quickstart
Connect your coding agent (no key)

claude mcp add --transport http camelrun https://run.camelai.com/mcp

Adds camelRun's hosted MCP server to Claude Code (also works with Codex and ChatGPT). Signing in creates your account automatically.